⚙️ Installation — Java, Python, TypeScript
Installation — Java, Python, TypeScript: Setting up Selenium mirrors adding a Maven dependency in Java — but with an extra layer: your test code connects to a browser driver (Chr
Setting up Selenium mirrors adding a Maven dependency in Java — but with an extra layer: your test code connects to a browser driver (ChromeDriver), which in turn connects to the actual Chrome binary. Just like a JDBC driver bridges Java code to a database. But if you already have Java + Selenium working in your IDE, why do you still need to track the driver version? Because Chrome auto-updates every 4–6 weeks, and a mismatched ChromeDriver version throws "session not created: This version of ChromeDriver only supports Chrome version X", halting the entire CI pipeline. Selenium 4's Selenium Manager solves this automatically — like Gradle's dependency resolution, it fetches the compatible driver at runtime. Still, knowing the manual steps matters: in a locked-down production CI environment where Selenium Manager has no internet access, you must ship the driver as a project artifact and manage it yourself.
1️⃣ Java Selenium Setup
pom.xml — Maven Dependency
Micro Lab: Selenium — UI Actions
Replace the TODO line with the critical line from the expected solution. This is not a real runtime; the goal is to reinforce writing the correct structure in a controlled way.
Step by Step: How pom.xml Becomes a Jar File
The version is a CONTRACT
Writing `selenium-java 4.25.0` in pom.xml is not a wish, it is an exact demand — Maven will accept no other version.
Downloaded from Maven Central
Maven reads this request and pulls EXACTLY that version's jar from repo.maven.apache.org; if it already exists in the local `.m2` cache, it skips the download.
Added to the classpath
The downloaded jar is added to the project classpath — from this point on, the compiler and IDE RECOGNIZE the `org.openqa.selenium` package.
The SAME result on every machine
When the same pom.xml runs on another machine or CI agent, the identical version is fetched — this is the antidote to "it worked on my machine".