Skip to content

[πŸ› Bug]: Cannot initialize BiDi if SE_NODE_GRID_URL uses Hub name rather than localhostΒ #15610

@MJB222398

Description

@MJB222398

Description

I use a Docker Selenium Grid and use BiDi with C#. My Grid has a Hub, some nodes, some video containers. For the Nodes I set SE_NODE_GRID_URL=http://selenium-hub:4444. I am running Docker in WSl2 (Ubuntu) on my Windows 10 machine, and executing C# code on the Windows 10 machine itself. If I do this and then execute this code:

seleniumRemoteWebDriver.AsBiDiAsync().GetAwaiter().GetResult();

I get this exception:

Message: 
System.Net.WebSockets.WebSocketException : Unable to connect to the remote server
----> System.Net.Http.HttpRequestException : No such host is known. (selenium-hub:4444)
----> System.Net.Sockets.SocketException : No such host is known.

Stack Trace: 
WebSocketHandle.ConnectAsync(Uri uri, HttpMessageInvoker invoker, CancellationToken cancellationToken, ClientWebSocketOptions options)
ClientWebSocket.ConnectAsyncCore(Uri uri, HttpMessageInvoker invoker, CancellationToken cancellationToken)
WebSocketTransport.ConnectAsync(CancellationToken cancellationToken)
Broker.ConnectAsync(CancellationToken cancellationToken)
BiDi.ConnectAsync(String url)
WebDriverExtensions.AsBiDiAsync(IWebDriver webDriver)

If instead I use SE_NODE_GRID_URL=http://localhost:4444 then BiDi is created fine. If I am not using BiDi then the web driver works fine with either localhost or selenium-hub in the SE_NODE_GRID_URL

Reproducible Code

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!B-gridEverything grid and server relatedC-dotnet.NET BindingsD-chromeI-defectSomething is not working as intendedOS-windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions