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

c language is thre but what is the purpose of c++, java is there but what is the purpose of Advanced java ....why these are all versions are coming...whta is the problem?

2 Answers   Accenture,


How can i check items sorted or not in a weblist ? Give me the script for this...

0 Answers  


what is keyword driven framework in qtp.

13 Answers   Cognizant, TCS,


Can we Test Welcome Screens and Process Images with QTP

0 Answers  


What r the different type of reports generated in Quality Center?

1 Answers   TCS,






what is bultin funtaion in QTP &tell me five examples?

5 Answers   Kanbay,


What is meant by Step Generator in Qtp How is it used? pls gimme in detail

7 Answers   AppLabs,


How software tester can use constants and variables in scripts?

0 Answers  


New to QTP: In a qtp flight booking application, I tried to parameterize the to and from drop down lists using data table, depending on ur drop down selection it will pop up a list of flights. Here I am not finding a way to select flight randomly from given list... Thanks in advance guys.

1 Answers  


Deal All, Recently i face one interview question in one company. str="test12@#3456" In This i want to print like special character and numeric ,word in one script please tell me how to write the code for this Thanks Balaji

1 Answers  


does test plan is in test strategy or test strategy is in test plan

2 Answers   Tanla Solutions,


I am using descriptive programming for my project.when QTP deosn't identity or recognize a object by record and playback method,is it possible to make QTP identify that object using descriptive programming? Note: The object doesn't have unique properties and same properties used in Record and playback are only available, no extra properties are defined.

3 Answers  


Categories