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

Is text area check point supports for web applications?

0 Answers  


DEFECT LIFE CYCLE,WHO PUT THE STATUS AS OPEN

4 Answers   IGT,


It is regarding VBScript, how to export our function results to ExcelSheet through VBscripting. Ex: I have written add function, that result should export to Excel.

3 Answers  


How we can add objects to the object repository during the running?is it possible or not?explain

3 Answers  


Types of properties that Quick Test learns while recording?

1 Answers   Crea,






What is the extension of the qtp local repository? If it is .mtr then what is .bdb extension stands for?

0 Answers  


in QTP, we have options like (record and play,recording modes(normal,analog,low level),object identification,smart identification,object repository,synchronizing test,transactions,checkpoints(std,bitmap,text,text area,DB,XML,accessibility),regular expression,actions,data driving,parameter,parameterization,data tables,recovery scenario(pop up,object state,test run error,application crash). real time users of QTP, pls say and when and at what point u have used all these options ,in ur concerned project.pls give me explanation in accordance with ur real time project handled. real users pls send some time in the aboue case. if u can send the the reply through allinterview or at ref_it_ref@yahoo.co.in

1 Answers  


What are the common defects found in your project? (in qtp interview)

0 Answers   TCS,


how to disable the pop ups through QTP using a script

0 Answers  


You have an application version 1 with 5 combo boxes, Developers develop version 2. Here they replaced bottom 3 combo boxes with each other. While executing the Test script for version1 no errors. When we execute the Test script for version2 that QTP showing the error message "Object not identified" remember no property changed in version 2, ordinal identifier also disabled. Find what properties might change here in this scenario

6 Answers   ADP,


How can I test the unix shell in QTP

2 Answers   Persistent,


What is positive test case and Negative Test case? What is the meaning of Real World Scenario's?

2 Answers   TCS,


Categories