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 happen in object repository(shared)if we call an existing action from an external action ? and what happen in object repository(peraction)if we call an existing action from an external action ?

2 Answers   Covansys, Systel,


What are the technologies supported by qtp?

0 Answers  


Describe the differences between functions and actions in UFT?

0 Answers  


what type of framework u r using in ur organization

0 Answers   Wipro,


how to use command prompt using qtp?

8 Answers   HCL,






what are the frame work models of qtp?which frame work you follow in your company?and explain it process?

0 Answers   Covansys,


I have 5 no.of Action in my Test. Out off which i should make 3rd action as my start-up action. How should i make it?

9 Answers   IBM,


Syntax for how to call one script from another and Syntax to call one "Action" in another?

1 Answers   Crea,


in qtp how can we do test when the build is not ready

3 Answers   Mindlance,


How can we add regular expression for date field (dd/mon/yyyy)?

3 Answers   CTS,


write a script to verify the image path(src property) of the images which are in web pages.(do it by Descriptive method by creating a description object)

1 Answers  


I want some banking domain projects where can i get this projects ( anybody can help me plz)

3 Answers  


Categories