I have multiple ok buttons in my application in the combinations: OK, ok, oK and Ok. How can i write a single @findby expression to identify all of them with the one webelement. Code example
<button type="button">OK</button>
I have multiple ok buttons in my application in the combinations: OK, ok, oK and Ok. How can i write a single @findby expression to identify all of them with the one webelement. Code example
<button type="button">OK</button>
Here is the other solution in pure xpath 1.0 using xpath functions.
//button[contains('OK,ok,Ok,oK',text())][string-length('OK')=2]
or
//button[contains('OK,ok,Ok,oK',text())][string-length(text())=string-length('OK')]
Edit: Simple approach using translate
//button[translate(text(),'ok','OK')='OK']
You can specify matching text with xpath:
//button[text()='OK']
In your case, to match them all:
//button[text()='OK' or text()='oK' or text()='ok' or text()='Ok']