我在Appium网站上下载了示例代码。Appium处理命令时出现未知的服务器端错误
我有xcode 6.4 appium 1.4.13。
我运行simple_test.rb,这样的代码。 iOS短刀开始,并将值放入文本字段中。但是当点击第一个按钮时。 错误信息出来了,即使我睡了一段时间,信息仍然存在。
info: [debug] [INST] 2015-11-04 09:54:53 +0000 Debug: Got new command 7 from instruments: au.getElement('2').rect()
info: [debug] Socket data received (83 bytes) info: [debug] Socket data being routed. info: [debug] Got result from instruments: {"status":0,"value":{"origin":{"x":94,"y":122},"size":{"width":113,"height":37}}}
info: [debug] [INST] 2015-11-04 09:54:53 +0000 Debug: evaluating au.getElement('2').rect() 2015-11-04 09:54:53 +0000 Debug: evaluation finished 2015-11-04 09:54:53 +0000 Debug: responding with: 2015-11-04 09:54:53 +0000 Debug: Running system command #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,{"status":0,"value":{"origin":{"x":94,"y":122},"size":{"width":113,"height":37}}}... info: [debug] Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command. (Original error: connect ECONNREFUSED)","code":"ECONNREFUSED","errno":"ECONNREFUSED","syscall":"connect","origValue":"connect ECONNREFUSED"},"sessionId":"e7e398a0-e68d-4b71-8a74-1eef7fd6e948"} info: <-- POST /wd/hub/session/e7e398a0-e68d-4b71-8a74-1eef7fd6e948/element/2/click 500 138.558 ms - 293
......
启动驱动程序
Appium :: Driver.new(desired_caps).start_driver
模块计算器 模块IOS #添加所有Appium库方法测试,使 #调用它们看起来更好。 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服务器是否正在运行? –