[macos] How to install Selenium WebDriver on Mac OS

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.

This question is related to macos selenium

The answer is


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

brew install selenium-server-standalone


updated -port port_number

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

For more options: selenium-server -help

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

sudo easy_install selenium

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.

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.

Questions with macos tag:

Problems with installation of Google App Engine SDK for php in OS X dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib error running php after installing node with brew on Mac Could not install packages due to an EnvironmentError: [Errno 13] How do I install Java on Mac OSX allowing version switching? Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) Can't compile C program on a Mac after upgrade to Mojave You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory. (mac user) How can I install a previous version of Python 3 in macOS using homebrew? Could not install packages due to a "Environment error :[error 13]: permission denied : 'usr/local/bin/f2py'" Cannot connect to the Docker daemon on macOS Stuck at ".android/repositories.cfg could not be loaded." How to switch Python versions in Terminal? Class JavaLaunchHelper is implemented in two places How can I add a .npmrc file? "SSL certificate verify failed" using pip to install packages How to uninstall Anaconda completely from macOS mysqli_real_connect(): (HY000/2002): No such file or directory How do I upgrade to Python 3.6 with conda? pip or pip3 to install packages for Python 3? Brew install docker does not include docker engine? Homebrew refusing to link OpenSSL How to install JQ on Mac by command-line? How to update Ruby with Homebrew? psql: command not found Mac macOS on VMware doesn't recognize iOS device Is there a keyboard shortcut (hotkey) to open Terminal in macOS? pip installs packages successfully, but executables not found from command line SSL: CERTIFICATE_VERIFY_FAILED with Python3 Eclipse not recognizing JVM 1.8 How to install latest version of openssl Mac OS X El Capitan How can I easily switch between PHP versions on Mac OSX? Switch between python 2.7 and python 3.5 on Mac OS X Finding Android SDK on Mac and adding to PATH How to install wget in macOS? Reset MySQL root password using ALTER USER statement after install on Mac `node-pre-gyp install --fallback-to-build` failed during MeanJS installation on OSX MacOS Xcode CoreSimulator folder very big. Is it ok to delete content? Mysql password expired. Can't connect What version of Python is on my Mac? How to install gdb (debugger) in Mac OSX El Capitan? Command Line Tools not working - OS X El Capitan, Sierra, High Sierra, Mojave Operation Not Permitted when on root - El Capitan (rootless disabled) How to run C program on Mac OS X using Terminal? How to install sshpass on mac? Can't install gems on OS X "El Capitan" "OSError: [Errno 1] Operation not permitted" when installing Scrapy in OSX 10.11 (El Capitan) (System Integrity Protection) Can you install and run apps built on the .NET framework on a Mac? Pyspark: Exception: Java gateway process exited before sending the driver its port number pip installation /usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory

Questions with selenium tag:

SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81 session not created: This version of ChromeDriver only supports Chrome version 74 error with ChromeDriver Chrome using Selenium Selenium: WebDriverException:Chrome failed to start: crashed as google-chrome is no longer running so ChromeDriver is assuming that Chrome has crashed WebDriverException: unknown error: DevToolsActivePort file doesn't exist while trying to initiate Chrome Browser Class has been compiled by a more recent version of the Java Environment How to configure ChromeDriver to initiate Chrome browser in Headless mode through Selenium? How to make Firefox headless programmatically in Selenium with Python? element not interactable exception in selenium web automation Selenium Web Driver & Java. Element is not clickable at point (x, y). Other element would receive the click How do you fix the "element not interactable" exception? Python Selenium Chrome Webdriver Scrolling to element using webdriver? Which ChromeDriver version is compatible with which Chrome Browser version? selenium - chromedriver executable needs to be in PATH Selenium using Python - Geckodriver executable needs to be in PATH Only local connections are allowed Chrome and Selenium webdriver Selenium using Java - The path to the driver executable must be set by the webdriver.gecko.driver system property Check if element is clickable in Selenium Java XPath: difference between dot and text() How to use the gecko executable with Selenium Selenium 2.53 not working on Firefox 47 SyntaxError: Use of const in strict mode? How to set "value" to input web element using selenium? How to open a link in new tab (chrome) using Selenium WebDriver? Can a website detect when you are using Selenium with chromedriver? What is the difference between getText() and getAttribute() in Selenium WebDriver? ImportError: No module named 'selenium' How to click a href link using Selenium How to get attribute of element from Selenium? Selenium Finding elements by class name in python Change user-agent for Selenium web-driver Error message: "'chromedriver' executable needs to be available in the path" Open web in new tab Selenium + Python Wait until page is loaded with Selenium WebDriver for Python Set value of input instead of sendKeys() - Selenium WebDriver nodejs Error: org.testng.TestNGException: Cannot find class in classpath: EmpClass Capturing browser logs with Selenium WebDriver using Java Get all child elements How to deal with certificates using Selenium? How to handle authentication popup with Selenium WebDriver using Java Find elements inside forms and iframe using Java and Selenium WebDriver How to write multiple conditions of if-statement in Robot Framework How to use XPath preceding-sibling correctly How can I control Chromedriver open window size? Where to find 64 bit version of chromedriver.exe for Selenium WebDriver? Selenium and xPath - locating a link by containing text How to read Data from Excel sheet in selenium webdriver What is difference between Implicit wait and Explicit wait in Selenium WebDriver? How to verify an XPath expression in Chrome Developers tool or Firefox's Firebug? unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.9