Can anybody help me by sharing the code for checkbox in qtp
using vbscript.

Answer Posted / kotike

for example you have 20 checkboxes in a webpage. If You
want check those check boxes. Then

Set oBrowser=Description.Create()
oBrowser("micclass").value="Browser"

set oPage=Description.Create()
oPage("micclass").Value="Page"

set oCB=Description.Create()
oLink("micclass").Value="WebCheckBox"

set cboxes=Browser(oBrowser).Page(oPage).childobjects(oCB)
msgbox cboxes.count 'it will display the no of checkboxes
in webpage

for i=0 to cboxes.count-1
cboxes(i).set "ON"
Next

'if you want uncheck use "OFF" instead of "ON"
set oBrowser=NOthing

regards,
mahi.kotike@gmail.com

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are metrics and matrix?

1549


what is clean sweep?

2058


how can we test the Triggers, Cursors, Indexes while doing Database testing in DTP??

1819


How can you identify the browser and its information using the qtp script?

782


Pls can anybody send me the Recent Technical and Interview Questions Which were asked in IBM(QTP)Automation PLZZZZZZZZZ

1788


what is clean sweep?

1718


If I give some thousand tests to execute in two days what do you do?

793


How will you test a stapler?

823


What is a quick test professional?

927


Pls can anyone give me the entire code for the Keyword driven framework with respect to he Flight Reservation Window in detail with explanation. Pls explain in detail stepwise. Thanks a lot. Pls very urgent?.

1761


What kinds of security (firewalls, encryptions, passwords, etc.) will be required and what is it expected to do? How can it be tested?

845


How to import a test case present in ".xls" file to TD under a Test set?

983


While spliting an action in QTP 10.0 getting an error : "This Line is a part of Script Block.You cannot split the action on this line." how to re-solve this and split the script into actions?

1669


i have two questions for regular expression :- Q1. I have date pattern eg-29/11/2011 29-11-2011 29.11.2011 Que- if any separator is there between date,month and year pattern should match else it should not match eg- pattern should not match in case of 2911-2011 Q2. let say i have a string and there is a number in between of that string eg.-Amount 30002.234 successfully credited to your account . now i have to match this pattern in such a way that even if decimal is not there pattern should match ,how i will do this using regular expression

1227


Can we access the java methods in qtp. Because my requirement is to access the swt(for eclipse an it is java code) methods in qtp is it possible?

1780