XPath not() option - make sure html attribute is not available
With Xpath it is possible to use the not() function to check that a specific attribute of an element does not exist.
Currently it is only possible to use UserCode methods or besides that to use a @visible. However @visible does only work, if the search html element is currently visible on the screen. If a scroll would be necessary to see the element that would not work.
Creating a user code function for a feature which already exists in xpath would only be a workaround.
RxPath should be extended with features like not() to make it easier to handle element identification without user code.
Sadly that does not work. Because this would still need the attribute to exist.
In my case, a element either gets extended with an attribute (which does not exist otherwise).
I tried your solution but it does not work in my case.
The not() function from basic xpath looks like this: not(div[@aria-hidden])
This would ensure, that no div element with specified attribute exists.
Alexander Hoisl commented
RanoreXPath provides a "null()" function to check if an attribute is null, i.e. you can use something similar to:
/form[@title='My Form' and @text=null()]
Does that help? Frankly, I don't fully understand your use case, i.e. which attributes you want to check for existance.