SeasideSt / Parasol

Testing web apps in Smalltalk using Selenium WebDriver.
MIT License
31 stars 16 forks source link

Unexpected response status code 302 while creating web driver session. #14

Closed pdebruic closed 5 years ago

pdebruic commented 6 years ago

In both Pharo 5 & 6.1 on Mac os x 10.36.6 I followed the instructions in the Readme and keep hitting the error in the subject. I have a fix here in a sec but the Session Id code from the 301/302 redirect wasn't working.

The response that causes the error has no body but the headers are:

a ZnHeaders('Cache-Control'->'no-cache' 'Connection'->'close' 'Date'->'Thu, 12 Jul 2018 18:22:01 GMT' 'Expires'->'Thu, 01 Jan 1970 00:00:00 GMT' 'Location'->'http://127.0.0.1:4444/wd/hub/session/1531355270093' 'Server'->'Jetty/5.1.x (Mac OS X/10.13.6 x86_64 java/1.8.0_31' )

The chromedriver version is 2.40.565386

The selenium standalone driver is selenium-server-standalone-3.13.0.jar

pdebruic commented 6 years ago

see #15

Rinzwind commented 5 years ago

I took another look at this issue and noticed the Jetty version in the Server header in the response (Jetty/5.1.x) doesn't seem to correspond to recent versions of selenium-server-standalone and/or chromedriver. I did a quick check using an archive of combinations that I used in the past:

Selenium Chromedriver Server Header
3.8.1 2.35.528157 Server: Jetty(9.4.7.v20170914)
3.0.1 2.25.426935 Server: Jetty(9.2.15.v20160210)
2.53.1 2.23.409710 Server: Jetty/5.1.x (Mac OS X/10.13.6 x86_64 java/1.8.0_112

@pdebruic: could you double-check that you are not using an old version of selenium-server-standalone and/or chromedriver? If you still get the issue with recent versions, could you provide the additional logging output as requested in the pull request?

Rinzwind commented 5 years ago

As noted in my previous comment, this issue may have been (though unconfirmed) due to using an old version of selenium server and/or chromedriver. The code to handle status codes 302 and 303 was originally (re)added for compatibility with pre-v2.35.0 versions of selenium server (more details: https://github.com/SeasideSt/Parasol/pull/15#issuecomment-421916575). Newer versions shouldn’t be using these status codes in response to “POST /session” as far as I can tell (more details: https://github.com/SeasideSt/Parasol/pull/15#issuecomment-446312667). I have removed the compatibility code (https://github.com/SeasideSt/Parasol/commit/1f28126311308b00bc2797bb09a9cccd37e98cb6), and will close this issue and the associated pull request.