A TestNG-based UI testing framework for SDET training. Demonstrates TestNG annotations, parallel testing, cross-browser testing, logging with Log4j2, and structured reporting. Designed to help students strengthen automation testing skills with practical examples and configuration.
git clone https://github.com/cihat-kose/testng-practice-lessons.gitTestNG Practice Lessons is a Java-based training framework designed to help SDET students strengthen automation testing skills through practical, hands-on examples. It demonstrates core TestNG features including annotations, data providers, parallel execution, and cross-browser testing using Selenium WebDriver. The project integrates Log4j2 for comprehensive logging and generates HTML reports to track test results. Built with Maven for easy dependency management, it supports running tests via XML configuration files or directly from test classes, making it ideal for learning structured test automation practices and Page Object Model patterns.
Clone the repository and import it as a Maven project into IntelliJ IDEA or Eclipse. Ensure Java 11+ is installed. Run tests directly from XML files (e.g., cross-browser-test.xml) or test classes using your IDE's run functionality, or execute mvn test from the command line.
Learning TestNG annotations and test lifecycle management
Practicing parallel test execution across multiple browsers
Understanding data providers and parameterized testing
Implementing Page Object Model in UI automation
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/cihat-kose/testng-practice-lessonsCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Create a TestNG-based UI testing framework for [COMPANY] in the [INDUSTRY] sector. The framework should include TestNG annotations, parallel testing, cross-browser testing, logging with Log4j2, and structured reporting. Provide practical examples and configuration details for [DATA] to help students strengthen their automation testing skills.
# TestNG-Based UI Testing Framework for [COMPANY] in the [INDUSTRY] Sector
## Framework Overview
This framework is designed to help students strengthen their automation testing skills with practical examples and configuration. It includes the following features:
- **TestNG Annotations**: Utilizes TestNG annotations such as @BeforeMethod, @AfterMethod, @Test, and @DataProvider for structured test case management.
- **Parallel Testing**: Supports parallel test execution to improve test execution time and efficiency.
- **Cross-Browser Testing**: Enables testing across different browsers to ensure compatibility and robustness.
- **Logging with Log4j2**: Implements Log4j2 for comprehensive logging, making it easier to debug and track test execution.
- **Structured Reporting**: Generates detailed test reports for better analysis and reporting.
## Practical Examples
### Example 1: TestNG Annotations
```java
public class TestNGAnnotationsExample {
@BeforeMethod
public void setUp() {
System.out.println("Setting up the test environment");
}
@Test
public void testLogin() {
System.out.println("Executing login test");
}
@AfterMethod
public void tearDown() {
System.out.println("Cleaning up the test environment");
}
}
```
### Example 2: Parallel Testing
```java
public class ParallelTestingExample {
@Test(threadPoolSize = 3, invocationCount = 5, timeOut = 1000)
public void parallelTest() {
System.out.println("Executing parallel test");
}
}
```
## Configuration Details
### TestNG XML Configuration
```xml
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Test Suite" parallel="tests" thread-count="2">
<test name="Test 1">
<classes>
<class name="TestNGAnnotationsExample"/>
</classes>
</test>
<test name="Test 2">
<classes>
<class name="ParallelTestingExample"/>
</classes>
</test>
</suite>
```
### Log4j2 Configuration
```xml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
```Automate your browser workflows effortlessly
Get more done every day with Microsoft Teams – powered by AI
Automate security compliance and monitor real-time security posture seamlessly.
Automate your spreadsheet tasks with AI power
Agentic AI Workflow platform
Connected workspace for docs, wikis, and projects
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan