1

We use calabash-android for our functional tests here and we are experiencing strange behaviors. We have some simple scenario like:

When I skip the tutorial
Then I must land on my 'fancy' screen

This scenario succeed most of the time, but sometimes (about 10-15% of the time) 2 failures are possible. The first one is because the element looked up by When I skip the tutorial is not found by calabash-android (it is simply a button with the id button_ok). When inspecting the screenshot taken we see the element, which is quite weird. I was suspecting the animation of the element, so I've had a post_timeout, like this:

tap_when_element_exists("* id:'button_ok'", :post_timeout => 2)

But nothing changed.

The second possible failure is when the step When I skip the tutorial is successfully passed but the next step where we check that we are on the correct page fails, because the page has not changed... On the screenshot taken by calabash we are indeed on the page of the tutorial, not on the next one as expected. How is it possible since the step where we change the page is successful?

Does anybody already faced this kind of random failures?

(Sorry for bad english, not my mother tongue :( )

Myx
  • 175
  • 1
  • 11
  • Can you post the calabash logs, it will help understanding the problem. BTW, calabash logs the step that failed. – danypata May 09 '16 at 09:34
  • Well unfortunately I don't have a lot of logs to show, when the step `When I skip the tutorial` failed it is because an element is not found and I get this error `Timeout waiting for elements: * id:'button_ok' (Calabash::Android::WaitHelpers::WaitError)` but on the screenshot the element is present and most of the time it is found. When the step `Then I must land on my 'fancy' screen` failed I got the same error (a timeout waiting for another element) but in this case it is logical since the element is not displayed because the page change didn't occur in `When I skip the tutorial`. – Myx May 09 '16 at 09:49

1 Answers1

1

I have faced similar random failure on certain devices. Problem is sometimes the element you are trying to touch rendered later than timeout of previous step. In my case, sometimes keyboard was taking too long to disappear blocking calabash to see elements behind that. A right approach to avoid such mistake would be to wait for element to appear.

wait_for_element_exists(uiquery)

use above before every such touch event and it might work.

Amit Gupta
  • 533
  • 6
  • 17
  • Thanks for your suggestion but we already use wait_for_element (with a 30sec timeout) and unfortunately the problem persists. :( – Myx May 16 '16 at 12:07