3

我正在使用 Calabash 来自动化一些 UI 测试,但我遇到了一些问题。

我有一个步骤如下Then I touch the "login" button

当我运行cucumber时,控制台会抛出此错误:

Could not parse response ''; the app has probably crashed (RuntimeError)

环境:

  • 葫芦 0.11.0
  • Xcode 6.3.2
  • iPhone 5(8.3 模拟器)

重现步骤:

  • 将应用程序构建到 iPhone 5 8.3 模拟器
  • 执行:DEBUG=1 calabash-ios 控制台
  • 执行:start_test_server_in_background
  • 执行:touch("按钮标记:'登录'")

控制台跟踪:

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>'

它可能与 Github 中已经关闭的这个问题有关:https ://github.com/calabash/calabash-ios/issues/600

有谁知道我该如何解决这个问题?

4

2 回答 2

0

我解决了这个问题。

在模拟器中,我选择了重置内容和设置...并且它起作用了。

谢谢你的帮助!(@jmoody 和@Lasse)。

于 2015-05-25T02:26:02.023 回答
0

我在我的项目中遇到了类似的问题(Xcode 7.0.1,物理设备上的 iOS 9.0.2(iPod touch),Calabash 0.14.3)。

对我有用的是将:uia_strategyfrom更改:shared_strategy:host. 所以现在我在 features/support/01_launch.rb 中的前场景块看起来像这样:

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

希望这可以帮助那些正在为类似问题绞尽脑汁的其他人。

于 2015-10-16T15:36:08.337 回答