Download Selenium Webdriver For Mac

  

Selenium is an excellent tool which automates browsers. One of the commonly approach is to use Selenium webdriver which has API in many languages like Python, Java, etc. This article will cover Selenium webdriver test automation on Mac using python. You can run Selenium webdriver locally or remotely.

Selenium – download and Install

Here are the steps to download and install stuff required to run selenium using python on Mac:

  1. Download selenium-server-standalone-2.33.0.jar from selenium google code site. You can also download selenium-server-2.33.0.zip which contains more stuff along with stand alone server. Skip this step if you just want to run test locally.
  2. Install python selenium bindings using:

    To verify and see selenium location run

  3. Install Firefox on Mac if not already installed.

Running python selenium locally

If you have pip on your system, you can simply install or upgrade the Python bindings: pip install -U selenium. Alternately, you can download the source distribution from PyPI (e.g. Selenium-3.141.0.tar.gz), unarchive it, and run: python setup.py install. Note: You may want to consider using virtualenv to create isolated Python environments. Selenium Firefox Driver Download For Mac To start Firefox browser on MAC using Selenium webdriver we have to use gecko driver which will interact with Firefox browser.In the previous post, we have already discussed how to work with Chrome on MAC using Selenium.

Running selenium locally need only python bindings. For the purpose of this tutorial, we’ll visit infoheap.com and click on search icon which should expand it to a search box. Then we’ll check the existence of the search box.

Here is the python selenium code to achieve this test:

The expected outcome from the test is:

Download
  1. Firefox windows opens with search image icon as shown below:
  2. The test script click on the search icon and it expands to a search box as shown below:
  3. The python script exists with no error message.

Running python selenium remotely

Download Selenium Webdriver For Mac

Download Selenium Webdriver For Mac Windows 10

To run the selenium test remotely these are the steps:

Selenium Webdriver Download Jar

  1. Run the selenium server on the machine where you want to run browser using the following command.
  2. Make changes to the python script replace driver = webdriver.Firefox() with following:
  3. Run the python script on the machine from where you want to run the test. For the purpose of this tutorial we are using the same machine. The outcome is similar to running the test locally except that browser runs on the selenium server machine whereas python script output is on client machine.
  4. You can also track the sessions running by visiting the url http://127.0.0.1:4444/wd/hub/ (replace 127.0.0.1 with remote host where selenium server is running).

Install Selenium Webdriver

Suggested posts: