Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: Remove on spec compliant desiredCapabilities and requiredCapabilities #11820

Closed
whimboo opened this issue Mar 27, 2023 · 10 comments
Closed

Comments

@whimboo
Copy link
Contributor

whimboo commented Mar 27, 2023

What happened?

Both the desiredCapabilities and requiredCapabilities were used in pre-WebDriver classic spec times to specify capabilities for the browser. Now this is no longer needed and could be removed.

The WebDriver classic spec only uses firstMatch and alwaysMatch instead when processing capabilities.

As per code search there are a couple of Selenium bindings which still make use of the non-spec capabilities matching including Python, Java, C#.

Once the usage is gone we will also remove it from geckodriver.

Thanks.

CC @diemol, @AutomatedTester, @jimevans.

How can we reproduce the issue?

Querying the Selenium repository:
https://github.com/SeleniumHQ/selenium/search?q=desiredcapabilities&type=code

Relevant log output

None

Operating System

MacOS 13.2.1

Selenium version

Latest

What are the browser(s) and version(s) where you see this issue?

Firefox 113

What are the browser driver(s) and version(s) where you see this issue?

geckodriver 0.32.2

Are you using Selenium Grid?

No

@github-actions
Copy link

@whimboo, 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.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

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

Thank you!

@titusfortner
Copy link
Member

For Python this is only present in ExtensionConnection which I think we recently agreed needs to be deprecated anyway because I don't think it works for geckodriver.

@nvborisenko can you double check for .NET whether it is still sending both desiredCapabilities and capabilities in the new session payload to the driver/server?

@diemol how much work is going to be required to pull this out of Java?

Thanks!

@nvborisenko
Copy link
Member

Just quickly tested .Net bindings, seems it uses firstMatch both for local and remote ends:

02:46:18.875 DEBUG HttpCommandExecutor: Executing command: []: newSession {"capabilities":{"firstMatch":[{"browserName":"firefox","acceptInsecureCerts":true,"moz:firefoxOptions":{}}]}}

@diemol
Copy link
Member

diemol commented Jan 5, 2024

I don't think this is in Java anymore, you might find variable names or comments, but desiredCapabilities is not used anymore in the payload. Do you have an example where it is still used?

@titusfortner
Copy link
Member

No, I just didn't remember it had been removed. I guess we're ok to close this.

@whimboo
Copy link
Contributor Author

whimboo commented Jan 5, 2024

@titusfortner would you mind telling us what the closed status exactly mean? Is each and every usage of those capabilities gone across all bindings? And (if possible) since which release are the binding no longer using them. I wonder when we can get started to remove the support in geckodriver. Thanks!

@titusfortner
Copy link
Member

Java was the longest holdout in #11823 (Selenium 4.9)
JS removed with fa6deee (Selenium 4.5)
Python in #10494 (Selenium 4.2)
Ruby & .NET both removed this for Selenium 4

@titusfortner
Copy link
Member

.NET is a little confusing because it references "desiredCapabilities" all over the place still, it just doesn't send it as a key to the driver.

@whimboo
Copy link
Contributor Author

whimboo commented Jan 5, 2024

Thanks a lot! So Selenium 4.9 has been released on April 20, 2023 so we should be fine to get it removed in geckodriver now.

Copy link

github-actions bot commented Feb 5, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants