Author: Anik Mitra
Email: [email protected]
This project is a Selenium-based Test Automation Framework built using Java and TestNG. It includes runtime browser selection, ExtentReports integration, element highlighting, and automatic screenshot capture during test execution.
- ✅ Browser Selection Prompt: Choose Chrome or Edge at runtime via terminal.
- ✅ Selenium WebDriver Integration using WebDriverManager.
- ✅ TestNG Framework for test management.
- ✅ ExtentReports with step logging and embedded screenshots.
- ✅ Dynamic Element Highlighting with red border and yellow background.
- ✅ Configurable properties via
config.properties.
- Java JDK 8 or above
- Maven
- Internet connection (for WebDriverManager to download browser drivers)
Extract the provided ZIP file.
Use any Java IDE (e.g., IntelliJ, Eclipse) or a code editor.
Run the test via TestNG. When prompted in the terminal, input your browser choice:
Choose browser (chrome/edge):
- Extent Report: Located at
test-output/ExtentReport.html - Screenshots: Captured per step in
test-output/screenshots/
automationtest/
├── pom.xml
├── src/
│ ├── main/
│ │ └── java/
│ │ └── utils/
│ │ └── DriverUtil.java
│ └── test/
│ └── java/
│ └── tests/
│ ├── AutomationTest.java
│ └── config.properties
├── test-output/
│ ├── ExtentReport.html
│ └── screenshots/
Scanner scanner = new Scanner(System.in);
System.out.println("Choose browser (chrome/edge): ");
String browser = scanner.nextLine().trim().toLowerCase();js.executeScript("arguments[0].style.border='3px solid red'; arguments[0].style.background='yellow'", element);TakesScreenshot ts = (TakesScreenshot) driver;
File source = ts.getScreenshotAs(OutputType.FILE);test.log(Status.INFO, "Action Description").addScreenCaptureFromPath(screenshotPath);- Name: Anik Mitra
- Email: [email protected]