To build and run a Selenium project, install a Selenium language binding as a project dependency, make a browser available, write a test that starts and ends a WebDriver session, and run it with your language’s test runner. For many standard setups, Selenium Manager can find or obtain the browser driver automatically; Selenium Grid is optional when you need to run tests remotely or in parallel.
What a Selenium project needs
Selenium WebDriver is a language-neutral interface. Your project uses a language binding—such as Python’s Selenium package or Java’s Selenium library—to send commands through the WebDriver implementation for the browser you want to control. The basic pieces are the binding, a target browser, and its browser-specific driver. See the Selenium Project’s Getting started guide for the current overview.
- Language binding: the package or library your code imports.
- Browser: Chrome, Firefox, Edge, or another browser supported by your setup.
- Driver: the browser-specific component that communicates with the browser. Selenium Manager handles many ordinary driver setup cases.
- Test runner or build tool: pytest, Maven, Gradle, or the equivalent for your language, used to execute the project repeatably.
Record dependencies in a manifest or build file rather than relying on an undocumented one-off installation. This makes it easier for another developer or a CI job to recreate the project.
Choose a language and install Selenium
Use the install instructions for the language and runtime version your project supports. Selenium’s official Install a Selenium library page covers Java, Python, JavaScript, .NET, and Ruby; package names and runtime compatibility can change.
Recommended Free Tools
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Python with a virtual environment and pytest
Create and activate a virtual environment, then install the binding. On macOS or Linux:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install selenium pytest
On Windows PowerShell, activation is typically:
py -m venv .venv
..venvScriptsActivate.ps1
python -m pip install selenium pytest
For a repeatable project, record the dependencies in requirements.txt and install them with python -m pip install -r requirements.txt. Choose and pin versions that your project has verified rather than copying an example version without checking it. The Python binding documentation recommends virtual environments for isolation: Python installation guidance.
Java with Maven or Gradle
For Maven, declare org.seleniumhq.selenium:selenium-java in the project’s pom.xml, using a version appropriate for the project. For Gradle, add Selenium as a test dependency, for example with the testImplementation configuration, and configure the test task for the test framework in use. The official installation guide has current Maven and Gradle examples: Selenium library installation.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Write and run a first browser test
A minimal test should create a WebDriver session, navigate to a page, check an observable result, and quit the session even if an assertion fails. Here is a Python example using pytest:
from selenium import webdriver
def test_example_title():
driver = webdriver.Chrome()
try:
driver.get("https://example.com")
assert driver.title == "Example Domain"
finally:
driver.quit()
Save it as test_example.py. Run just this test with pytest -q test_example.py; run the project suite from its root with pytest. The finally block ensures the browser session is closed after success or failure.
For Java, put the Selenium dependency and a test framework in the project build, write a test that creates a browser driver and closes it, then use the build tool’s test task. The Selenium documentation lists mvn clean test for Maven and gradle clean test for Gradle. A standalone Java example can also be launched using the Maven exec command documented in Selenium’s first script guide.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Do you need to install ChromeDriver or another driver?
Usually not for a basic, supported local setup. Selenium Manager has shipped with Selenium since version 4.6.0 and is invoked by language bindings when a driver has not been supplied. Selenium Manager added managed browser discovery, download, and caching in Selenium 4.11.0. In that mode, its documentation covers Chrome, Firefox, and Edge.
That automatic path is not universal. The Selenium Manager documentation lists Linux arm64/aarch64, 32-bit architectures, and Raspberry Pi among unsupported cases. Restricted networks, older Selenium versions, unusual architectures, or specialized deployment needs may also require a manually controlled driver strategy. Check the current Selenium Manager documentation and driver location guidance for your environment and browser compatibility.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
If you manage a driver manually, make sure it is compatible with the installed browser and available in the test environment. Avoid hard-coding a machine-specific driver path in shared test code unless the deployment environment requires it; a fixed path makes the project less portable.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Run locally or use Selenium Grid?
Use the language’s ordinary test runner for a small project or a suite that can run on one machine. Grid becomes useful when tests need to execute across multiple browsers, operating systems, or machines, or when distributed parallel execution is part of the test environment.
Start a local standalone Grid
The Grid quick start requires Java 11 or higher, the Selenium Server JAR, and browsers with drivers available directly or through Selenium Manager configuration. After obtaining the server JAR for the Selenium version you intend to use:
- Start the standalone server:
java -jar selenium-server-<version>.jar standalone. - Configure the test to use the remote endpoint
http://localhost:4444instead of starting a local browser driver directly. - Run the test with the same test runner or build task used for local tests.
Grid setup and configuration details are in the official Grid getting started guide. For a single local browser test, Grid adds infrastructure without being necessary.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Troubleshoot common setup problems
- Python cannot import Selenium: the package may have been installed outside the active virtual environment. Activate the environment and run
python -m pip install seleniumwith the same Python interpreter used to run pytest. - Browser or driver cannot be found: confirm that the browser is installed and that the Selenium version and platform are supported by the chosen driver-management path. Check Selenium Manager output and the official driver location guidance before adding a machine-specific path.
- Driver and browser versions are incompatible: update or select a compatible driver/browser combination. If you pin or manage drivers yourself, keep that compatibility coordinated in local and CI environments.
- Automatic driver setup fails on a restricted network or unsupported architecture: check Selenium Manager’s platform and network constraints; select an explicitly managed compatible driver if automatic discovery or download cannot work in that environment.
- The test leaves browser processes running: ensure the test calls
driver.quit()in cleanup code, including when an assertion or browser action fails. - Grid tests cannot connect: check that the server started successfully, that the configured remote URL matches the running endpoint, and that the server and test environment have the required Java and browser/driver setup.
Performance, reliability, and cost considerations
Local execution avoids Grid’s additional server and network layer and is the simplest place to develop a test. Grid is a scaling option for distributed runs, but requires maintaining the server and browser-capable nodes. Selenium itself is browser automation software; if you use it for web scraping, a site’s terms may prohibit it or its defenses may block automated access. The Selenium Project notes this caveat in its WebDriver documentation.
For reliability, keep dependencies in the project build, use cleanup that closes sessions, and verify browser/driver compatibility in the same environment where tests run. Browser versions, package versions, runtime requirements, and Grid options evolve, so check the linked Selenium documentation when changing or provisioning an environment.
Or skip the browser setup
If your goal is to capture a website rather than interactively test it, ScreenshotNeo is a screenshot API and MCP server for developers. One GET request can return a PNG, JPEG, WebP, or PDF. For example, using the documented cURL pattern with the target URL set to https://example.com:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
See the ScreenshotNeo API documentation for setup and options. It accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents using Claude, Cursor, or another MCP client. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots.
Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.
Frequently Asked Questions
Can Selenium run without a graphical browser window?
Yes. Configure the target browser for headless operation when your test environment supports it; this changes how the browser runs, not the need for a Selenium binding and WebDriver session.
Can I use Selenium for web scraping?
Selenium can automate browser interactions, but a site may prohibit scraping in its terms or block automated traffic. Check the site’s rules before doing so.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

