17-10-22 03:09 PM
Hi!
Is there a good way to check if a chec-box can be edited? We se in the html code that there is set a disble="disabled" value in some cases, where the check-box should be greyed out.
We need to be able to catch that the check-box is greyed out and then do a different action than normal.
Any good advise out there on how to eiter check the html code a uniqe text string or see if the check box is greyed out (with that html code flag on the text box?
Hope this is understandable. Not the easiest question to explain, but we see the text we can check for in the HTML code, but it is not in an page item with a normal reference, so not sure how to catch this situation.
Thanks in advance for any good tip on how to check for this before making a desission action.
Kind regards
Roger Hoel
18-10-22 12:04 AM
//input[@disabled='disabled']
Or//input[@disabled]
Both of the above XPaths can work depending on the type of HTML coding behind the scenes. Below is an example to show you the same:
HTML Source Code:
Test Results:
Here, I have used the first attribute to identify the disabled checkbox whereas the second screenshot refers to the expression that I am using to identify the enabled checkbox by using the expression:
//input[not(@disabled)]
Hope this helps you to identify selectors in your case as well.