Selenium-Jupiter: A JUnit 5 extension for Selenium WebDriver

Boni García,Carlos Delgado Kloos,Carlos Alario-Hoyos,Mario Munoz-Organero
DOI: https://doi.org/10.1016/j.jss.2022.111298
2024-02-01
Abstract:Selenium WebDriver is a library that allows controlling web browsers (e.g., Chrome, Firefox, etc.) programmatically. It provides a cross-browser programming interface in several languages used primarily to implement end-to-end tests for web applications. JUnit is a popular unit testing framework for Java. Its latest version (i.e., JUnit 5) provides a programming and extension model called Jupiter. This paper presents Selenium-Jupiter, an open-source JUnit 5 extension for Selenium WebDriver. Selenium-Jupiter aims to ease the development of Selenium WebDriver tests thanks to an automated driver management process implemented in conjunction with the Jupiter parameter resolution mechanism. Moreover, Selenium-Jupiter provides seamless integration with Docker, allowing the use of different web browsers in Docker containers out of the box. This feature enables cross-browser testing, load testing, and troubleshooting (e.g., configurable session recordings). This paper presents an example case in which Selenium-Jupiter is used to evaluate the performance of video conferencing systems based on WebRTC. This example case shows that Selenium-Jupiter can build and maintain the required infrastructure for complex tests effortlessly.
Other Computer Science
What problem does this paper attempt to address?
The paper mainly addresses the following issues: 1. **Automated Driver Management**: To solve the problem of increased development and maintenance costs as well as test unreliability (flakiness) caused by manual management of browser drivers (such as chromedriver, geckodriver, etc.) in Selenium WebDriver, the author proposes a fully automated driver management process. 2. **End-to-End Testing Difficulty**: To address the difficulty of implementing specific types of end-to-end tests (such as load testing) on Selenium WebDriver, the author integrates Docker technology to provide an automated infrastructure management solution, facilitating cross-browser testing, mobile application testing, and performance testing. 3. **Troubleshooting**: To simplify the fault analysis process in Selenium WebDriver testing, the author introduces the concept of observability, utilizing the Jupiter extension model to monitor failed tests and enhancing troubleshooting capabilities by collecting data (such as session recordings and screenshots) through configured Docker containers. In summary, this paper aims to provide a Selenium WebDriver testing extension framework based on JUnit 5 through the open-source project Selenium-Jupiter, to simplify the development process of end-to-end testing, reduce maintenance costs, improve test reliability, and enhance troubleshooting capabilities.