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.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
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 watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to