Wait Until Element Is Not Visible

773 views
Skip to first unread message

Kevin O.

unread,
Oct 3, 2014, 12:58:05 PM10/3/14
to robotframe...@googlegroups.com
I am looking for feedback on how to best implement Wait Until Element Is Not Visible.

1 - fail immediately if the element is not present, otherwise continue waiting until the element is logically not visible
2 - wait until the element is present and also logically not visible

Wait Until Element Is Visible waits for an element to be present and also logically visible - this was to avoid needing to always precede with Wait Until Page Contains Element. But that keyword is likely to be used in a different context than the new one.

I don't remember needing such a keyword and wanted to hear from others. Thank you in advance for your opinions.

Thanks,
Kevin Ormbrek

Tatu Aalto

unread,
Oct 3, 2014, 1:59:10 PM10/3/14
to korm...@gmail.com, robotframework-users

Ugh

Because of the nature of web pages, I would go for option two. Although the option is also good and I can think use case for that too. It depends on the requirements that one has.

-Tatu
Send from my mobile

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

mr

unread,
Feb 23, 2015, 9:39:39 AM2/23/15
to robotframe...@googlegroups.com
I think the option 1 is the correct and required one.

But you could make it also configurable by an additional parameter.

Kevin O.

unread,
Feb 26, 2015, 12:51:51 PM2/26/15
to robotframe...@googlegroups.com, Ed Manlove
Thanks for your feedback.
It was implemented as option 2, allowing the element to not be present or disappear and come back without failing so long as it is present and not visible by the timeout.
It hasn't been released yet so it could be changed.
I was originally going to merge or implement this but have been busy.
Ed, did you see this thread or consider option 1?

Ed Manlove

unread,
Feb 26, 2015, 9:51:48 PM2/26/15
to Kevin O., robotframe...@googlegroups.com
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 
Reply all
Reply to author
Forward
0 new messages