Issue with UFT checking/unchecking WebCheckBox
Category:
Question ID: 110059
2
0

Using UFT with a DataTable column “CheckboxStatus” with a Value of 1 or 0 (1 indicates checkbox is to be checked, 0 to be unchecked).

I try to use the following code to check the checkbox, but it is not working:

Browser(“Capital Gains”).Page(“Issue Distribution”).WebList(“Issue Selection”).WebCheckBox(“Checkbox”).Set datatable.Value(“CheckboxStatus”)

Marked as spam
Posted by (Questions: 387, Answers: 66)
Asked on January 29, 2021 4:42 pm
148 views
Answers (1)
2
Private answer

Change the DataTable values from 1 to ON or 0 to OFF and try do to this instead and see if it works:

Browser("Capital Gains").Page("Issue Distribution").WebList("Issue Selection").WebCheckBox("Checkbox").Set datatable.Value("CheckboxStatus")

If that doesn't work, try:

If Browser("Capital Gains").Page("Issue Distribution").WebList("Issue Selection").WebCheckBox("Checkbox").GetROProperty("checked") = 0 Then
Browser("Capital Gains").Page("Issue Distribution").WebList("Issue Selection").WebCheckBox("Checkbox").Click
End If

You can find more details on how to use the WebCheckBox at this link.

Marked as spam
Posted by (Questions: 17, Answers: 807)
Answered on January 29, 2021 4:50 pm
0
Both of the methods you mentioned work. Thanks!
( at January 29, 2021 4:52 pm)
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top