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]: Breaking change to RemoteWebDriver constructor #13609

Closed
MJB222398 opened this issue Feb 20, 2024 · 6 comments
Closed

[🐛 Bug]: Breaking change to RemoteWebDriver constructor #13609

MJB222398 opened this issue Feb 20, 2024 · 6 comments

Comments

@MJB222398
Copy link

What happened?

Not a bug per se, but just wanted to point out the breaking change that was made since 4.16.2. The parameter name for the ICapabilities parameter in this constructor was seemingly changed from desiredCapabilities to capabilities. Is it typical to make breaking changes in minor releases without warning? This had me worried for a bit before I saw what had happened.

public RemoteWebDriver(Uri remoteAddress, ICapabilities capabilities, TimeSpan commandTimeout)
    : this(new HttpCommandExecutor(remoteAddress, commandTimeout), capabilities)
{
}

Maybe stick something in the release notes?

How can we reproduce the issue?

N/A

Relevant log output

N/A

Operating System

N/A

Selenium version

4.18

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

N/A

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

N/A

Are you using Selenium Grid?

N/A

Copy link

@MJB222398, 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!

@diemol
Copy link
Member

diemol commented Feb 23, 2024

Why is it a breaking change? The parameter name changed, but the type stayed the same.

As a reference, this is the commit.

@MJB222398
Copy link
Author

@diemol Its a breaking change because it meant I had to make changes to my code after updating the Selenium NuGet package.

My code was as below. So I had to change the parameter name to get it to build.

public async Task<IDriver> CreateAsync(Browser browser)
{
    var remoteDriver = new RemoteDriver(
        new RemoteWebDriver(
            remoteAddress: new Uri(_driverConfiguration.Url),
            desiredCapabilities: _driverOptionsFactory.Create(browser).ToCapabilities(),
            commandTimeout: TimeSpan.FromSeconds(_driverConfiguration.CommandTimeout)),
        browser,
        _elementFactory,
        _byFactory);

    await remoteDriver.Initialize();

    return remoteDriver;
}

@diemol
Copy link
Member

diemol commented Feb 23, 2024

Thanks for flagging this. We did not consider this use case and will consider it for future changes. Before implementing breaking changes, we deprecate the old interface and then do them. Our apologies.

@diemol diemol closed this as not planned Won't fix, can't repro, duplicate, stale Feb 23, 2024
@nvborisenko
Copy link
Member

50 cents from my point of understanding:

Renaming a parameter name is a breaking change at the compilation level. It differs from a breaking change at the binary level, where all upstream dependencies must be rebuilt to be compatible with the new Selenium binaries. Therefore, it is considered a “minor” breaking change. All right? Aligning the parameter name in your code (which uses the parameter: value syntax) is not a big deal, especially since it is highlighted by the IDE.

Selenium project tries to deprecate old API and suggests to use new one. Particularly in this case it was impossible, the API is still the same (API at binary level).

Given that Selenium project doesn't follow to SemVer schema, it is OK to break something... as has happened many times before through deprecation notifications. New minor versions continue to be released with such changes.

In my opinion, we should continue to “break what we want with deprecation,” or alternatively, “break what we want with a notice in the changelog/release notes.” In this scenario, a “notice in the changelog” would suffice.

nvborisenko added a commit to nvborisenko/selenium-hq that referenced this issue Feb 23, 2024
Copy link

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

@github-actions github-actions bot locked and limited conversation to collaborators Mar 24, 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

3 participants