SeleniumHQ/seleniumhq.github.io

[๐Ÿ› Bug]: Network intercepters for authentication not working with Firefox and Chrome

martingrossmann opened this issue ยท 7 comments

What happened?

Tried to execute the Network intercepter test canContinueWithAuthCredentials in dev.selenium.bidirectional.webdriver_bidi.NetworkCommandsTest with latest Chrome and Firefox, but got a timeout or an exception:

Firefox

org.openqa.selenium.bidi.BiDiException: {"type":"error","id":1,"error":"unknown command","message":"network.addIntercept","stacktrace":"RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8\nWebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:191:5\nUnknownCommandError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:784:5\nassertExperimentalCommandsEnabled@chrome://remote/content/shared/messagehandler/Module.sys.mjs:87:13\naddIntercept@chrome://remote/content/webdriver-bidi/modules/root/network.sys.mjs:326:10\nhandleCommand@chrome://remote/content/shared/messagehandler/MessageHandler.sys.mjs:255:33\nexecute@chrome://remote/content/shared/webdriver/Session.sys.mjs:274:32\nonPacket@chrome://remote/content/webdriver-bidi/WebDriverBiDiConnection.sys.mjs:211:37\nonMessage@chrome://remote/content/server/WebSocketTransport.sys.mjs:127:18\nhandleEvent@chrome://remote/content/server/WebSocketTransport.sys.mjs:109:14\n"}
Build info: version: '4.18.1', revision: 'b1d3319b48'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '11.0.12'

Chrome
... cannot load https://the-internet.herokuapp.com/basic_auth and tests runs into a timeout.

org.openqa.selenium.TimeoutException: java.util.concurrent.TimeoutException
Build info: version: '4.18.1', revision: 'b1d3319b48'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '11.0.12'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [5298925cfc394709803d0376fea2414b, get {url=https://the-internet.herokuapp.com/basic_auth}]

The documentation tells it's supported since Selenium 4.18, but the example tests are disabled and do not work. What is here the latest implementation state?

What browsers and operating systems are you seeing the problem on?

  • Chrome 122 with latest chromedriver,
  • Firefox 123 with geckodriver 0.34.0
  • Windows 10

@martingrossmann, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

Traceback (most recent call last):
File "/cache/c-000000xy92mk07ip1rxumfaay60lzuep.py", line 25, in
from selenium import webdriver
ModuleNotFoundError: No module named 'selenium'

I have an update: With Selenium 4.19.1 the Network examples are working with Firefox 124, but not with Chrome.

Unfortunately, with Chrome 124 I still get a timeout. Does anybody know whats wrong with Chrome?

I remember I wanted to check this but got distracted by something else.

If you check https://github.com/SeleniumHQ/selenium/blob/aaa7e791a4b6be6314250966a4538cd594576254/java/test/org/openqa/selenium/bidi/network/NetworkCommandsTest.java#L45, they are only executed with Firefox. Chrome still needs to implement this.

We have the code examples disabled for that reason.

Is that right, @pujagani?

Yes! That's correct. Chrome's stable release does not support it. Looks like the latest Canary has the support https://wpt.fyi/results/webdriver/tests/bidi/network?label=master&label=experimental&aligned&view=subtest.

Thanks for your input, makes something clearer. :-)

I will close this as the question has been answered.