I hadn't seen this thread but my first
reaction was also option 1. When I hear "Wait Until Element is Not
Visible" I think I have an element that exists but is visible on
the page and possible visible but not within the page's visible
portion (i.e. one would need to scroll to see the element and the
portion of the page it is is currently visible on) and I am
waiting for it to become hidden. Now if on the initial check the
element is present and hidden I would expect the keyword to return
as successful. But on the initial check if the element is not
found or not present I would expect this keyword to fail with
element is not found. That was my first reaction reading this.
Then I went to look at the list of current "Wait Until..."
keywords and I see we have "Wait Until Page Contains Element"
keyword. Going off the name of this keyword if there was a "Wait
Until Page Does Not Contain Element" keyword I would expect this
to check whether the element present or not, not caring if present
and visible or hidden on the page. It is still present. While
checking I also found selenium issue #6812 from which I could see
a different keyword "Wait Until Element is Not Displayed". Here
too I expect the element to be present on the page but this
keyword would return successful if it becomes hidden or if it is
scrolled out of the current page viewing area or if on intial
check it is not within the current viewing area.
I guess one could ask what happens if the element is present and
visible but within the timeout period is removed from the page
thus no longer visible but no longer present? Following the same
logic as above, which i think is the correct answer for what you
are asking, I would expect in this case an error stating that the
element is no longer present. It might also be helpful to add a
hint somewhere saying if this was expected behavior then one
should be using the (still be be added) keyword "Wait Until Page
Does Not Contain Element" instead.
I hope this is clear. If you have any questions or any other
scenarios that might occur during this check and what to see what
I think just ask.
Ed
[1]
http://code.google.com/p/selenium/issues/detail?id=6812