Highlighted
Valued Contributor.
Valued Contributor.
243 views

Help with Select checkbox from data table value

Jump to solution

in UFT , I have a data table with column ( "CheckboxOn) with a Value of 1.

I would like to have that value '1" used to place a check in the checkbox field in my test. 

in the properties of checkbox, when the box is selected, the properties "checked" has a Value of 1 and when unselected a value of 0.

I have :

Browser("A").Page("B").WebList("select_3").WebCheckBox("Checkbox""checked").Set datatable.Value("Checkbox")

Can anyone assist with this scripting issue??

0 Likes
1 Solution

Accepted Solutions
Highlighted
Trusted Contributor.
Trusted Contributor.

Re: Help with Select checkbox from data table value

Jump to solution

Hi,

Try this.

sBox=datatable.Value("Checkbox")
If Browser("A").Page("B").WebList("select_3").WebCheckBox("html tag:=INPUT","name:=" &sBox).GetROProperty("checked")=0 Then 
Browser("A").Page("B").WebList("select_3").WebCheckBox("html tag:=INPUT","name:=" &sBox).Click
End If

Note: If still facing difficulties please reach me then I will fix it.

Thanks

Balaji

balajiqa11@gmail.com

 

View solution in original post

0 Likes
2 Replies
Highlighted
Trusted Contributor.
Trusted Contributor.

Re: Help with Select checkbox from data table value

Jump to solution

Hi,

Try this.

sBox=datatable.Value("Checkbox")
If Browser("A").Page("B").WebList("select_3").WebCheckBox("html tag:=INPUT","name:=" &sBox).GetROProperty("checked")=0 Then 
Browser("A").Page("B").WebList("select_3").WebCheckBox("html tag:=INPUT","name:=" &sBox).Click
End If

Note: If still facing difficulties please reach me then I will fix it.

Thanks

Balaji

balajiqa11@gmail.com

 

View solution in original post

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

Re: Help with Select checkbox from data table value

Jump to solution

Something like this should work:

If DataTable("Checkbox") = 1 Then
    Browser("A").Page("B").WebList("select_3").WebCheckBox("Checkbox", "checked").Set "ON"
Else
    Browser("A").Page("B").WebList("select_3").WebCheckBox("Checkbox", "checked").Set "OFF"
End If

Mark Smith.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.