Selenium Java Test Automation Architecture
Ready-to-use UI Test Automation Architecture using Java and Selenium WebDriver.
Installation Steps
In order to use the framework:
- Fork the repository.
- Clone, i.e, download your copy of the repository to your local machine using
git clone https://github.com/[your_username]/selenium-java-test-automation-architecture.git
- Import the project in IntelliJ IDEA.
- Make your desired changes.
- Use IntelliJ IDEA to run your desired tests. Alternatively, you can use the terminal to run the tests, for example
./gradlew test -Dbrowser=firefox -Dheadless=false
to run all the tests using the firefox browser in headful mode.
Languages and Frameworks
The project uses the following:
- Java 11 as the programming language.
- Selenium WebDriver as the web browser automation framework using the Java binding.
- WebDriverManager as the browser driver management library.
- Univocity Parsers to parse and handle CSV files.
- TestNG as the testing framework.
- AssertJ as the assertion library.
- Lombok to generate getters.
- Owner to minimize the code to handle properties file.
- Extent Reports as the test reporting strategy.
- Selenium Shutterbug for capturing screenshots.
- Gradle as the Java build tool.
- IntelliJ IDEA as the IDE.
Project Structure
The project is structured as follows:
📦 selenium-java-test-automation-architecture
├─ .github
│  └─ workflows
│     └─ test-execution.yml
├─ .gitignore
├─ LICENSE
├─ README.md
├─ build.gradle
├─ gradle
│  └─ wrapper
│     ├─ gradle-wrapper.jar
│     └─ gradle-wrapper.properties
├─ gradlew
├─ gradlew.bat
├─ script
│  └─ install_chrome.sh
├─ settings.gradle
└─ src
   ├─ main
   │  ├─ java
   │  │  └─ io
   │  │     └─ github
   │  │        └─ tahanima
   │  │           ├─ config
   │  │           │  ├─ Configuration.java
   │  │           │  ├─ ConfigurationManager.java
   │  │           │  └─ package-info.java
   │  │           ├─ data
   │  │           │  ├─ BaseTestData.java
   │  │           │  ├─ login
   │  │           │  │  └─ LoginTestData.java
   │  │           │  └─ package-info.java
   │  │           ├─ page
   │  │           │  ├─ BasePage.java
   │  │           │  ├─ BasePageFactory.java
   │  │           │  ├─ login
   │  │           │  │  └─ LoginPage.java
   │  │           │  ├─ package-info.java
   │  │           │  └─ product
   │  │           │     └─ ProductsPage.java
   │  │           ├─ report
   │  │           │  └─ ExtentReportManager.java
   │  │           └─ util
   │  │              ├─ BrowserFactory.java
   │  │              └─ DriverManager.java
   │  └─ resources
   │     └─ config.properties
   └─ test
      ├─ java
      │  └─ io
      │     └─ github
      │        └─ tahanima
      │           ├─ e2e
      │           │  ├─ BaseE2ETest.java
      │           │  └─ login
      │           │     └─ LoginE2ETest.java
      │           └─ util
      │              ├─ DataProviderUtils.java
      │              └─ TestListener.java
      └─ resources
         └─ testdata
            └─ login
               └─ login.csv