I meant to say alert  window is closed when it reaches to this line

message ||= "waiting for true condition on #{inspect}"

but if I remove the inspect method from the above line then it leave the
window alert as it appears so that the next line successfully passes(wait
until) so that it reaches to the line @alert.accept and then it
successfully accepts the pop up program moves on further.



On Mar 21, 2017 11:28 PM, "Titus Fortner" <[email protected]> wrote:

What do you mean by: "it automatically closes the alert"
Which browser / version / driver version?

Watir is checking to make sure that the alert box is there before accepting
it. If it is timing out then it indicates that it never sees the alert (in
which case you wouldn't need to / be able to click on it).

Also, if you are using the latest version of Watir, you can place this
above the alert code: `Selenium::WebDriver.logger.level = :info` and then
reply with the output.



On Tue, Mar 21, 2017 at 12:47 PM, Raja gopalan <[email protected]>
wrote:

> I have written the following code to handle alert
>
> b.alert.ok
>
> Please look at the below code(bottom), I went through debug, when it
> reaches to
>  message ||= "waiting for true condition on #{inspect}"
>
> it automatically closes the alert so when it reaches to next line, that is
>
>  Wait.until(timeout: timeout, message: message, interval: interval, object: 
> self, &blk)
>
> It waits until the given time and it fails. So what I did was I took out
> the driver and written the following selenium code directly
>
> driver.switch_to.alert.accept
>
> It perfectly works. Can someone tell me where is the problem?
>
> def wait_until(deprecated_timeout = nil, deprecated_message = nil, timeout: 
> nil, message: nil, interval: nil, &blk)
>   if deprecated_message || deprecated_timeout
>     warn "Instead of passing arguments into #wait_until, use keywords"
>     timeout = deprecated_timeout
>     message = deprecated_message
>   end
>   message ||= "waiting for true condition on #{inspect}"
>   Wait.until(timeout: timeout, message: message, interval: interval, object: 
> self, &blk)
>
>   self
> end
>
> --
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> [email protected]
> http://groups.google.com/group/watir-general
> [email protected]
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Watir General" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search
before you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

---
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
For more options, visit https://groups.google.com/d/optout.

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to