FAQ
Really appreciate help on this:
element2 shows up on the page after you click on element1. I'm using the
code below.
element2 appears almost right away but it always goes to ensure block and
execute "$driver.quit" instead of clicking on element2.
Don't know what is the problem. Any other good ways to wait for new element
on the web page and handle it correctly?
Thanks a lot!

$driver.find_element(:id, "element1").click

wait = Selenium::WebDriver::Wait.new(:timeout => 10) # seconds

begin

wait.until { $driver.find_element(:id, "element2") }

ensure

#Logger login error to text error log file

$driver.quit

end

$driver.find_element(:id, "elem2").click

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/e0kB_TZ6_bMJ.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupselenium-users @
categoriesselenium
postedApr 11, '13 at 3:53p
activeApr 11, '13 at 3:53p
posts1
users1
websiteseleniumhq.org

1 user in discussion

Nikolay: 1 post

People

Translate

site design / logo © 2022 Grokbase