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

Pass options to RemoteWebDriver #9240

Merged
merged 2 commits into from
Mar 10, 2021
Merged

Pass options to RemoteWebDriver #9240

merged 2 commits into from
Mar 10, 2021

Conversation

nijel
Copy link
Contributor

@nijel nijel commented Mar 7, 2021

Description

I believe that was the original intention of code in c23e440 - it updates or creates the options object, but it doesn't use it later.

This reverts #9208 and passes options to the super class.

In case passing desired_capabilities instead of options to super class is really intended, a lot of code dealing with the options object can be removed because it is never used here.

CC @Dmitri-Sintsov, @earendil, @AutomatedTester

Motivation and Context

Please see #9188, #9208 and #7348

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

I believe that was the original intention of code in c23e440 - it updates or creates the options object, but it doesn't use it later.

This reverts #9208 and passes options to the super class.
@CLAassistant
Copy link

CLAassistant commented Mar 7, 2021

CLA assistant check
All committers have signed the CLA.

@Dmitri-Sintsov
Copy link
Contributor

Would it work with headless option? In case desired_capabilities are deprecated, these should be removed everywhere, including RemoteWebDriver where these are currently used for headless option.

@nijel
Copy link
Contributor Author

nijel commented Mar 7, 2021

Yes it works headless. I did not orignally discover your fix and did fix it this way independently...

There is code which puts desired_capabilities into options and options are not used after that point:

if desired_capabilities:
for key, value in desired_capabilities.items():
options.set_capability(key, value)

So either this is useless and should be removed or it is desired and then the options should be used later. This code was changed in c23e440.

Maybe even desired_capabilities should be removed from the RemoteWebDriver.__init__ params as it is deprecated and it is put into the options.

I'm happy to improve or close the pull request based on the feedback, but my knowledge of Selenium internals is very limited.

@Dmitri-Sintsov
Copy link
Contributor

Just checked with my CI, indeed your version works in headless mode as well! I do not understand then why desired_capabilities are deprecated only in ChromiumDriver but not in RemoteWebDriver then? Maybe desired_capabilities should be removed everywhere, then?

@AutomatedTester
Copy link
Member

Just checked with my CI, indeed your version works in headless mode as well! I do not understand then why desired_capabilities are deprecated only in ChromiumDriver but not in RemoteWebDriver then? Maybe desired_capabilities should be removed everywhere, then?

The reason is I want to get Selenium 4 out the door first before as it's going to be a larger breaking change for people who use Selenium grid. Perhaps I am being overly cautious...

@AutomatedTester AutomatedTester merged commit c02a2d0 into SeleniumHQ:trunk Mar 10, 2021
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

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.

4 participants