Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →To use Selenium with IntelliJ IDEA, create a Java project with Maven or Gradle, add Selenium’s Java library, choose JUnit or TestNG, and run a browser test from the IDE. Selenium controls the browser through WebDriver; IntelliJ provides the project, test-running, and debugging tools. You still need a JDK and a browser, and the browser driver must be resolvable for your environment.
What you need before you start
- A JDK: Choose a Java version supported by your project and the Selenium version you intend to use.
- A browser: Install the browser you want your tests to control, such as Chrome.
- IntelliJ IDEA: JetBrains documents a Selenium project wizard. Most Selenium-specific IDE features rely on the Test Automation plugin, although basic test execution and debugging work without it. JetBrains states in its IntelliJ IDEA 2026.2 Selenium help that “Selenium support in IntelliJ IDEA is provided by the Test Automation plugin, and most of the features described in this section rely on it.”
- A build tool and test framework: Use the Maven or Gradle convention already in your project and a test framework such as JUnit or TestNG.
WebDriver is the browser-control interface; Selenium’s Java binding, the browser, and the browser-specific driver are separate parts of the setup. Selenium can resolve browser drivers for supported configurations, but browser and driver compatibility can change. Consult the current Selenium and browser-vendor documentation if a particular environment cannot start a session. See Selenium’s WebDriver getting-started guide.
| # | Preview | Product | Price | |
|---|---|---|---|---|
| 1 |
|
INTELLIJ IDEA KEYBOARD LABELS | $9.76 | Buy on Amazon |
| 2 |
|
INTELLIJ IDEA NEW Keyboard Labels Shortcuts | $9.76 | Buy on Amazon |
| 3 |
|
INTELLIJ IDEA KEYBOARD STICKERS SHORTCUTS | $7.96 | Buy on Amazon |
| 4 |
|
INTELLIJ IDEA NEW KEYBOARD STICKERS SHORTCUTS | $7.96 | Buy on Amazon |
As an Amazon Associate I earn from qualifying purchases.
Create a Selenium project in IntelliJ IDEA
- Open File | New | Project.
- Select Selenium and choose Java.
- Choose Maven or Gradle, then select JUnit or TestNG.
- Select an existing JDK or download one when prompted. Confirm that the selected Java version fits the project’s build configuration.
- Choose a Selenium version in the wizard and create the project. IntelliJ’s wizard adds the requested dependencies; inspect the generated build file before running tests.
If the project already exists, do not replace its build tool or test framework just to follow the wizard. Add Selenium to the correct module and retain the repository’s established conventions.
Add Selenium to a Maven project
For Maven, Selenium’s Java binding is the org.seleniumhq.selenium:selenium-java artifact. Add it to the project’s pom.xml dependencies, alongside your test framework dependency if it is not already present. For example, the Selenium Java installation guide currently shows Selenium 4.49.0 and compiler source/target 17; those are documentation example values, not universal minimum requirements. Check the current compatibility requirements and your project’s Java constraints before selecting versions.
#1 Best Overall
- The Best GIFT for any occasion
- High-quality stickers for different keyboards Desktop, Laptop and Notebook
- The Intellij IDEA stickers can easily transform your standard keyboard into a customised one within minutes, depending on your own need and preference.
- Stickers are made of high-quality non-transparent - matt vinyl, thickness - 80mkn, typographical method.
- The Intellij IDEA keyboard stickers are designed to improve your productivity and to enjoy your work all the way through.
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.49.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.12.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
The Selenium and Java values above reflect the example in Selenium’s Java installation documentation. The JUnit coordinates are a representative dependency declaration; align the framework version and test setup with the project’s requirements. After editing the file, use IntelliJ’s Maven tool window to reload the project or accept the Maven import prompt.
Pay particular attention to the Java version: IntelliJ’s Maven documentation says the Java version configured in pom.xml overrides the Maven importer JDK setting. Check both if compilation works in one context but fails in another. See JetBrains’ Maven support documentation.
Write and run a first browser test
This JUnit 5 example starts Chrome, opens Selenium’s sample web form, checks the page title, and closes the browser even if the assertion fails. Save it under src/test/java in a Maven project with the dependencies shown above.
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 →Rank #2
- The Best GIFT for any occasion
- High-quality stickers for different keyboards Desktop, Laptop and Notebook
- The Intellij IDEA stickers can easily transform your standard keyboard into a customised one within minutes, depending on your own need and preference.
- Stickers are made of high-quality non-transparent - matt vinyl, thickness - 80mkn, typographical method.
- The Intellij IDEA keyboard stickers are designed to improve your productivity and to enjoy your work all the way through.
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
class FirstSeleniumTest {
private WebDriver driver;
@BeforeEach
void setUp() {
driver = new ChromeDriver();
}
@Test
void opensTheSampleForm() {
driver.get("https://www.selenium.dev/selenium/web/web-form.html");
assertEquals("Web form", driver.getTitle());
}
@AfterEach
void tearDown() {
if (driver != null) {
driver.quit();
}
}
}
On an initial run, driver setup can take longer while required drivers are downloaded and verified. Selenium’s first-script guide illustrates browser startup and test lifecycle patterns. Closing the driver with quit() ends the session and releases its browser process.
- Wait for IntelliJ to finish importing Maven dependencies.
- Click the Run icon in the gutter beside the test class or method, or place the caret in the test and use the IDE’s run action.
- Read the result in the Run/Test Runner window. If startup fails, inspect the exception there before changing dependencies or browser settings.
- To debug, set a breakpoint in the test and launch it with Debug rather than Run.
For command-line or CI confirmation, run the project through its build tool as well as the IDE. IntelliJ also supports delegating Maven test execution to Maven; see its Maven support guide.
Choose Maven or Gradle, JUnit or TestNG
| Choice | What it changes | Practical approach |
|---|---|---|
| Maven or Gradle | Dependency and build configuration, along with how tests are run. | Keep the build tool already used by the repository. IntelliJ’s Selenium wizard supports both. |
| JUnit or TestNG | The test framework and its test organization and execution features. | Prefer the framework the team already uses. Selenium describes JUnit as widely used for Java Selenium tests and notes TestNG’s parallel-execution and parameterized-test features; choose TestNG when those capabilities are a concrete fit. |
| IDE run or build-tool run | IDE execution is convenient for focused authoring and debugging; a build-tool run helps verify the project outside the IDE. | Use the IDE as you develop, then confirm the same test suite through Maven or Gradle for a repeatable project workflow. |
Neither Maven nor a particular test framework is required by Selenium itself. The wizard offers common combinations, but the application’s existing build and CI setup is usually the deciding factor. See Selenium’s test organization guidance for practices around independent tests.
Rank #3
- The Best GIFT for any occasion
- High-quality stickers for different keyboards Desktop, Laptop and Notebook
- The Intellij IDEA stickers can easily transform your standard keyboard into a customised one within minutes, depending on your own need and preference.
- Stickers are made of high-quality non-transparent - matt vinyl, thickness - 80mkn, typographical method.
- The Intellij IDEA keyboard stickers are designed to improve your productivity and to enjoy your work all the way through.
Handle page readiness without fragile sleeps
A test can start successfully and still fail because it checks an element before the page has finished updating. Avoid using fixed sleeps as the normal readiness strategy: they waste time when the page is fast and may still be too short when it is slow. Prefer a condition-based wait for the element or state the test needs, following Selenium’s current wait guidance. Keep each test’s browser session isolated and close it after the test so failures do not leave browser processes running.
Troubleshoot common IntelliJ and Selenium problems
| Symptom | Likely cause | What to check |
|---|---|---|
Imports such as org.openqa.selenium are unresolved |
The Selenium dependency is missing, declared in another module, or the build project has not refreshed. | Confirm selenium-java is in the relevant Maven or Gradle module, then reload or sync the build project. Check the build tool’s output for dependency-resolution errors. |
| IntelliJ does not recognize the class as a test | The test framework dependency, test source location, or selected JDK may be wrong. | Verify the test framework dependency, place the class in the configured test source set (such as Maven’s src/test/java), and check the project SDK and test-run output. Try the gutter Run control on the test method. |
| The test compiles in the IDE but Maven compilation fails | The JDK used by Maven or compiler level in the POM differs from the IDE’s project SDK. | Inspect the Java compiler settings in pom.xml and IntelliJ’s Maven importer JDK. The POM’s Java version takes precedence for Maven compilation. |
| Chrome fails to start or a session cannot be created | The browser is missing, the driver cannot be resolved, or the browser/driver combination is incompatible. | Confirm the browser is installed and inspect the complete startup exception. Check current Selenium and browser-vendor documentation for driver resolution and version-specific requirements rather than assuming an old driver setup still applies. |
| The first run pauses during startup | Necessary browser-driver components may be downloading or being verified. | Allow the initial setup to complete, then check whether later runs behave differently before treating the delay as a test failure. |
| The test passes intermittently around navigation or element checks | The test may depend on timing or shared browser state. | Wait for a meaningful page condition instead of a fixed delay, avoid sharing a session between tests, and quit the driver in teardown. |
Or skip the browser setup
If your goal is to save a page image or PDF rather than automate an interactive test, ScreenshotNeo offers a website screenshot API and MCP server. A single GET request can return an image or PDF; for example, the cURL request below 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
ScreenshotNeo accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.
Sign up for ScreenshotNeo free: 1,000 screenshots a month, no card required.
Frequently Asked Questions
Can I use Selenium with IntelliJ IDEA Community Edition?
Basic test execution and debugging work without IntelliJ’s Test Automation plugin, though most Selenium-specific IDE features rely on that plugin.
Does Selenium require ChromeDriver to be installed manually?
Not necessarily. Driver resolution can be handled by Selenium for supported setups, but the browser must be installed and environment-specific startup failures may require checking current Selenium and browser-vendor guidance.
Can I use ScreenshotNeo instead of Selenium for browser tests?
No. ScreenshotNeo captures pages as images or PDFs; Selenium automates browser interactions and is appropriate for tests that need to click, type, or verify behavior.
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.




