0

I am experiencing some random errors when running my Calabash tests and trying to touch elements

uia action failed because: Timed out running command uia.tapOffset('{:x 187.5, :y 131.5}')

I am running the tests on Yosemite, Xcode 6.2 and on iOS Simulator (iPhone 6 iOS 8.1)

The version of Calabash used is 0.13.0.

Does anyone know why it is happening and how to fix it?

Update

When I say "randomly" I mean that sometimes the sames test passes and sometimes it fails with this error. I just checked and it always seems to be failing when trying to tap on a tab button after entering some text in a text field. So my guess is that the keyboard is still there when it's trying to touch the tab button

For your information, this is the method I created for entering text

def type_text(accessibilityLabel, text)
  query = "textField accessibilityLabel:'#{accessibilityLabel}'"
  return unless safe_query(query).first["text"] != text

  wait_for_ui_animation_to_end

  safe_touch(query)
  map(query, :setText, '')
  map(query, :setText, text)
  done  
end

And these are the safe_touch and safe_query methods I use

def safe_query(query)
  wait_for(:timeout => 60, :timeout_message => "Timeout trying to query #{query}", :screenshot_on_error => true) do 
    element_exists(query) 
  end

  query(query)
end

def safe_touch(query)
  wait_for(:timeout => 60, :timeout_message => "Timeout trying to touch #{query}", :screenshot_on_error => true) do 
    element_exists(query)
  end

  touch(query)
end

Update 2

Here's an example of scenario that fails sometimes

enter image description here

Here's a screenshot of the screen when the test fails

enter image description here

There doesn't seem to be anything in the way when trying to tap the tabbar item...

Titouan de Bailleul
  • 12,920
  • 11
  • 66
  • 121
  • Some questions: when you say random you mean that it happens only sometimes, or that it happens in different steps of the suite? Does the app you're testing have any animations? Is the error message always the same? Always the same `x` and `y`? – mokagio Mar 23 '15 at 01:36
  • Also, have you tried running the test suite on the device? – mokagio Mar 23 '15 at 01:48
  • Updated the question. Never tried to run it on real device. I'll give it a try and let you know. – Titouan de Bailleul Mar 23 '15 at 15:42
  • Bump. I don't seem to run across this issue on real device, but I unfortunately have the possibility to run test on real device every time. – Titouan de Bailleul Apr 22 '15 at 09:00

0 Answers0