Different behavior with HTTP redirects between Java and Ruby remote web drivers

32 views
Skip to first unread message

Jean-Luc Derrien

unread,
Sep 8, 2015, 8:45:51 PM9/8/15
to Selenium Developers
Hello everyone,

As a Selenium user, I've run into an issue that is now solved (see https://github.com/appium/appium/issues/5566 for more infos)

What I've learned so far:
  • For Android and iOS nodes, when creating a session, a HTTP 303 redirect is triggered (which differ from other implementations).
  • By default, the host of the Location header value is set to an IP address, basically not the right one in my case. If the -host option is provided, it's set to this value. So don't use an IP address in the -host parameter when a NAT is involved in your setup (because of Docker in my case).
  • During my tests, I've used the Java and Ruby web drivers and seen some differences between the two (more below).
In fact, the third point was a bit confusing when debugging. The Java and Ruby remote web drivers don't handle the redirections in the same way: the Java web driver follows the right redirection, while the Ruby web driver only uses the path and simply drops the protocol/hostname/port of the Location header (see https://github.com/SeleniumHQ/selenium/blob/master/rb/lib/selenium/webdriver/remote/http/default.rb#L95).

In my case, it was working with the Ruby web driver but not with the Java one. But the behavior of the Java web driver appears more obvious to me.

It takes me some time to figure out the whole thing, then I've been able to find the right configuration quickly (use the right value for the -host option on the hub side) and solve my issue.

Perhaps my whole feedback will give you some ideas to improve some points in the future.

Anyway, for now, I don't know if what I've seen about the Ruby driver can be considered as a bug or just a different behavior from the Java driver. I can understand that keeping exactly the same behaviors between the different implementations is too much work. So let me know if I should fil an issue or not.

Thanks for your hard work.

David

unread,
Sep 9, 2015, 6:33:58 PM9/9/15
to Selenium Developers
Curious to wonder if there is similar difference here with the other language remote web driver bindings (Python, .NET/C#, node.js).
Reply all
Reply to author
Forward
0 new messages