Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Selenium on Mac Chrome

Recently got a mac and was able to run Mozilla without any issues but having trouble installing chrome extensions and running it for selenium. Can someone guide me through the process of installing the extension and running selenium on Mac chrome.

like image 878
Ravi Avatar asked Jun 28 '16 15:06

Ravi


People also ask

How do I open Chrome in Selenium Mac?

New Selenium IDE Step1 − Navigate to the link:https://sites.google.com/chromium.org/driver/ and click on the download link of the chromedriver version which is compatible with our local chrome browser. Step2 − Click on the chromedriver link available for the Mac operating system.

Can you use Selenium on Mac?

Follow the below steps to install the Selenium package on macOS using the setup.py file: Step 1: Download the latest source package of Selenium for python3 from here. Step 2: Extract the downloaded package using the following command. Step 3: Go inside the folder and Enter the following command to install the package.


1 Answers

If you want to use Selenium WebDriver with Chrome, first download ChromeDriver - WebDriver for Chrome. This can be installed via Homebrew with brew install chromedriver, or manually by downloading, extracting, moving and setting the PATH as follows:

$ cd $HOME/Downloads $ wget http://chromedriver.storage.googleapis.com/2.22/chromedriver_mac32.zip $ unzip chromedriver_mac32.zip $ mkdir -p $HOME/bin $ mv chromedriver $HOME/bin $ echo "export PATH=$PATH:$HOME/bin" >> $HOME/.bash_profile 

Source: install and set path to chromedriver on mac or linux

You should then read Getting started with ChromeDriver on Desktop, in particular the sample code which shows how you map the path to the executable and instantiate ChromeDriver. If you have a reference to the driver in the PATH variable, you can omit the configuration line.

You can install both packed (.crx file) and unpacked (directory) extensions via ChromeDriver. See the code snippets for setting either up here.

If you were using Selenium IDE for FireFox instead, there is no version available for Chrome. The best alternative I know of is iMacros for Chrome.

like image 172
Gideon Pyzer Avatar answered Sep 26 '22 10:09

Gideon Pyzer