I run into a problem with setting up the ChromeDriver for sitespeed.io, I did not fully understand the installation instructions that were outlined in the ChromeDriver Getting started guide, mainly because I was unfamiliar with including the ChromeDriver location in my PATH environment variable on the MacBook that I’m using.
Don’t get me wrong, I’ve updated PATH variables on Windows for years but never on a Mac.
This is what I did in the end
- Download the ChromeDriver executable.
- Place the driver in a folder – I choose to place it in /Users/<your name>/Documents/WebDriver
- Update your own PATH to point to /Users/<your name>/Documents/WebDriver.
- To do this:
Open up Terminal
Run sudo nano /etc/paths
Enter your password
Go to the bottom of the file and enter the path you wish to add
Control-x to quit
Y to save
- To double-check, quit Terminal and relaunch it. Run echo $PATH. You should see your newly added path in the stream of other paths already there.
- Finally, update your sitespeed.io tests to run using ChromeDriver (include code snippet) and run your tests!
- If your PATH isn’t set up correctly you get an error message
That’s it, hope this helped you.
Leave a Reply