Getting started with Allure Selenide
Generate beautiful HTML reports using Allure Report and your Selenide tests.
Setting up
Allure Selenide works alongside your test framework — set up JUnit 5 or TestNG first, then add the steps below.
This integration targets Selenide 7.x and requires Java 17 or newer.
To integrate Allure Selenide into your project, you need to:
- Add Allure Selenide dependencies.
- Register the listener.
- Specify a location for Allure results storage.
Add Allure dependencies
<!-- Define the version of Allure you want to use via the allure.version property -->
<properties>
<allure.version>VERSION</allure.version>
</properties>
<!-- Add allure-bom to dependency management to ensure correct versions of all the dependencies are used -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-bom</artifactId>
<version>${allure.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<!-- Add necessary Allure dependencies to dependencies section -->
<dependencies>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-selenide</artifactId>
<scope>test</scope>
</dependency>
</dependencies>val allureVersion = "VERSION"
dependencies {
testImplementation(platform("io.qameta.allure:allure-bom:$allureVersion"))
testImplementation("io.qameta.allure:allure-selenide")
}def allureVersion = "VERSION"
dependencies {
testImplementation platform("io.qameta.allure:allure-bom:$allureVersion")
testImplementation "io.qameta.allure:allure-selenide"
}Register the listener
Register AllureSelenide as a Selenide listener before any browser actions run. The listener name ("allure") is an identifier used by Selenide's listener registry and can be any string, as long as it is unique among registered listeners.
import com.codeborne.selenide.logevents.SelenideLogger;
import io.qameta.allure.selenide.AllureSelenide;
SelenideLogger.addListener("allure", new AllureSelenide());Register it once before your tests start — for example, in a JUnit 5 @BeforeAll, a TestNG @BeforeSuite, or a shared setup class:
@BeforeAll
static void setUpAllure() {
SelenideLogger.addListener("allure", new AllureSelenide());
}Steps and artifacts are only recorded when there is an active Allure test context. Selenide actions that run outside of a test — for example, in a static initializer or before the test framework starts a test — are silently ignored.
Specify Allure results location
Allure saves test results in the project's root directory by default. It is recommended to store results in the build output directory instead.
Create an allure.properties file in src/test/resources:
allure.results.directory=target/allure-resultsallure.results.directory=build/allure-resultsallure.results.directory=build/allure-resultsGenerate a report
After running your tests, convert the results into an HTML report using one of these commands:
allure generateprocesses the test results and saves an HTML report into theallure-reportdirectory. To view the report, use theallure opencommand.allure servecreates the same report asallure generate, then automatically opens the main page of the report in a web browser.
Selenide actions as steps
Once the listener is registered, Allure Selenide records every Selenide log event as a step in the test report. No additional code is required.
Step names are generated from Selenide's log events and include the element locator, action name, and any arguments. The exact format is determined by Selenide. A failed step gets FAILED status when the underlying exception is an assertion error, or BROKEN for any other exception.
Steps are nested under any enclosing Allure steps you define:
Allure.step("Log in", () -> {
$("#email").setValue("[email protected]"); // appears as a sub-step of "Log in"
$("#password").setValue("secret");
$(".login-btn").click();
});By default, all Selenide log events are recorded as steps. To exclude Selenide's built-in element interaction steps (those of type SelenideLog) from the report, set .includeSelenideSteps(false) when registering the listener. Screenshots, page source, and browser logs are still captured on failure even when steps are excluded, and are attached to the enclosing Allure step or test. See configuration for details.
Capturing artifacts on failure
By default, when a Selenide step fails, Allure Selenide automatically captures artifacts and attaches them to that step in the report.
By default, the following are captured:
- Screenshot — a PNG image of the current browser state (
image/png), attached with the nameScreenshot. - Page source — the current HTML of the page (
text/html), attached with the namePage source.
By default, these are attached to the failing step rather than to the overall test result.
If the browser is not open at the time of failure — for example, when a step fails before the browser launches — no screenshot or page source is captured, and the step is still recorded with its failure status.
To disable either artifact, configure the listener when registering it:
SelenideLogger.addListener("allure", new AllureSelenide()
.screenshots(false)
.savePageSource(false));See configuration for all available options.
Browser logs
Allure Selenide can capture Selenium WebDriver browser logs and attach them to a failing step. Log capture is disabled by default and must be enabled explicitly for each log type you want to collect.
import io.qameta.allure.selenide.LogType;
import java.util.logging.Level;
SelenideLogger.addListener("allure", new AllureSelenide()
.enableLogs(LogType.BROWSER, Level.SEVERE));Multiple log types can be enabled at once:
SelenideLogger.addListener("allure", new AllureSelenide()
.enableLogs(LogType.BROWSER, Level.ALL)
.enableLogs(LogType.PERFORMANCE, Level.ALL));Each enabled log type produces a separate attachment named Logs from: <type> (for example, Logs from: browser). When steps are included (the default), the attachment is added to the failing Selenide step. When includeSelenideSteps(false) is set, it is attached to the enclosing Allure step or test instead.
Available LogType values correspond to Selenium's built-in log types: BROWSER, CLIENT, DRIVER, PERFORMANCE, PROFILER, and SERVER. Not all browsers support all log types — check your browser's WebDriver documentation for what is available.
Environment information
To add environment details (OS, Java version, browser, Selenide version) to the main report page, see Environment file.