Safari 13 basic authorization in webdriver

有些话、适合烂在心里 提交于 2019-12-11 15:49:44

问题


I am looking for a way to fill basic authorization popup in Safari 13 in automated session. I want to log in to website which require such login. Solution can be even manual. Is there any way to do that?

List of solution which I tried:

  1. Fill form manually. Issue: Safari 13 blocks any interaction with automated browser. As far as I know there is no way to do it and then continue with automated session.
  2. Use selenium to fill the form. Issue: Safari does not support such feature.
  3. Use http://login:password@site.com. Issue: Safari 13 does not support such feature.
  4. Add authorization header using proxy. Issue: Some sites does not work the same with proxy. I tried browsermob-proxy and mitmproxy but site did not works the same as without proxy.
  5. Add authorization header using proxy and then refresh page without proxy. Issue: Header is not saved in browser. Authorization is required after refresh.
  6. Use ApplyScript or other to fill the form. Issue: Safari 13 blocks any interaction with automated browser.
  7. Safari extension with authorization header. Issue: as far as I know safari extension does not support any headers modification.
  8. Use Keychain access. Issue: It can not be used in automated session.

回答1:


Based on a few GitHub issues, I'm not sure if this is possible to achieve given all of the workarounds you have already tried.

This issue is detailing the Safari basic auth issue, closed as out-of-scope for Selenium: https://github.com/SeleniumHQ/selenium/issues/5610

Which a Selenium developer then links to a still-open, larger-scope issue, in the WebDriver spec repository: https://github.com/w3c/webdriver/issues/385

It seems like the basic auth support you are looking to achieve needs to be implemented by W3C contributors, not by Selenium developers.

All of the solutions you have mentioned trying seem to be the only available workarounds out there, and without a supported Selenium solution or fully-functioning workaround, this issue may not be solvable.



来源:https://stackoverflow.com/questions/58999783/safari-13-basic-authorization-in-webdriver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!