These are chat archives for appium/ruby_lib

Apr 2017
Hardik Desai
Apr 05 2017 05:57
hmm so not a system alert but a pop up
did you try without switching?
just wait for alert element to show and then accessing the element?
if that does not work show me a SS of the alert
Evangeline Ireland
Apr 05 2017 17:23
Can't not switch to alert as can't get to the element. I'm attaching a screenshot.
Hardik Desai
Apr 05 2017 18:51
you should be able to get to native_context and click on the ok button or the text for your validations
but my question was show me the code that is failing
Evangeline Ireland
Apr 05 2017 20:09

The main code has

alert = $test.switch_to_alert
puts "before accept alert #{alert}"
alert.accept if alert
puts "after accept alert #{alert}"

with switch_to_alert looks like:

def switch_to_alert(timeout = 300)
    sleep_time = 0.5
    start_time =
    alert = nil
    loop do
      puts "in loop before switch"
      alert = @driver.switch_to.alert rescue nil
      break unless alert.nil? && - start_time < timeout
    puts "in loop after switch"
I know it's not making it to the after accept console log.
Hardik Desai
Apr 05 2017 20:46
right, so i have been trying to tell you ignore having to switch_to_alert
Hardik Desai
Apr 05 2017 20:55
and wait for ok button to be displayed
and then click on it
Evangeline Ireland
Apr 05 2017 22:22
Solved it by changing Android emulator to a newer version so I can run Chrome instead of Browser.