Reputation: 51
I'm fairly new to automation testing and thought I'd give appium a try. I'm trying to run a test script in ruby however I keep getting the same error
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>
When I enter the server address 127.0.0.1:4725/wd/hub on my browser I get
That URL did not map to a valid JSONWP resource
Here is my ruby code:
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
Any pointers on this will be really appreciated. Thanks!
Upvotes: 3
Views: 2231
Reputation: 104
Are you using the adress 127.0.0.1:4725
at the Appium Server preferences as well?
Standard is 0.0.0.0:4723
there, so that might be the issue.
Furthermore, you might change the path to server_url = "http://127.0.0.1:4725/wd/hub/"
Upvotes: 1