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

Add edgedriver to PATH automatically #1

Open
StephanBijzitter opened this issue Mar 9, 2020 · 3 comments
Open

Add edgedriver to PATH automatically #1

StephanBijzitter opened this issue Mar 9, 2020 · 3 comments

Comments

@StephanBijzitter
Copy link

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.

@StephanBijzitter
Copy link
Author

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.

@soulgalore
Copy link
Member

@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.

@StephanBijzitter
Copy link
Author

StephanBijzitter commented May 22, 2020

@soulgalore

Versions:

  • @sitespeed.io/edgedriver 80.0.361-54d (no specific configuration for downloads)
  • Edge 81.0.416.77

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);
WebDriverError: Unknown error
    at parseHttpResponse (C:\Users\Steph\Documents\GitHub\Dullahan\packages\dullahan-adapter-selenium-4\node_modules\selenium-webdriver\lib\http.js:582:11)
    at Executor.execute (C:\Users\Steph\Documents\GitHub\Dullahan\packages\dullahan-adapter-selenium-4\node_modules\selenium-webdriver\lib\http.js:491:26)

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.
Edit2: Changing the PATH entry to the directory (rather than the executable) does not make a difference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants