Skip to main content

Selenium with Serenity

To run your Selenium tests with Serenity and Cucumber, follow this guide:

Prerequisites

  • Java version 8 or above
  • IntelliJ IDE
  • Gradle latest version
  1. Clone a starter project.

    1. Clone starter project from the GitHub repository.
    2. Set the project SDK to Java 8 or above.
  2. Add Web Driver capabilities and Continuous Testing special capabilities. All the capabilities are added to the serenity.properties file.

    info

    In order to run the test, set your access key:

    info

    Replace <server> with the appropriate URL.

    // Web driver capabilities
    webdriver.remote.url = <server>/wd/hub
    webdriver.browserType = chrome

    // Continuous testing capabilities
    webdriver.accessKey = <YOUR_ACCESS_KEY>
    webdriver.agentName = Agent_1
    webdriver.osName = Mac OS Monterey
    webdriver.generateReport = true
    webdriver.reportType = video
  3. Run your Test. In the IDE terminal make sure you are in the folder with build.gradle file and run: gradlew clean test