
We are going to use a very simple script to open Firefox to the website, and then enter text into the search box and submit the search and view the results. Once the package is downloaded, you are now ready to setup a script and start testing A simple script to test Be sure that you have started your virtual environment, and then from the Terminal window type the following: pip install selenium You will also need to install the Selenium Python third party library. Otherwise, if you choose to download the driver into another folder you will need to tell the webdriver where to find the file inside your Python script Install Selenium This will download and install the Geckodriver in your PATH, so that Selenium and Python can find the driver. From the Terminal window type the following: brew install geckodriver I will only describe how I setup my Mac here.
RUN SELENIUM GECKODRIVER FOR MAC AND WINDOWS HOW TO
You will need to look up how to install the Geckodriver for your platform, but for MacOS this was very simple by using HomeBrew. I chose to go with the Firefox Geckodriver for this setup. There is an unofficial Selenium documentation that talks about the different drivers. You will need a webdriver for the web browser you wish to control.


While it is not required, it is a very good idea to use a virtual environment to play with Selenium so that you don’t install versions of software that may affect your other projects. Virtual Environmentįor any project I do, I setup a Python Virtual Environment, and you can check out my quick article on setting this up. And I was really impressed on how quick and easy it was to setup and test. I needed to see if I could quickly setup and test how Selenium works, so that I can prepare some tests for the web client of the software package I work with at the office. Selenium can be fun to play with, but really best used for website testing.
