Skip to content

[πŸš€ Feature]: Support custom headers for remote WebDriver connection (python)Β #10892

@scook12

Description

@scook12

Feature and motivation

In RemoteConnection, the get_remote_connection_headers method has a set of logical defaults it builds, but there's no way for a user to make an addition to these headers.

Adding a hook or property that the consuming code can set to add to these headers would be a big help.

Usage example

I need to add a host header for requests to be successful to my selenium grid running behind traefik reverse proxy. Without this feature, I can't use selenium python out of the box to create sessions (initializing WebDriver throws 404 errors because traefik doesn't know where to route without the host header).

Passing a parameter from WebDriver to RemoteConnection ought to do the trick:

driver = WebDriver(command_executor, additional_headers={"Host": "some-value"})

Metadata

Metadata

Assignees

Labels

C-pyPython BindingsI-enhancementSomething could be better

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions