SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.67k stars 8.19k forks source link

Please offer a solution for basic authentication #6644

Closed AndreasKarz closed 3 years ago

AndreasKarz commented 5 years ago

Meta -

OS:

Selenium Version:

Browser:

Browser Version:

Expected Behavior -

Please finally make it possible that it is possible to send a header with the method GoToUrl(). This is the only really working possibility for Basic Authentication. Because tools like AutoIt don't work on BrowserStack etc.

Actual Behavior -

There is no way to send a header. And the complete problem is open since 2016!!! https://github.com/SeleniumHQ/selenium-google-code-issue-archive/issues/34 We are thinking about to change to Ranorex -- with this issues we can't work professional.

Steps to reproduce -

jimevans commented 5 years ago

You mean using something like a solution using a proxy? You haven’t said, but guessing that you’re using C#, there are example repositories that demonstrate using a proxy to accomplish lots of tasks that may nor be possible with Selenium.

AndreasKarz commented 5 years ago

Jim, sorry -- I have not read all the content of you solution, sorry. I think, this is it, what I looking for. I will test tomorrow and then I give you a feedback.

LG

Andreas

shs96c commented 5 years ago

To do this in a cross-browser way that provides a pleasant user API is distinctly non-trivial, but we're working on it, as https://github.com/w3c/webdriver/issues/385 shows.

It turns out that not every browser has a mechanism for simply "implementing a header function so that the tool can be used professionally". Personally, I'm tempted to blame those amateurs who've poured years of effort into the blasted things.

More seriously, @AndreasKarz, we know this is something that people really want, and it's something that we really want too. If you'd like to help us push it over the line, contributing to the W3C webdriver spec would be an excellent first step: it's on GitHub and run in the open specifically to enable this kind of collaboration.

unverified-contact commented 4 years ago

Are there any hacks or workarounds to be able to do this kind of thing in the meanwhile? Maybe there's a (semi) neat way to achieve this effect with a plugin or something similar?

walter-hernandez commented 4 years ago

@shs96c @AndreasKarz in the w3c/webdriver#385, in the last comment, they are welcoming the writing of the prose and merged of the change. @AndreasKarz it would be a great contribution to a highly demanded spec in the W3C webdriver and hence, selenium

ghost commented 4 years ago

Following

ArmandoAssuncao commented 3 years ago

While is not is done, i created this code that work:

https://gist.github.com/ArmandoAssuncao/51edbbdc8dc2e8e6ac8c16c2847ed960

diemol commented 3 years ago

While not a cross browser solution yet, as we are still heading in that direction with WebDriver BiDi, for now this can be done on Chromium based browsers, see the example at https://www.selenium.dev/documentation/webdriver/bidi_apis/#register-basic-auth

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.