Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

How to Run Selenium Tests with Selenide, IntelliJ IDEA, and Maven

Set up Selenide in a Java Maven project, run a first browser test from IntelliJ IDEA or Maven, and learn when remote Selenium Grid needs extra configuration.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To run Selenium tests with Selenide, add the Selenide test dependency to a Java Maven project, write a test using Selenide’s browser and assertion APIs, then run it from IntelliJ IDEA or with Maven’s test lifecycle. Selenide is a Java UI-testing framework built on Selenium WebDriver 4.0 and later. The steps below start with a local test and show how to run it on Selenium Grid.

1. Create or open a Java Maven project

Use a Java project with a configured JDK and Maven. In IntelliJ IDEA, JetBrains’ Selenium project wizard lets you select Maven, choose a test framework, and select or add a JDK. The exact wizard labels can vary by IntelliJ IDEA version; the essential requirement is that the project uses a JDK and Maven.

As an Amazon Associate I earn from qualifying purchases.

Selenide can be used with JUnit, TestNG, Cucumber, ScalaTest, and JBehave. The example in this guide uses a JUnit-style @Test method. Make sure the test framework and its Maven dependencies match the test engine your project uses. The Selenide quick start’s dependency below is the framework dependency, not a complete setup for every test engine.

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

2. Add Selenide to Maven

Add this dependency inside the project’s <dependencies> element in pom.xml:

<dependency>
  <groupId>com.codeborne</groupId>
  <artifactId>selenide</artifactId>
  <version>7.18.2</version>
  <scope>test</scope>
</dependency>

Version 7.18.2 is the version shown on Selenide’s official quick-start page when this article was prepared; releases change, so check the current Selenide quick start before pinning a version. The test scope keeps Selenide out of the application’s runtime dependency set.

After editing the POM, reload Maven in IntelliJ so it resolves the dependency. If you do not already have a test framework configured, add the dependency and runner configuration appropriate for the framework selected for your project; do not assume adding Selenide alone configures every framework.

3. Write a first Selenide test

This example follows Selenide’s quick-start pattern. Replace the page URL, field names, selectors, and expected text with values from your own application:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import static com.codeborne.selenide.Selenide.*;
import static com.codeborne.selenide.Condition.*;

import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;

public class LoginTest {
  @Test
  public void userCanLoginByUsername() {
    open("/login");
    $(By.name("user.name")).setValue("johny");
    $("#submit").click();
    $(".loading_progress").should(disappear);
    $("#username").shouldHave(text("Hello, Johny!"));
  }
}

The imports show a JUnit Jupiter test. Ensure the project has the matching JUnit engine and Maven test-runner setup if it does not already. The Selenide quick-start sample illustrates the Selenide calls and assertions; use the test framework configured in your own project.

What the Selenide calls do

  • open("/login") opens a page. A relative path assumes a base URL is configured; otherwise use the full application URL.
  • $(By.name("user.name")) finds an element using a Selenium locator. Selenide also accepts CSS selectors such as $("#submit").
  • setValue enters text, and click activates the selected element.
  • should(disappear) and shouldHave(text(...)) assert browser state with Selenide conditions. These condition checks wait for the stated condition rather than relying on a fixed sleep in this example.

Prefer condition-based assertions for asynchronous page behavior: assert the state that matters, such as an element appearing, disappearing, or containing expected text. A fixed delay can be too short on a slow run and unnecessarily long on a fast one.

4. Run the test in IntelliJ IDEA or Maven

Run and debug from IntelliJ IDEA

  1. Open the test class in the editor.
  2. Click the gutter Run icon beside the test class or method and select the run action.
  3. Read the test outcome and output in the Run/Test Runner window. Use the gutter’s debug action to debug the test.

Basic test running and debugging work without JetBrains’ Test Automation plugin. JetBrains says most of its additional Selenium support features rely on that plugin; the IDE runner itself is not the same thing as Maven’s command-line test lifecycle.

Run the Maven test lifecycle

From the project directory, run:

mvn test

In IntelliJ, the equivalent Maven tool-window path is Maven > Lifecycle > test. IntelliJ can also delegate test execution to Maven, which is useful when you want IDE feedback while using the project’s Maven configuration.

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

Run one test with Maven

To target a single test class, use the Maven test selector with the class name:

mvn -Dtest=LoginTest test

The documented selector form is -Dtest=TestName test. If the command reports no matching tests, check that the class name matches and that the selected test framework is wired into Maven.

5. Choose local browser or Selenium Grid

A local browser is the simpler starting point: run the test on a machine with the browser and driver setup required by your environment. When tests need to execute against a shared or remote browser environment, Selenide’s FAQ documents remote WebDriver configuration through the selenide.remote property.

For example, pass the Grid endpoint as a JVM system property:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
mvn -Dselenide.remote=https://your.grid.com:5678/wd/hub test

Replace the example host and port with the endpoint supplied by your Grid provider. Selenide notes that most functions work with remote execution out of the box, but some features may require an integration dependency. Its FAQ specifically identifies file downloads as a case that may need com.codeborne:selenide-grid; do not assume every local-browser feature works remotely without additional setup.

Selenide also says tests can run on CI and points to Maven, Gradle, and Ant examples. A complete CI configuration depends on the CI system, browser environment, and test framework, so the local Maven command is the portable starting point rather than a full CI recipe.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

6. Troubleshoot common setup failures

  • Maven cannot resolve Selenide: confirm the dependency is inside <dependencies>, check the coordinates and version, then reload the Maven project. If the version is unavailable or stale, verify the current version on the official quick-start page.
  • IntelliJ does not offer a run action beside the test: confirm the file is in the test source tree and that the test framework dependency is present and recognized. Reload Maven and check the project SDK/JDK configuration.
  • mvn test finishes without running the test: verify the test class follows the naming conventions recognized by the Maven test runner, the test method uses the chosen framework’s annotation, and the framework engine is configured. To narrow the run, try mvn -Dtest=LoginTest test.
  • The test cannot find the page: check whether open uses a configured base URL. If not, pass a complete URL instead of a relative path, and confirm the application is reachable from the machine running the browser.
  • An element assertion times out: verify the selector against the rendered page and check that the expected state is actually reached. For remote runs, also confirm the Grid endpoint and browser session are available.
  • A remote-only feature fails: check whether the feature requires the com.codeborne:selenide-grid integration dependency; Selenide specifically notes file downloads as an example.

Or skip the browser setup

If your goal is a screenshot rather than an interactive Selenium test, ScreenshotNeo provides a website screenshot API and MCP server. A single GET request can return PNG, JPEG, WebP, or PDF output. For example, using cURL:

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

See the ScreenshotNeo API documentation for request options. Cookie banners and consent overlays, newsletter popups, and chat widgets are handled before capture and can be disabled individually. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed; response headers identify the page verdict and billing status. An MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents and MCP clients. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots.

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

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

Sources and version notes

Frequently Asked Questions

Can I use Selenide with TestNG instead of JUnit?

Yes. Selenide lists TestNG among the supported test-framework choices; configure the matching TestNG dependency and Maven runner for your project.

Does Selenide require the IntelliJ Test Automation plugin?

No. Basic run and debug actions work without it; JetBrains says most of the additional Selenium support features rely on the plugin.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.