【发布时间】:2016-02-04 19:42:14
【问题描述】:
我在 Appium 网站上下载了示例代码。
我有 xcode 6.4 appium 1.4.13。
我运行simple_test.rb,代码是这样的。 iOS scimitar 启动,并将值放入文本字段。但是当单击第一个按钮时。 错误消息出来了,即使我睡了一段时间,消息仍然存在。
信息:[调试] [INST] 2015-11-04 09:54:53 +0000 调试:得到新命令 7 来自仪器:au.getElement('2').rect()
info: [debug] Socket data received (83 bytes) info: [debug] Socket 正在路由的数据。信息:[调试]从仪器获得结果: {"status":0,"value":{"origin":{"x":94,"y":122},"size":{"width":113,"height":37}}}
信息:[调试] [安装] 2015-11-04 09:54:53 +0000 调试:评估 au.getElement('2').rect() 2015-11-04 09:54:53 +0000 调试:评估完成 2015-11-04 09:54:53 +0000 调试:响应:2015-11-04 09:54:53 +0000 调试:运行系统命令#8: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{“状态”:0,“值”:{“原点”:{“x”:94,“y”:122},“尺寸”:{“宽度”:113,“高度”:37}} }... 信息:[调试] 以错误响应客户端: {"status":13,"value":{"message":"发生未知的服务器端错误 在处理命令时。 (原始错误:连接 ECONNREFUSED)","code":"ECONNREFUSED","errno":"ECONNREFUSED","syscall":"connect","origValue":"connect ECONNREFUSED"},"sessionId":"e7e398a0-e68d-4b71-8a74-1eef7fd6e948"} 信息:
......
启动驱动
Appium::Driver.new(desired_caps).start_driver
模块计算器 模块IOS # 将所有 Appium 库方法添加到 Test 中 # 称呼他们看起来更好。 Appium.promote_singleton_appium_methods 计算器
# Add two numbers
values = [rand(10), rand(10)]
expected_sum = values.reduce(&:+)
# Find every textfield.
elements = textfields
elements.each_with_index do |element, index|
element.type values[index]
end
# wait { text 'Computer Sum' }
sleep(30)
button(1).click
【问题讨论】:
-
你检查appium服务器是否正在运行?