95

How to install Selenium WebDriver on Mac OS X 10.7.5 supporting Chrome, Firefox and safari ? What I have to set, where to install.

Zulu
  • 6,802
  • 9
  • 42
  • 51
user2790794
  • 959
  • 1
  • 7
  • 3
  • 4
    This post is currently the top hit on a Google search for "install selenium mac," so here's an updated link (the one above appears to be broken): https://selenium-python.readthedocs.io/installation.html – Jaime Sep 09 '17 at 22:20

4 Answers4

208

Install

If you use homebrew (which I recommend), you can install selenium using:

brew install selenium-server-standalone

Running

updated -port port_number

To run selenium, do: selenium-server -port 4444

For more options: selenium-server -help

JamesDeHart
  • 215
  • 2
  • 9
Will
  • 10,218
  • 8
  • 62
  • 72
36

Mac already has Python and a package manager called easy_install, so open Terminal and type

sudo easy_install selenium
Zulu
  • 6,802
  • 9
  • 42
  • 51
Ivan Proskuryakov
  • 1,402
  • 1
  • 20
  • 29
  • 4
    This works but assumes that you want to run Selenium with Python. If that is what you want see http://damien.co/resources/how-to-install-selenium-2-mac-os-x-python-7391 Typically I think what people are looking for though is how to run the Selenium Standalone Server from the command line so it is available use by other scripts. – chrowe Jun 14 '16 at 13:04
  • 1
    If you need to uninstall the python version of selenium: 1. sudo easy_install -m selenium 2. sudo rm -rf /Library/Python/2.7/site-packages/selenium-3.11.0-py2.7.egg (file name may vary, depending on version) – Red Rooster Mar 20 '18 at 01:58
6

To use the java -jar selenium-server-standalone-2.45.0.jar command-line tool you need to install a JDK. You need to download and install the JDK and the standalone selenium server.

Zulu
  • 6,802
  • 9
  • 42
  • 51
  • 2
    This is what I was looking for but it is not clear where to get the jar file from. The current version on http://www.seleniumhq.org/download/ does not seem to work for me running OS X 10.11.5 El Capitan. This guide worked though: http://damien.co/resources/how-to-get-started-selenium-2-mac-os-x-java-7403 – chrowe Jun 14 '16 at 16:56
1

First up you need to download Selenium jar files from http://www.seleniumhq.org/download/. Then you'd need an IDE, something like IntelliJ or Eclipse. Then you'll have to map your jar files to those IDEs. Then depending on which language/framework you choose, you'll have to download the relevant library files, for example, if you're using JUnit you'll have to download Junit 4.11 jar file. Finally don't forget to download the drivers for Chrome and Safari (firefox driver comes standard with selenium). Once done, you can start coding and testing your code with the browser of your choice.

Donshon
  • 174
  • 2
  • 9