Run the following commands on WSL to create symlinks: To run a basic Selenium UI test on any environment you would need a browser and a driver to control the browser, in our case all we have to do is, make Windows’s Chrome browser and the chromedriver accessible from WSL, through symlinks. Link Windows’s Chrome and chromedriver to WSL: To open Chrome browser on Windows run – /mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe. exe files on Windows can be run from WSL too. To see the contents of a file foo.txt in C: drive, you can use – cat /mnt/c/foo.txt from WSL. The Windows file system is mounted on the mount point – /mnt on WSL. Now that you have WSL setup, you can start accessing Windows files from WSL. The steps I am about to suggest should work regardless of the Linux distribution you are planning to use. You can pick any distribution of Linux for WSL, I chose Ubuntu for my project. Here are the steps on how to setup WSL on Windows – WSL is a cool feature on Windows 10 that allows you to run most of the GNU/Linux commands and applications on Windows. Hopefully, this will help other testers who face a similar issue. I am writing this post to share the steps I followed to setup a Linux environment on my Windows machine to run the Selenium tests. This prevented us from running the tests on a Windows environment. The framework the client had been using, used a UNIX command to find the test files in the various subdirectories under the project root. I had to setup a Linux system for running the automation tests for one of our clients. If you are one of those testers that had been using a Windows machine and have had to setup a Linux system for running your Selenium automation test, this post is for you.
0 Comments
Leave a Reply. |