TravelTest Test Execution & Reporting

Business Scenario

Welcome to the QA Automation Team at TravelTest Pvt. Ltd.

The QA Manager has assigned you the task of executing Automated Test Suites and generating detailed Execution Reports for the TravelTest Automation Framework.

In this lab, you will execute TestNG Test Suites, generate TestNG Reports, analyze Test Execution Results, and track Failed Test Cases using Logs and Report Summaries to ensure efficient Test Monitoring and Debugging within the Automation Framework.

Pre-Lab Preparation

  • Configure Java, Maven, Selenium, and TestNG

  • Setup Eclipse/IntelliJ IDE

  • Add dependencies in pom.xml

  • Configure browser drivers

  • Understand TestNG annotations and testng.xml

  • Learn Maven test execution commands

  • Verify test scripts are ready for execution

  • Check project build and execution setup

git pull origin branchName

Git Pull

Task 1: Execute test suites

Open the Automation Project

1

  • Launch Eclipse or IntelliJ IDE.

  • Open the TravelTest Maven project.

Verify TestNG Configuration

2

  • Navigate to the testng.xml file.

  • Ensure test classes are added properly.

Example:

 

<suite name="TravelTestSuite">
   <test name="LoginTests">
       <classes>
           <class name="tests.LoginTest"/>
       </classes>
   </test>
</suite>

Verify Maven Dependencies

3

  • Open pom.xml.

  • Confirm Selenium and TestNG dependencies are available.

  • Save the file and update Maven project if required.

Build the Project

4

  • Open Terminal/Command Prompt in project location.

  • Run the Maven build command:

mvn clean install

  • Verify BUILD SUCCESS message.

  • Right-click on testng.xml.

  • Select:

  • Run As → TestNG Suite

  • Observe browser launch and test execution.

Execute Test Suite Using TestNG

5

Execute Test Suite Using Maven

6

  • Open Terminal inside project folder.

  • Run the command:

  • mvn test

  • Maven starts executing all configured test cases.

Observe Execution Results

7

Update Maven Project

8

  • Monitor console output.

  • Verify:

    • Passed test cases

    • Failed test cases

    • Skipped test cases

  • Check whether browser launches successfully.

  • Observe automated actions like:

  • Opening TravelTest application

  • Entering login details

  • Navigating between pages

Check TestNG Reports

9

  • Navigate to project folder:

test-output

  • Open:

    • index.html

    • emailable-report.html

 

Validate Test Suite Execution

10

  • Confirm all test cases executed successfully.

  • Verify reports generated correctly.

  • Check execution summary and logs

Task 2 : Generate reports (TestNG reports)

Execute the Test Suite

1

  • Run the automation test suite using TestNG or Maven.

mvn test

 

 

Wait for Execution Completion

2

  • Observe console output.

  • Ensure all test cases finish execution successfully.

Navigate to TestNG Report Folder

3

  • Open the project directory.

  • Locate the folder:

test-output

Verify Generated Report Files

4

  • Check whether the following files are generated:

    • index.html

    • emailable-report.html

    • testng-results.xml

Open HTML Report

5

  • Open index.html in browser.

  • Review:

    • Total test cases

    • Passed tests

    • Failed tests

    • Skipped tests

Open Emailable Report

6

Analyze Report Details

7

  • Check failed test cases.

  • Review error messages and stack traces.

  • Identify execution issues from the report.

  • Open emailable-report.html.

  • Verify summarized execution results.

Validate Report Generation

8

  • Confirm TestNG reports are generated successfully.

  • Ensure all execution details are displayed correctly.

Task 3 : Analyze test results

Execute the Test Suite

1

  • Run the automation test suite.

mvn test

Open TestNG Report Folder

2

  • Navigate to the project directory.

  • Open the folder:

test-output

Open TestNG HTML Report

3

  • Open index.html in the browser.

  • Review overall execution summary.

  • Identify:

    • Passed test cases

    • Failed test cases

    • Skipped test cases

Verify Test Execution Status

4

Analyze Failed Test Cases

5

  • Click on failed test cases in the report.

  • Review failure details and error messages.

Check Stack Trace

6

  • Observe exception details and stack trace.

  • Identify the exact line causing failure.

Example:

java.lang.NoSuchElementException

Review Console Output

7

  • Verify possible reasons for failure such as:

    • Incorrect locators

    • Synchronization issues

    • Invalid test data

    • Assertion failures

Identify Root Cause

8

  • Return to IDE console.

  • Check execution logs and failure messages.

  • Confirm successful test cases executed correctly.

  • Verify expected application behavior.

Validate Passed Test Cases

9

  • Record:

  • Total executed tests

Document Test Results

10

  • Passed tests

  • Failed tests

  • Observed defects/issues

  • Save reports for future reference and debugging.

Execute the Test Suite

1

  • Run the automation test suite using Maven or TestNG.

mvn test

 

Task 4 : Track Failure

Observe Test Execution

2

  • Monitor browser actions during execution.

  • Identify any interrupted or failed test scenarios.

Check Console Output

3

  • Open IDE console window.

  • Review execution logs and failure messages.

Identify Failed Test Cases

4

  • Locate failed test case names in console output.

Example:

 

FAILED: LoginTest

Open TestNG Report

5

  • Navigate to:

test-output

  • Open index.html.

Review Failure Details

6

  • Click on failed test cases.

  • Check:

  • Error messages

  • Exception details

  • Failure summary

Analyze Stack Trace

7

Verify Screenshot or Logs

8

  • Review stack trace generated for failed tests.

Example:

 

java.lang.AssertionError
  • Identify the exact failure location in script.

  • Open captured screenshots or log files if available.

  • Compare expected vs actual application behavior.

Identify Root Cause

9

  • Analyze possible reasons for failure such as:

    • Invalid locator

    • Element not found

    • Synchronization issue

    • Incorrect test data

    • Assertion mismatch

  • Record:

    • Failed test case name

    • Error message

    • Root cause

    • Suggested fix

  • Save reports and logs for debugging and defect tracking.

Identify Root Cause

10

 

Good Job!!

You have successfully completed your lab on Test Execution & Reporting, where you learned how to execute Automated Test Suites using TestNG and Maven, generate TestNG Reports, and analyze Test Execution Results.

You also gained hands-on experience in reviewing Execution Logs, tracking Failed Test Cases, identifying Root Causes, and validating Automation Reports for efficient Test Monitoring and Debugging.

Checkpoint

   Git Push

git push origin branchName

Next-Lab Preparation

  • Use ChatGPT for script generation
  • Use GitHub Copilot for coding support
  • Generate locators using AI
  • Improve script creation speed