Skip to content

Conversation

@11byte
Copy link
Owner

@11byte 11byte commented Aug 14, 2025

🔗 Related Issues

Fixes SeleniumHQ#15541

💥 What does this PR do?

This PR fixes a bug where launching the WPE WebKit browser via Python bindings (webdriver.WPEWebKit()) fails with the error:


selenium.common.exceptions.InvalidArgumentException: Message: Invalid alwaysMatch capabilities

The issue stems from the WPE WebKit driver rejecting W3C-style alwaysMatch capabilities, which are automatically generated when passing options=Options() to RemoteWebDriver.

🔧 Implementation Notes

  • Replaces the usage of options=options with a minimal, manually defined desired_capabilities dictionary:
    {"browserName": "wpewebkit"}

* This avoids the automatic generation of `wpe:browserOptions` and other fields not supported by WPE WebKit.
* Keeps the rest of the driver initialization intact, including use of `Service` and `DriverFinder`.

This approach improves compatibility with the WPE WebKit driver, which currently does not fully support the W3C WebDriver protocol format used by Selenium's `Options.to_capabilities()`.

### 💡 Additional Considerations

* Follow-up work may include adding better validation or driver capability filtering for non-W3C-compliant drivers like WPE WebKit.
* A unit/integration test for WPE WebKit startup can be added if CI support is available for WPE environments (Linux only).
* If `browserName` must be `"MiniBrowser"` for compatibility reasons, that can be easily swapped in.

### 🔄 Types of changes

* Bug fix (backwards compatible)

```

@11byte 11byte merged commit b08d3e0 into trunk Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐛 Bug]: [py] Launching WPE WebKit fails

2 participants