-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add edgedriver to PATH automatically #1
Comments
Well, I tried to do this. Added to the PATH just fine, that's easy... but Selenium did not like it very much. The browser opens, but then everything just crashes. No idea how this happens, but it seems that (at least for nodejs selenium), PATH isn't very useful (yet). I might just be doing something wrong, though. |
@StephanBijzitter are you sure you have the correct version of the driver? When I tried some time ago it was really confusing, some old drivers worked with newer Edge, and some didn't. |
Versions:
Argument - This works, no issues at all: const driverBinary = require('@sitespeed.io/edgedriver').binPath();
const service = new Edge.ServiceBuilder(driverBinary).build();
const driver = Edge.Driver.createSession(capabilities, service); PATH - This is able to open the browser, but then crashes: const driverBinary = require('@sitespeed.io/edgedriver').binPath();
process.env.PATH = driverBinary + path.delimiter + process.env.PATH;
const service = new Edge.ServiceBuilder().build();
const driver = Edge.Driver.createSession(capabilities, service);
And just for a sanity check, this complains that it cannot find a suitable driver, as expected: const service = new Edge.ServiceBuilder().build();
const driver = Edge.Driver.createSession(capabilities, service); After updating to Edge 83.0.478.37, the first example fails (version mismatch), but strangely enough the second example has the exact same behavior: Unknown error. Edit: After also updating the driver, first example works again (as expected), second example still fails in the same way. |
The equivalent chromedriver and geckodriver packages also do this, and make setting up selenium just a bit simpler, where requiring the package is enough to set it all up.
For example: https://github.com/giggio/node-chromedriver/blob/master/lib/chromedriver.js#L18
If you want, I could create a pull request for this.
The text was updated successfully, but these errors were encountered: