-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
[dotnet] Do not warn when passing in null driver paths to driver service #15328
[dotnet] Do not warn when passing in null driver paths to driver service #15328
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Interesting behavior: if (File.Exists(driverPath))
{
fileName = Path.GetFileName(driverPath);
driverPath = Path.GetDirectoryName(driverPath)!;
}
else
{
fileName = ChromiumDriverServiceFileName(DefaultChromeDriverServiceExecutableName);
} I am user, I call method @RenderMichael do you think the same? |
@nvborisenko I completely agree. It would be a breaking change (I think a good one?) so maybe it should come with v5? Or can we do it for 4.30? |
Good one breaking change. Existing users will not be broken (because they are already in happy branch). So it is a breaking change for users who "thinks they are in happy branch". I propose to fix in in minor selenium version. Thanks Mike. |
That’s also a good point, in a way every bug fix is a “breaking change”. I will update this PR shortly to throw a good exception. |
Digging into this a little bit, I misinterpreted how this method family functioned, and there is no bug. It looks like the
I refactored the methods to clarify this functionality better. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @RenderMichael, looks good.
…ice (SeleniumHQ#15328) * [dotnet] Do not warn when passing in null driver paths to driver service * Clarify functionality of CreateDriverService * fix XML comment for `EdgeDriverService`
User description
Description
This avoids warning users when passing in
null
for a driver service's driver directory path or filename.Motivation and Context
Fixes #15320
Types of changes
Checklist
PR Type
Bug fix
Description
Updated driver service methods to accept nullable parameters.
Fixed potential null reference warnings in driver service creation.
Ensured compatibility with nullable reference types (NRT) in .NET.
Changes walkthrough 📝
ChromeDriverService.cs
Allow nullable parameters in ChromeDriverService methods
dotnet/src/webdriver/Chrome/ChromeDriverService.cs
CreateDefaultService
methods to accept nullable parameters.string?
fordriverPath
anddriverExecutableFileName
.EdgeDriverService.cs
Allow nullable parameters in EdgeDriverService methods
dotnet/src/webdriver/Edge/EdgeDriverService.cs
CreateDefaultService
methods to accept nullable parameters.string?
fordriverPath
anddriverExecutableFileName
.FirefoxDriverService.cs
Allow nullable parameters in FirefoxDriverService methods
dotnet/src/webdriver/Firefox/FirefoxDriverService.cs
CreateDefaultService
methods to accept nullable parameters.string?
fordriverPath
anddriverExecutableFileName
.InternetExplorerDriverService.cs
Allow nullable parameters in InternetExplorerDriverService methods
dotnet/src/webdriver/IE/InternetExplorerDriverService.cs
CreateDefaultService
methods to accept nullable parameters.string?
fordriverPath
anddriverExecutableFileName
.SafariDriverService.cs
Allow nullable parameters in SafariDriverService methods
dotnet/src/webdriver/Safari/SafariDriverService.cs
CreateDefaultService
methods to accept nullable parameters.string?
fordriverPath
anddriverExecutableFileName
.