Can anybody help me by sharing the code for checkbox in qtp
using vbscript.
Answer Posted / 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 |
Post New Answer View All Answers
What is difference between Recording time object identification and Run time (Execution) time.
Differences between quicktest professional (qtp) and winrunner?
How can i click on any Excel sheet's "H" column with out writing coordinates Ex:Window("Book1").WinObject("Book1").Click 498,14 I dont want to give coordinates like 498,14 Can i open "H" column by writing like Ex:Window("Book1").WinObject("Book1").Click "H" or Ex:Window("Book1").WinObject("Book1").Click "H","1" or Ex:Window("Book1").WinObject("Book1").Click H,1 If i want to click on "Sheet3" of an excel sheet, Can i open like Ex:Window("Book1").WinObject("Book1").Click "Sheet3" Please help me any one
What is smart identification in QTP?
Where to use function or action?
can u explain the keyword driven framework with an example clearly how to create all the files and how to attach to main test.
after initiating one project for testing, when exacltly QTP tester role starts?
hi all here i have tab named "Workbench" By clicking on "workbench" tab.it displays 4 tabs like below workbench common cargo commercial charter "common" tab have 10tabs inside,"cargo" tab also haveing 15 tabs inside and remaining two tabs also having few tabs inside. when clicked on "common" tab.it displaying the script like tab("workbench").select"common" if i clicked on "cargo".it displaying the script like tab"workbench_2").select"cargo" if i clicked on "commercial".it displaying the script like tab"workbench_3").select"commercial" if i clicked on "charter".it displaying the script like tab"workbench_4").select"charter" I have used a "FOR LOOP" for common,commercial,cargo,charter tabs.it was stopped at second tab SO, CAN I RECOGNIZE "WORKBENCH_2,_3,_4" AS A SINGLE VARIABLE if not, can anyone plese help me to solve this
Can we record using all the modes in a single script? Explanation with example is appreciated
How to handle dynamic objects in quicktest professional (qtp)?
How many add-ins comes by default with quicktest professional?
Write a script to customize the test results in PDF and HTML format.
How to execute a winrunner script in quicktest professional?
what the difference between shared repository and per action repository?
How to change the priorities of the recovery scenario properties?