Problem running consecutive cucumber scenarios in Sauce Labs (Android)

214 views
Skip to first unread message

Dani

unread,
Jun 3, 2014, 5:15:20 PM6/3/14
to appium-...@googlegroups.com
Hi,

I am having a feature cucumber file with 2 consecutive identical scenarios.

Running this locally works just fine. However on Sauce Labs I have problems with it:
  First scenario passes.
  Second one (identical with the first one) crashes always in the same place (when calling scroll_to method). Error is SystemStackError: stack level too deep. If I am not promoting the appium methods and I am using $driver.scroll_to - in the same manner it works fine first time, but second time it says "complex_find cannot be applied on Appium driver

I am performing a quit_driver at the end of a scenario and create and start_driver before scenario. I thought sauce labs would allocate different VM each time I quit_driver and create a new Appium driver so looks strange that same scenario behaves differently when run consecutively?!

Can anyone give me some idea on how to surpass this.

bootstrap online

unread,
Jun 3, 2014, 5:18:02 PM6/3/14
to Dani, appium-...@googlegroups.com
Those errors seem like logical issues in your test code.
> --
> http://appium.io
> ---
> You received this message because you are subscribed to the Google Groups
> "Appium-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to appium-discus...@googlegroups.com.
> Visit this group at http://groups.google.com/group/appium-discuss.
> For more options, visit https://groups.google.com/d/optout.

Dani

unread,
Jun 3, 2014, 5:46:04 PM6/3/14
to appium-...@googlegroups.com, ben...@googlemail.com
I doubt that since it works fine on my own appium server. also it is the same scenario (same code) that passes fine on first run but fails second time on sauce labs

bootstrap online

unread,
Jun 3, 2014, 5:50:39 PM6/3/14
to Dani, appium-...@googlegroups.com
If you post your code to github, I'll take a look.

Dani

unread,
Jun 3, 2014, 8:54:19 PM6/3/14
to appium-...@googlegroups.com, ben...@googlemail.com

bootstrap online

unread,
Jun 3, 2014, 9:34:32 PM6/3/14
to Dani, appium-...@googlegroups.com
I updated the doc. The code was out of date.
https://github.com/appium/ruby_lib/commit/a5814249c8123c0309599847c0d0a9145c9ef819

The lifecycle in env is wrong. See the sample env.rb
https://github.com/appium/appium/blob/master/sample-code/examples/ruby/cucumber_ios/features/support/env.rb

Promotion must happen exactly once and it shouldn't be on object.
Currently you're promoting once per scenario. Something like this
should work:
https://github.com/bootstraponline/SauceLabIssueWithAndroid/commit/ba435a8556324ade8a5beccf97f4c2f08dc0a80f

bootstrap online

unread,
Jun 3, 2014, 9:37:50 PM6/3/14
to Dani, appium-...@googlegroups.com
Also on Sauce, you should be using appium v1.1.0 and the latest
version of the appium_lib gem.

Dani

unread,
Jun 4, 2014, 11:03:02 AM6/4/14
to appium-...@googlegroups.com
Sauce Labs rejects the driver creation if I am sending appium-version = "1.1.0" capability. It only accepts "1.0" so I guess they don't support it yet?!

Dani

unread,
Jun 4, 2014, 11:05:57 AM6/4/14
to appium-...@googlegroups.com, ben...@googlemail.com
Thanks. Running the Appium driver creation and method promotions only once did the trick.

One comment though - you should update the Sauce Labs status at the end of each scenario otherwise it will update only the last scenario from the feature file:

After do |scenario|
  # Reset scenario unless the feature was tagged @keep
  ##### $driver.reset unless scenario.feature.source_tag_names.include? '@keep'
  $passed = ! scenario.failed?

  user   = ENV['SAUCE_USERNAME']
  key    = ENV['SAUCE_ACCESS_KEY']
  if user && !user.empty? && key && !key.empty?
    SauceWhisk::Jobs.change_status $driver.driver.session_id, $passed
  end
end

bootstrap online

unread,
Jun 4, 2014, 11:06:34 AM6/4/14
to Dani, appium-...@googlegroups.com

bootstrap online

unread,
Jun 4, 2014, 11:09:08 AM6/4/14
to Dani, appium-...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages