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

We stored into the objects OR and then write the scripting

0 Answers   L&T, Wipro,


tell me about if in the interview what i should tell about pharma application,what r the pharma application concepts,i need pharma application testing features

0 Answers  


what is difference between calling a function and reusing an action?

1 Answers  


write is the code for regular expression in QTP

2 Answers   IBM, Infosys,


Explain different types of action in qtp?

0 Answers  






HOW TO DO THE BATCH TESTING USING QTP?

2 Answers   Ordain Solutions,


What are the trigger events in qtp?

0 Answers  


can u explain relative path architecture framework in qtp?

0 Answers   Mindlance,


How to Compare two database tables by using QTP?Please give me code details.

1 Answers  


How many number of actions possible in qtp?

0 Answers  


how to create external data table?

1 Answers   TCS,


Hi Frenz... I would like to take up the QTP certification . Can anyone tell me what is the procedure. n if anybody have the study materials pls fwd it to jkpunathil@gmail.com

0 Answers  


Categories