Wait fancybox close

73 views
Skip to first unread message

Rafael s

unread,
Feb 25, 2015, 4:43:20 PM2/25/15
to webd...@googlegroups.com
Hello,

Currently I have a problem with the following situation:

Have a screen of registration to register person and when the person is added I can edit this information by clicking the "edit" option.

When I click on "edit", opens a modal and when I saved the information, I need to wait this modal close to interact with the elements under the modal

How can I expect a modal close (wait she doesn't stay visible)?

Cheers,
Rafael

darrell

unread,
Feb 26, 2015, 8:58:45 AM2/26/15
to webd...@googlegroups.com
Rather than waiting for the modal to close, wait for the element under the modal to be available. For example, after the modal is closed I want to edit a text field. I could then use WebDriverWait and the until() method to wait for certain Expectations. Maybe I need to wait for the element to exist then wait for it to be visible or maybe I have to wait for it to be clickable. I'd have to experiment a little to figure out what I need to wait for.

Rafael s

unread,
Feb 26, 2015, 2:54:14 PM2/26/15
to webd...@googlegroups.com
You have a example this? My script is in ruby

PeterJeffreyGale .

unread,
Mar 6, 2015, 2:39:44 PM3/6/15
to webd...@googlegroups.com

I don't do ruby but if you understand the principle you should be able to write it for yourself.

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

PeterJeffreyGale .

unread,
Mar 6, 2015, 2:39:53 PM3/6/15
to webd...@googlegroups.com

Don't wait for the modal box to disappear ... Wait for any underlying element to become visible.

Catch any errors and discard them if they say that the modal box is still present.

--

Kiran M

unread,
Mar 6, 2015, 2:41:55 PM3/6/15
to webd...@googlegroups.com
 As Darrel said, An explicit wait for the modal to close is the best option in this case.

If you are using selenium-webdriver ruby bindings, you can invoke 'displayed?' method on modal like below.

wait = Selenium::WebDriver::Wait.new(:timeout => 20) # seconds
begin
  element = wait.until { driver.find_element(:id => "some-dynamic-element").displayed? } # modal element
ensure
  driver.quit
end
Reply all
Reply to author
Forward
0 new messages