我是自动化测试的新手,我想我会尝试一下appium。我试图在ruby中运行一个测试脚本,但是我仍然得到了相同的错误
Users/matt/.rvm/gems/ruby-2.1.2/gems/appium_lib-3.0.3/lib/appium_lib/driver.rb:437:in rescue in start_driver': ERROR: Unable to connect to Appium. Is the server running?(RuntimeError)from Users/matt/.rvm/gems/ruby2.1.2/gems/appium_lib-.0.3/lib/appium_lib/driver.rb:424:in `start_driver'from Appiumtest.rb:11:in<main>
当我在浏览器上输入服务器地址127.0.0.1:4725/wd/集线器时,我得到
That URL did not map to a valid JSONWP resource
这是我的红宝石代码:
require 'rubygems'
require 'appium_lib'
capabilities = {
'appium-version' =>'1.0',
'platformName'=> 'iOS',
'platformVersion'=> '7.1',
}
server_url = "http://127.0.0.1:4725/wd/hub"
Appium::Driver.new(caps: capabilities).start_driver
Appium.promote_appium_methods Object
find_element(:xpath, "//UIAApplication[1]/UIAWindow[2]/UIATableView[1]/UIATableCell[4]").click
driver_quit
任何关于这方面的建议都将受到赞赏。谢谢!
发布于 2014-06-25 13:37:01
您是否也在使用Appium首选项中的adress 127.0.0.1:4725
?标准是0.0.0.0:4723
,所以这可能是问题所在。
此外,您可能更改到server_url = "http://127.0.0.1:4725/wd/hub/"
的路径。
https://stackoverflow.com/questions/24150802
复制相似问题