Reputation: 306
I have a problem waiting for an iframe to exist on page after entering a date range and I would rather not use sleep. I am using ruby/watir
I have tried solutions like this -
wait_until(10, "iFrame has not loaded") do
@browser.iframe(id: "dtl00_DP1_content").exists?
end
but this simply returns this error - Selenium::WebDriver::Error::NoSuchWindowError: no such window
So how do I wait for an iframe that does not yet exist please?
Upvotes: 0
Views: 337
Reputation: 6064
I am not sure whether you only want to wait for an Iframe, If you want to perform any operation on an element which is present in the iframe, then you could do as I mentioned in my comment.
@browser.iframe(name: "something").text_field(name: "username").set 'raja'
Or If you still wait for an iframe
to appear, then write the following code
@browser.wait_until { @browser.iframe(id: "dtl00_DP1_content").exists? }
The above code waits for 30 seconds, but If you want to increase the time to wait, then write the following code, the following code would wait fo 50 seconds.
@browser.wait_until(timeout: 50) { @browser.iframe(id: "dtl00_DP1_content").exists? }
Upvotes: 3