Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to select multiple and/or all check boxes?
#1
Solved: 11 Years, 4 Months, 4 Weeks ago
Hi,

I have a scenario, to select multiple check boxes in one case and all check boxes for another case.

If any one can help me to make it work the above conditions.
screenshot is attached......
Thanks
Reply
#2
Solved: 11 Years, 4 Months, 4 Weeks ago
Use this code to select all check boxes in a page.
Code:
Set myObj=Description.Create
myObj("micclass").value="WebCheckBox"
Set allObjs=Browser("...").Page("....").ChildObjects(myObj)
For i=0 to allObjs.count
    allObjs(i).Set "ON"
Next
You can customize the above code to select all or few checkboxes as you need.
Reply
#3
Solved: 11 Years, 4 Months, 4 Weeks ago
Thanks for the reply. I used similar to above code for selecting all check boxes. I need to know how to select multiple check boxes now.
All the properties are same for all of the check boxes, except value.
value is given like this xxx-123|1|, xxx-124|2|..etc

eg: check box -0 is for checking all
check box-1
check box-2
check box-3
check box-4
How to select check box-1,2 or only one check box-3

If any one can help me, know how to make it work all in the above conditions in one place..

Thanks
Reply
#4
Solved: 11 Years, 4 Months, 4 Weeks ago
Assuming you have four check boxes...if you were to select check box#3 and checkbox#4 you will use .
Code:
Set myObj=Description.Create
myObj("micclass").value="WebCheckBox"
Set allObjs=Browser("...").Page("....").ChildObjects(myObj)
allObjs(2).Set "ON"
allObjs(3).Set "ON"
This approach doesn't take into consideration, the check box properties. It gets all checkbox items and selects all if used in for loop. To select a particular check box, pass its index where the first occurence of a check box is given index '0'.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  UFT 11.52 - How to select multiple rows in webtable UFT_Tester 0 6,269 09-12-2013, 09:36 PM
Last Post: UFT_Tester
  Dialog Boxes mv8167 5 4,964 07-11-2011, 08:48 PM
Last Post: mv8167
Smile to select a single check box at runtime. karthikhw 1 2,963 03-25-2010, 02:00 PM
Last Post: manishbhalshankar
  How to select multiple items from a combobox/listbox prasadworld321 4 13,194 08-26-2009, 02:07 PM
Last Post: prasadworld321
  How to select the check box from the table (only scripts, no recording) Maheswaran 2 3,458 07-28-2009, 05:36 PM
Last Post: QTPian

Forum Jump:


Users browsing this thread: 1 Guest(s)