appium / ruby_lib

:gem: Ruby library for Appium
http://rubygems.org/gems/appium_lib
216 stars 160 forks source link

Hard coded 'wd/hub' calls to Appium server make it impossible to use this library with Appium 2. #948

Closed wlreed closed 1 year ago

wlreed commented 1 year ago

This is a

Summary

Hard coded 'wd/hub' calls to Appium server make it impossible to use this library with Appium 2.

Environment

Actual behaviour and steps to reproduce

1) Start Appium server 2) Use appium_lib to connect to server 3) timeout: No route found for 'wd/hub/session'

Expected behaviour

Client connects to server and automation commences

Link to Appium/Ruby logs

Create a GIST which is a paste of your full Appium logs, and link them here. https://gist.github.com/wlreed/0a521e7a0cb896365436c7ad50016b5c

Any additional comments

Link to hard coded 'wd/hub' calls: https://github.com/appium/ruby_lib/search?q=wd%2Fhub

KazuCocoa commented 1 year ago

What about setting server_url like https://github.com/appium/ruby_lib_core/blob/f415b0981d00fd1e0c223f59f120f3477988d439/test/unit/appium_lib_core_test.rb#L92? The default URL has /wd/hub for backward compatibility yet. Appium 2 can have the url with --base-path=/wd/hub as well

wlreed commented 1 year ago

Yes, that will work! How can I find all the parameters for Appium 2? I have searched, but I have not found the documentation for this.

Dor-bl commented 1 year ago

https://github.com/appium/appium#server-command-line-interface

KazuCocoa commented 1 year ago

--base-path exists in appium v1 as well https://appium.io/docs/en/writing-running-appium/server-args/. So the argument itself does not change, but the default behavior changed a bit to follow fully W3C. Maybe the listening path is also in the appium log. appium server --help also shows the available parameters.

KazuCocoa commented 1 year ago

I've updated the readme https://github.com/appium/ruby_lib#start-appium-server as well. This may also help