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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / ashish

Set myPage = Broeser("creationtime:=0").Page("title:=.*")
Set desc=Description.Create
desc("micclass").value="WebCheckBox"
desc("html tag").value="INPUT"

set cboxes=myPage.childObjects(desc)


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

'if you want uncheck use "OFF" instead of "ON"
set cboxes=NOthing
set desc=NOthing
set myPage=NOthing

regards,
ashishkrsahu@gmail.com

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More QTP Interview Questions

What is parameter in qtp?

0 Answers  


How to handle the exceptions using recovery secnario manager in quicktest professional?

0 Answers  


what testing activities u may want to automate?

2 Answers  


What is the syntax to use out of two characters. Pls anybody can give the answer.. Thanks in advance...

1 Answers   Navis,


On a web application I want to select list item 5 from a dropdown list. but QTP identifying this object as winobject. Then how can we select list item 5 from that dropdown list.

4 Answers  


write a function to read the items from Combobox of Flight Reservation application and save in excel.

5 Answers  


What is Parameterizing Tests?

4 Answers  


What are the features and benefits of quick test pro (qtp 8.0)?

0 Answers  


Hi, is it possible for recording shortcut key during record session? The application on which I am working is web based application. This application has several shortcut key associated with menu option. I have succesfully recorded all menu option but unable to record shortcut key.

1 Answers  


What do you mean by iteration?

0 Answers  


Tell me Three major differences between QTP & Winrunner?

5 Answers  


What is Step generator in qtp? wt is the use? can u any body explain me? plz

1 Answers  


Categories