我在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服務器是否正在運行? –