Hello, I have problem with validating that element is not present on the page. This seems to me like a basic thing, but I am not able to verify it.
Example: I want to test filtering on our web and I want to verify that exact record is not present.
I tried to use “Get Element States id=record1 contains hidden” but it fails as it doesnt finds it at all
([ FAIL ] Elements states ‘[‘detached’]’ (list) should contain ‘[‘visible’]’ (list))
I also tried to use “Run Keyword And Expect Error” but it always pause my execution and wants me to press Enter to continue.
Thanks a lot I am new in this and I was pretty sceptical about writing on forum, but theese fast and helpful asnswers really brightened my day. Love you guys :)))
Not sure if there’s a better way but you can do this:
Get Element combined with an xpath like //*[contains(text(), "text your searching for")] should give you the element that contains that text if it exists and an error if not
Combine that step above with Run Keyword And Expect Error and you should get a pass if the text is not there and an error if it is.