-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[🐛 Bug]: Dotnet Breaking Change in 4.11.0 #12473
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
Comments
@tidusjar, thank you for creating this issue. We will troubleshoot it as soon as we can. Info for maintainersTriage this issue by using labels.
If information is missing, add a helpful comment and then
If the issue is a question, add the
If the issue is valid but there is no time to troubleshoot it, consider adding the
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable
After troubleshooting the issue, please add the Thank you! |
Ok, this is a fun one. If the latter was passed in, .NET would actually look for 4.11 does not ignore it any longer, but respects what a user passes in (as it should). But since I know people sometimes pass in the full path, I added code to fix it — https://github.com/SeleniumHQ/selenium/blob/trunk/dotnet/src/webdriver/Chrome/ChromeDriverService.cs#L72 But it looks like I was assuming that the driver would be named "chromedriver.exe". But the feature you thought was working before was not actually working the way you thought, which is why it was bad and needed to be changed.. |
Thanks for the explanation behind that. Another potential fix instead of just 'making it work', could be if it's a full path, throw an exception so the developer knows exactly what is wrong and how to fix it? |
Yes, I went this route to make it more closely match all the other bindings. Looking through the code I don't see where we make use of it being two arguments in general since we just end up combining them when they actually get used. If I had more time/energy, I'd deprecate the constructor for setting 2 parameters and require the single string to always be full path because that is what people seem to most expect. |
I think the original description for this issue was a bit misleading, as the example for "pathToDriver" is not accurate. In this instance, path to driver is "c:<somefolders>\chromedriver" so the command being executed is this
The chrome driver exe itself is still named "chromedriver.exe" I think it is the fact that the containing folder is also named "chromedriver" that is causing issues, Looking at the fix at https://github.com/SeleniumHQ/selenium/blob/trunk/dotnet/src/webdriver/Chrome/ChromeDriverService.cs#L72, it looks like it is checking the folder path contains "chromedriver" and assuming it is the full exe path, and adjusting the folder path accordingly. (so the driver path becomes "c:<somefolders>") If we pass in the full exe path "c:<somefolders>\chromedriver\chromedriver.exe" then it works as expected, but I would really expect it to work if just the folder path is passed in, even if the folder is named "chromedriver" too |
Ah, yes, it's matching anything with the driver name in it. To be honest the best fix for all of this is to delete the driver and let Selenium manage it for you now. But thanks for the clarification, that's definitely the wrong conditional. |
No, that's not true... If my driver is here: "/Users/titusfortner/chromedriver/chromedriver" This works: ChromeDriverService.CreateDefaultService("/Users/titusfortner/chromedriver/chromedriver"); and this works: ChromeDriverService.CreateDefaultService("/Users/titusfortner/chromedriver/"); This does not work, because it is not getting parsed as a directory, but as a file: ChromeDriverService.CreateDefaultService("/Users/titusfortner/chromedriver"); I've updated the conditional to just check if it is a file. If it's a file, Selenium will just use the directory, if it isn't a file, Selenium will use what was passed in. |
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. |
Uh oh!
There was an error while loading. Please reload this page.
What happened?
When using the following code to create a ChromeDriver, it throws the following exception in 4.11.0
How can we reproduce the issue?
pathToDriver
is the full path to the driver instance e.g.C:\something\chrome\driver.exe
This change is related to #12344
Relevant log output
Operating System
Linux
Selenium version
4.11.0
What are the browser(s) and version(s) where you see this issue?
Chrome
What are the browser driver(s) and version(s) where you see this issue?
ChromeDriver 114.0.5735.90
Are you using Selenium Grid?
N/A
The text was updated successfully, but these errors were encountered: