Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selenium Alpha 4 returns 401 with GGR #301

Closed
jsa34 opened this issue Feb 6, 2020 · 8 comments
Closed

Selenium Alpha 4 returns 401 with GGR #301

jsa34 opened this issue Feb 6, 2020 · 8 comments

Comments

@jsa34
Copy link

jsa34 commented Feb 6, 2020

When updating selenium version in project to selenium v.4.0.0-alpha-4, all tests return back a 401 from GGR:
org.openqa.selenium.WebDriverException:
Unable to parse remote response: 401 Unauthorized

Caused by: org.openqa.selenium.json.JsonException:
Expected to read a START_MAP but instead have: NUMBER. Last 0 characters read:

Upon changing selenium version to 4.0.0-alpha-3, the 401 disappears and tests run successfully. I'm guessing its some change in the test ids/requests that are being sent with the latest alpha release?

@vania-pooh
Copy link
Member

@jsa34 401 could be returned only when incorrect username \ password is specified. This could be caused by incorrect processing of URLs with usernames \ passwords.

@jsa34
Copy link
Author

jsa34 commented Feb 6, 2020

This is what I assumed, but the only difference I made was updating the selenium libraries to alpha-4 and the requests are unsuccessful... The username and password in the URL request sent to GGR are identical and the only change was to update selenium version from alpha-3 to alpha-4, so I guess it's selenium's processing of the URL that has changed behaviour?

@vania-pooh
Copy link
Member

@jsa34 yes, could you check whether Authorization header is being sent with a new Selenium release?

@jsa34
Copy link
Author

jsa34 commented Feb 6, 2020

Aha - getting a bit further... They have changed their default HTTP client factory implementation to netty instead of okhttp. If I override the prop webdriver.http.factory=okhttp, all is fine. If I let fall back to default or specify netty, it fails... Something about netty!

@jsa34
Copy link
Author

jsa34 commented Feb 6, 2020

Unless I am missing it somewhere, the netty implementation doesn't appear to send the authorization header...

Okhttp sets it here: https://github.com/SeleniumHQ/selenium/blob/master/java/client/src/org/openqa/selenium/remote/http/okhttp/CreateOkClient.java (line 58)

But I can't see it set anywhere in netty:
https://github.com/SeleniumHQ/selenium/tree/master/java/client/src/org/openqa/selenium/remote/http/netty

@vania-pooh
Copy link
Member

@jsa34 just tested with Selenium Java 4.0.0-alpha-4 and it works.

@jsa34
Copy link
Author

jsa34 commented Feb 7, 2020

That's interesting - I can't see how with netty as I can't see the Authorization header set, and unless I explicitly set the prop webdriver.http.factory=okhttp it fails to authenticate... 🤔

@vania-pooh
Copy link
Member

This was fixed on Selenium side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants