Micro Focus QTP (UFT) Forums

Full Version: Click checkbox using its label name.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi People I Need a Great help from you Guys and much Thankful and appreciated.

I have 10 checkboxes in a page and it has respective labels like

abc <Checkbox1>
cab <Checkbox2>
.
.
.
.

abc is a label name and checkbox 1 is a checkbox ... Now u guys got the picture.


I need to click checkbox1 by sending abc as parameter.

If the parameter exists in the page click the respective checkbox..

I have written the following code.Please give a look up and provide your solution.

Code:
Set objCheckbox = Description.Create
objCheckbox("micclass").value = "WebCheckBox"

Set objCheckboxcoll = Browser("abc").Page("abc").WebTable("BranchSelect").ChildObjects(objCheckbox)
Msgbox objCheckboxcoll.count

'Msgbox objWebElementcoll(0).GetROProperty("Innertext")

'For i = 1 To objCheckboxcoll.count
'    If Trim(objCheckboxcoll(i).GetROProperty("label")) = Trim("NORTH HAZARD") Then
'        objCheckboxcoll(i).set "ON"
'    End If    
'Next
Hi,
Can you provide screenshot of your application where CheckBoxes are displayed along with label name. My question is, are the CheckBoxes and Lable name are in same Column or different column. ?