Welcome to the Selenium Automation Demo Project! This project serves as hands-on demonstration of Selenium, an open-source automation testing framework widely used for web applications. Whether you're a beginner looking to explore the basics or an experienced tester aiming to enhance your Selenium skills, this project provides a practical guide to automation testing.
Application under test: https://www.saucedemo.com/ website.
- Project Demonstates
- Tech Stack
- Project Folder Structure
- Framework
- Project Setup
- Run Locally
- Execution Report
- About Me
- The execution of test cases on multiple browsers.
- Use of testng framework
- Achieve Page Object Model design pattern using pageFactory
- Maven project
- Sington design pattern implementation
- Reading data in multiple ways
- via .properties file
- from @DataProvider method
- from added in testng.xml
- Running test cases
- single test class
- multiple test classes by added under testng.xml
- using maven surefire plugin
- Integration of Listerners provided by testng
- Integration of Logger
- Execution report using Extent Report
Language: Java 17
UI Automation library: Selenium (4.11.0)
Testing framework library: testNg (7.8.0)
Page object repository: PageFactory
Automation Framework: Hybrid
Project Building Tool: Maven 3.8.0
Reporting: Extent Report (5.1.1)
Test data/Configuration data: .properties file
Assertion framework: hamcrest-all (1.3)
Logger: slf4j-api with slf4j-simple as binder
Listerner: testNg Listerners
It has 3 source folders
1. src/main/java - contains all code except test cases
2. src/test/java - contains test case classes
3. src/test/resource - contails configurations, test data related files
Here is a screenshot:
Used testNg and POM results in hybrid Framework It has following components:
1. Test Base
2. Page Object Repository
3. Test Cases
4. Test Data
5. Configurations
6. Utilities
7. Report
Here is a framework flow diagram
To run the test scenarios, need to have followings on your machine:
1. Java 17
2. Maven 3.8.5
3. Any IDE (Eclipse/IntelliJ)
-
Clone the project
Go to the folder location where you want to keep local copy of the project
git clone https://github.com/swatinerkar/selenium-testng-demo-project
-
Import the project as Maven project in any IDE (Eclipse/IntelliJ)
-
- right click on testng.xml
- Run as -> TestNG suite
-
- Right click on POM.xml file
- Run as -> Maven test
-
- Go to Run on Toolbar
- Run configuration
- Select workplace, and add goals as 'test'
- Click Apply and Run
-
Once the Execution is done, the report is available under Reports folder
-
If any test case fails, it will take the screen shot and attach it to the execution report.
I'm a Software Automation Tester, having 11+ years of experience.
Please have a look on my Portfolio: @swatinerkar
My LinkedIn Profile: @swatinerkar
If you would like to have some guidence, you can book any of my service: @swatinerkar