-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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]: Selenium manager doesn't work in paths that contain spaces #11649
Comments
@cfarmerga, 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! |
Meanwhile, we can eliminate the spaces with replaceAll() to make it understand the path. |
Just in case it helps this get triaged sooner, here's the problematic line of code:
Since We use Selenium in the classroom and this bug has been causing issues for our students. If no one has a chance to take a look at this, I might offer up a PR 😅 |
@atrnh yes, we would love a PR! thank you. |
Since execSync does not escape shell metacharacters, attempting to execute a command with a space in it will fail. This is the case when the path to selenium-manager contains a space. This commit replaces execSync with spawnSync, which does escape shell metacharacters. Fixes SeleniumHQ#11649
Since execSync does not escape shell metacharacters, attempting to execute a command with a space in it will fail. This is the case when the path to selenium-manager contains a space. This commit replaces execSync with spawnSync, which does escape shell metacharacters. Fixes SeleniumHQ#11649
Thanks for the response @titusfortner! I've submitted a PR 😊 |
…eniumHQ#11649) (SeleniumHQ#11873) * replace execSync with spawnSync in seleniumManager.js Since execSync does not escape shell metacharacters, attempting to execute a command with a space in it will fail. This is the case when the path to selenium-manager contains a space. This commit replaces execSync with spawnSync, which does escape shell metacharacters. Fixes SeleniumHQ#11649 * [javascript] Refine usage of spawnSync --------- Co-authored-by: Sri Harsha <12621691+harsha509@users.noreply.github.com> Co-authored-by: Diego Molina <diemol@users.noreply.github.com> Co-authored-by: Diego Molina <diemol@gmail.com>
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. |
What happened?
I am using Windows 11 and have a simple js script that tries to build a driver using selenium manager. I see that it works fine when I have the script in a path which contains no spaces, but it fails when spaces exist in the path with this error:
I see that the cause seems to be the code in selenium-webdriver/common/seleniumManager.js (line 76), where the driverLocation function tries to use the result of getBinary() directly in execSync. It seems like this path should be quoted before being passed to execSync.
Also posted to https://stackoverflow.com/questions/75438848/selenium-builder-failing-with-spaces-in-path
How can we reproduce the issue?
Relevant log output
Operating System
Windows 11
Selenium version
javascript 4.8.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?
Any
Are you using Selenium Grid?
No response
The text was updated successfully, but these errors were encountered: