Installing Selenium on MacOS: A Step-by-Step Guide

Search for a command to run...

No comments yet. Be the first to comment.
In this series, I'll be covering how to overcome obstacles we encounter on a daily basis while working with macOS systems.
Low-code platforms can be excellent for validating an idea. The risk begins when a temporary launch stack becomes permanent infrastructure for a growing product.

A practical, opinionated baseline for securing fresh Debian/Ubuntu VPS servers before deploying real apps.

How to enable HTTPS on localhost with Vite and mkcert

There are two kinds of developers: those who fear regex, and those who use it like a superpower. The funny part? It’s the same tool — the difference is perspective.Most people think of regex as the thing you use to validate emails, phone numbers, or ...

Why accessibility is everyone’s responsibility

In this comprehensive guide, we will explore the step-by-step process of installing Selenium on MacOS, enabling you to harness the power of this versatile tool for web browser automation.
Selenium is a widely-used package in the Python programming language that allows developers to automate web browser interactions seamlessly. By leveraging the capabilities of Selenium, one can efficiently perform tasks such as web scraping, browser testing, and automating repetitive actions, ultimately streamlining the overall development process.
Selenium supports be installed for several programming languages with what they call WebDrivers:
After a fresh Xcode installation, add command line tools by executing
xcode-select --installin the terminal to enable seamless web browser automation using Python's Selenium package.
For installing Selenium for Python we are gonna need some prerequisites:
Install Homebrew a package manager for macOS
Install Python programming language, we'll benefit from its pip package installer
brew install python3
# then make sure you have the latest version of pip
pip install --upgrade pip
pip install selenium
It is straightforward, just install it from your preferred registry package manager:
npm install selenium-webdriver
# package.json dependency array
"selenium-webdriver": "^4.9.0"
gem install selenium-webdriver
# add to project gemfile
gem 'selenium-webdriver', '= 4.9.0'
Install-Package Selenium.WebDriver
# .NET CLI
dotnet add package Selenium.WebDriver
# Reference it
<PackageReference Include="Selenium.WebDriver" Version="4.9.0" />
Let's install a couple of libraries from npm:
npm install selenium-webdriver
npm install chromedriver
This code snipped will open a Chrome window and redirect to the website you set in the driver.get function:
const { Builder } = require('selenium-webdriver');
require("chromedriver");
(async function helloSelenium() {
let driver = await new Builder().forBrowser('chrome').build();
await driver.get('https://blog.aiherrera.com');
})();
and also you'll notice a message telling you that: Chrome is being controlled by automated test software.

There are also extensions for some of the most popular browsers that are called IDE as stated on Selenium's website:
Selenium IDE is a Chrome, Firefox and Edge plugin which records and plays back user interactions with the browser. Use this to either create simple scripts or assist in exploratory testing.
Thank you for reading! Any constructive feedback is greatly appreciated!