Webcheckbox seen as a WebElement w/no property differences between checked and unchecked

  • Questions
  • Webcheckbox seen as a WebElement w/no property differences between checked and unchecked
Question ID: 107442
0
0

I’m using UFT 12.54 on Angular JS2 objects, trying to determine whether or not various checkboxes are set and then set them accordingly, if necessary. When I recorded the script, these objects were seen as Webcheckboxes within WebElements. But when I added the objects to the OR via Object Spy only the WebElement objects were distinguished.

There are no Identification or Native property differences in the WebElement object when it is checked vs. when it is unchecked, so I want to use the WebCheckbox object. However, when I try to run the script using the WebCheckBox, UFT only sees the object’s value as it was when it was recorded (i.e. I uncheck the box, save the changes and run the script but UFT still sees the checkbox as "ON"/selected/checked – like it was when I recorded the steps).

How can I get UFT to recognize the WebCheckBox objects and to read their actual runtime values (not the values during recording)?

Marked as spam
Posted by (Questions: 10, Answers: 5)
Asked on February 2, 2017 3:39 pm
19 views
Answers (1)
0
Private answer

@Juuch You can try using disabled property of webelement like below :
-------
If checkbox is disabled below will return True:
Browser(Win).Page(Page).Frame(Frame).WebElement(''xpath:=//span[@class='input-group-checkbox']/input[@name='label.checkbox1' and not(@disabled='true')]'').Exist(0)
-------
If checkbox is enabled below will return True:
Browser(Win).Page(Page).Frame(Frame).WebElement(''xpath:=//span[@class='input-group-checkbox']/input[@name='label.checkbox1' and (@disabled='true')]'').Exist(0)

Marked as spam
Posted by (Questions: 0, Answers: 1)
Answered on July 5, 2018 2:03 pm