Calabash - cannot test touch events
I am using Calabash to automate some UI tests, but I am having some problems.
I have the next step: Then I touch the "login" button
.
When I run the cucumber
console throws this error:
Could not parse response ''; the app has probably crashed (RuntimeError)
Environment:
- Calabash 0.11.0
- Xcode 6.3.2
- iPhone 5 (8.3 Simulator)
Steps to reproduce:
- Create an app for iPhone 5 8.3 simulator
- Run: DEBUG = 1 calabash-ios console
- Run: start_test_server_in_background
- Execution: click ("the button is marked:" Login ")
Console:
RuntimeError: Could not parse response ''; the app has probably crashed
from /Users/felipepenariveros/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.14.2/lib/calabash-cucumber/uia.rb:33:in rescue in uia'
from /Users/felipepenariveros/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.14.2/lib/calabash-cucumber/uia.rb:30:in uia'
from /Users/felipepenariveros/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.14.2/lib/calabash-cucumber/uia.rb:454:in uia_handle_command'
from /Users/felipepenariveros/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.14.2/lib/calabash-cucumber/uia.rb:201:in uia_tap_offset'
from /Users/felipepenariveros/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.14.2/lib/calabash-cucumber/actions/instruments_actions.rb:93:in query_action'
from /Users/felipepenariveros/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.14.2/lib/calabash-cucumber/actions/instruments_actions.rb:15:in touch'
from /Users/felipepenariveros/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.14.2/lib/calabash-cucumber/core.rb:1166:in query_action_with_options'
from /Users/felipepenariveros/.rvm/gems/ruby-2.0.0-p353/gems/calabash-cucumber-0.14.2/lib/calabash-cucumber/core.rb:177:in touch'
from (irb):2
from /Users/felipepenariveros/.rvm/rubies/ruby-2.0.0-p353/bin/irb:12:in <main>'
It might be related to this issue already closed on Github: https://github.com/calabash/calabash-ios/issues/600
Does anyone know how I can solve this?
source to share
I had a similar problem in my project (Xcode 7.0.1, iOS 9.0.2 on a physical device (iPod touch), Calabash 0.14.3).
What worked for me was change :uia_strategy
from :shared_strategy
to :host
. So now my script block in function / support / 01_launch.rb looks like this:
Before do |scenario|
options = {
:uia_strategy => :host #used to be shared_strategy - but that failed
}
@calabash_launcher = Calabash::Cucumber::Launcher.new
unless @calabash_launcher.calabash_no_launch?
@calabash_launcher.relaunch(options)
@calabash_launcher.calabash_notify(self)
end
end
Hope this helps someone else along the line that is puzzling over a similar issue.
source to share