What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

If Eclipse reports that org.openqa.selenium or org.openqa.selenium.WebDriver cannot be resolved, Selenium’s Java binding is missing from the project’s compile classpath or Eclipse has not synchronized the build configuration. Add org.seleniumhq.selenium:selenium-java with Maven or Gradle, refresh the project, and confirm Eclipse has a configured JDK or JRE. A missing browser driver is a separate runtime issue; it does not cause the Java import itself to be unresolved.

What the import error means

Java must be able to find the Selenium classes while compiling your source. The import org.openqa.selenium.WebDriver fails when the Selenium Java binding is not on that project’s compile classpath, or when the IDE’s classpath view is stale or misconfigured. Installing a browser or downloading ChromeDriver alone does not add Selenium’s Java library to Eclipse.

First identify the stage of the failure:

  • Compile-time error: Eclipse marks the import as unresolved, or Maven reports that package org.openqa.selenium does not exist. Fix the project dependency and classpath.
  • Runtime browser-startup error: The code compiles, but a WebDriver session cannot start because the browser, driver, or browser-driver configuration is unavailable. Diagnose that after imports compile.

Selenium’s Java installation guidance recommends using a build tool to install the libraries. Maven or Gradle is generally more reproducible than adding a collection of JAR files only to one Eclipse workspace.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Identify how the Eclipse project is built

Look in the project root before changing settings. The build file determines where the dependency belongs:

  • pom.xml: use Maven.
  • build.gradle or build.gradle.kts: use Gradle.
  • No build file: this may be a plain Java project with libraries configured directly in Eclipse.

Prefer the build-file path when one exists. Adding Selenium through Eclipse’s Java Build Path on top of Maven or Gradle can create duplicate or mismatched libraries, and local-only settings may not be present for teammates or on another machine.

Fix a Maven project

1. Add Selenium Java to pom.xml

Place the dependency inside the existing <dependencies> element. Use a Selenium version that your project intentionally selects; the property below is an example placeholder that must be defined elsewhere in the POM or replaced with a chosen version.

<dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-java</artifactId>
  <version>${selenium.version}</version>
</dependency>

If the project does not define selenium.version, Maven will not know what version to resolve. Define that property in the POM, or use a concrete version chosen for the project. Avoid combining Selenium components from different versions through manually copied JARs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Make Eclipse synchronize the dependency

  1. Save pom.xml.
  2. In Eclipse, update the Maven project using the Maven update action available in your installation, or run a Maven build from the project.
  3. Wait for dependency resolution to finish. In Project Explorer, confirm that Maven Dependencies is present and that the project no longer shows the unresolved import marker.
  4. If stale errors remain, use Project > Clean, select the affected project, and rebuild.

Apache Maven’s Eclipse guidance explains that Eclipse’s classpath is synchronized from the current Maven dependencies and that the project should be refreshed after dependency changes. Saving the POM alone does not guarantee that Eclipse has updated its classpath.

3. Check resolution from the command line

Run these commands from the directory containing pom.xml:

Rank #2
Sale
Eclipse
  • Used Book in Good Condition
mvn dependency:tree
mvn test-compile

dependency:tree helps confirm that Maven resolved Selenium and its transitive dependencies. test-compile checks test sources as well as main sources, which matters when Selenium is declared only for tests. If Maven cannot download the artifact, inspect the configured repository and proxy, then verify that the selected dependency version is valid. Fix Maven resolution before trying to repair Eclipse’s editor markers.

Fix a Gradle project

Declare Selenium in the Gradle build file rather than adding Maven dependencies manually. For a Groovy build.gradle file, a typical test dependency is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
dependencies {
    testImplementation "org.seleniumhq.selenium:selenium-java:${seleniumVersion}"
}

Ensure seleniumVersion is defined in the build configuration. The testImplementation configuration makes the library available to test code; if Selenium imports are in application source rather than tests, use the configuration appropriate to that source set, such as implementation.

Save the build file, refresh or reimport the Gradle project using Eclipse’s Gradle tooling, and wait for dependency resolution. Confirm the Gradle dependency container appears in Project Explorer. If Gradle itself cannot resolve the artifact, check repository configuration, proxy access, and the version before troubleshooting Eclipse’s classpath.

Fix a plain Java project without Maven or Gradle

For a project without a build tool, Selenium and its required dependencies must be added to the project’s build path. In Eclipse, open Project > Properties > Java Build Path > Libraries, choose Add External JARs, and select the required library files. A user library is another way to group libraries in Eclipse.

This route requires you to manage the complete compatible set of Selenium JARs and dependencies yourself, including updates and consistency across machines. A build file records dependencies in the project and lets the build tool resolve transitive libraries, so consider converting a plain project if repeatable setup matters.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If the project contains module-info.java, it is a Java Platform Module System (JPMS) project. A classpath-only change may not be enough: module-path placement and module declarations can affect visibility. Treat module configuration as a separate issue rather than assuming that adding JARs to the classpath will resolve every module-related message.

Check Eclipse’s Java runtime and project settings

Selenium dependencies will not compile correctly if Eclipse’s Java configuration is missing or invalid. Verify both the installed runtime and the project-specific settings:

  1. Open Eclipse’s installed JRE settings and confirm that a valid JDK or JRE is configured.
  2. Check the project’s Java compiler settings and confirm the project uses an installed, compatible Java configuration.
  3. Inspect the project’s Java Build Path for the expected Maven Dependencies or Gradle container, or for the libraries you deliberately added to a plain project.

Eclipse’s Java preparation guidance calls for verifying the JRE installation and classpath variables. If the project is configured against a runtime that no longer exists, correct that configuration and rebuild before changing Selenium imports.

Refresh the project in the right order

After changing dependencies, use this sequence so the build file and Eclipse view agree:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Save the POM or Gradle build file.
  2. Update or refresh the Maven or Gradle project from Eclipse.
  3. Wait for the dependency container to finish resolving.
  4. Use Project > Clean if old error markers remain.
  5. Refresh the project, then reopen the source file and check the import again.

For Maven, verify that Maven Dependencies appears in Project Explorer. For Gradle, confirm the project’s Gradle dependency container is present. If the dependencies are absent there, the problem is synchronization or resolution, not the spelling of the Java import.

Keep compile errors separate from browser-driver errors

The import org.openqa.selenium.WebDriver is resolved before Java attempts to launch a browser. If that import does not compile, installing ChromeDriver or changing the system PATH will not repair it.

Once imports compile, a different error may appear when creating a browser session. Selenium’s getting-started guidance treats the language binding, browser, and browser driver as separate setup pieces. Selenium 4.6 and later can use Selenium Manager to obtain drivers. Other options are to put a manually downloaded driver on PATH or configure its location explicitly. A message that a driver executable cannot be found belongs to this runtime setup stage, not the dependency-import stage.

Troubleshoot by symptom

Symptom Likely cause What to check
org.openqa.selenium cannot be resolved in the editor Selenium is missing from the project compile classpath, or Eclipse has not synchronized the build file. Confirm the dependency is in the correct POM or Gradle configuration, refresh the project, and inspect the dependency container.
package org.openqa.selenium does not exist during compilation The build tool did not resolve Selenium for the source set being compiled. Run mvn dependency:tree and mvn test-compile, or refresh Gradle and check whether Selenium is declared as a test or application dependency as appropriate.
Maven cannot download Selenium Repository access, proxy configuration, or the selected version may be wrong. Check Maven’s repository and proxy settings and verify the dependency version; do not work around an unresolved artifact with an unrelated set of JAR versions.
Dependency appears in the build file but not Eclipse The IDE’s build-tool model is stale or the dependency resolution has not completed. Update the Maven project or refresh the Gradle project, wait for resolution, then clean and rebuild if markers remain.
Build path references a missing JRE or JDK The project or workspace is configured for a Java installation that Eclipse cannot find. Configure an installed JDK/JRE in Eclipse and select it for the project, then rebuild.
Imports compile, but the browser session fails to start The issue is now runtime setup: browser availability, driver discovery, or browser-driver compatibility. Use Selenium Manager where applicable, or check PATH or the explicit driver location. Do not keep changing the Selenium import dependency unless the build reports a dependency problem.
Session starts but actions fail intermittently Timing or synchronization may be inadequate, or a browser-driver issue may be involved. Use an explicit wait while diagnosing the page condition and compare behavior in another browser to isolate a browser-specific problem.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

After imports compile: improve runtime reliability

Selenium’s troubleshooting documentation identifies poor synchronization as its most common Selenium-related error and also notes that underlying browser-driver problems can cause failures. When the import is fixed but an element action fails intermittently, wait for the specific page condition rather than assuming the dependency remains broken. Comparing the same flow in another browser can help distinguish a general timing problem from a browser- or driver-specific one.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep these checks in order: confirm compilation, confirm that the browser session starts, then diagnose page timing or browser-specific behavior. That ordering avoids spending time reinstalling Selenium libraries when the failure has moved to a later stage.

Or skip the browser setup

If your goal is simply to capture a website screenshot rather than exercise browser interactions with Selenium, ScreenshotNeo provides a screenshot API and MCP server for developers. This is not a replacement for Selenium when you need to automate browser actions; it is a simpler option when the deliverable is a screenshot or PDF. Its capture flow can accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets before the shot. Each of those steps can be turned off.

One GET request returns an image or PDF. The following cURL example saves a WebP screenshot; see the ScreenshotNeo API documentation for request options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; responses include X-Page-Verdict and X-Billed headers. An MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients. The free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.

Frequently Asked Questions

What dependency provides org.openqa.selenium.WebDriver?

The Selenium Java binding, published as org.seleniumhq.selenium:selenium-java.

Does fixing this import error install ChromeDriver?

No. The dependency resolves Selenium classes for compilation; browser-driver discovery is a separate runtime concern.

Quick Recap

SaleBestseller No. 2
Eclipse
Eclipse
Used Book in Good Condition
$25.99
Bestseller No. 3
Bestseller No. 4

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.