Created
September 16, 2014 22:00
-
-
Save jimmyeisenhauer/a61f52ef2836c8309e2c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_button | |
@driver.find_element(:link, 'Create') | |
end | |
def create_button_click | |
@wait = Selenium::WebDriver::Wait.new(timeout: 8) | |
puts 'DEBUG: Clicking Create Button' | |
create_button.click | |
puts 'DEBUG: Waiting for View This Challenge' | |
@wait.until { @driver.find_element(:link, 'view this challenge') } | |
puts 'DEBUG: Found view challenge link' | |
rescue | |
puts 'DEBUG: Rescue: Clicking Create Button' | |
create_button.click | |
@wait.until { @driver.find_element(:link, 'view this challenge') } | |
puts 'DEBUG: Found view challenge link' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah there is something weird going on with my waits. I had the same problem with wait not set as a instance var as well. I moved to a instance var to aid in some trouble shooting.
The implicit wait i moved to 30 seconds and I still see the explicit one at 60 seconds, which is prob http like you stated.
@driver.manage.timeouts.implicit_wait = 30
I added
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 120 # seconds
as a work around it just takes a while :-)
The rescue is there to attempt the click again if the first one fails.