Hi,
We are using calabash for our Automation and we are setting environment for application before application starts by using below code snippet from Before:
set_preferences("KEY_ENVIRONMENT", "AUTOMATION")
This works perfectly fine on Android 5.X but it's giving below error on Android 4.X
Could not set preferences (RuntimeError)
/Users/vidhithakrar/.rvm/gems/ruby-2.1.1@loganberry/gems/calabash-android-0.5.8/lib/calabash-android/operations.rb:755:in `set_preferences'
/Users/vidhithakrar/.rvm/gems/ruby-2.1.1@loganberry/gems/calabash-android-0.5.8/lib/calabash-android/operations.rb:177:in `set_preferences'
/Users/vidhithakrar/Workspace/automation/feature_steps/droid/support/app_life_cycle_hooks.rb:23:in `Before'
If I put some sleep before calling set_preferences() then it works fine on Android 4.X sometimes.