How to modify testNG report in selenium java

  • I am running my script in java and getting the results in testNG. But in my application after filling up the form I am getting a confirmation alert message. I am able to read that alert message and capture screenshot using selenium but I want to write/include that alert message and screenshot (or its path) in the testNG report.

    Is there any way to do that as I am new to testNG

  • You can use reportNG. Its the reporting plugin for testNG. You can add your message using Reporter.log("Your Message");

    If you want to add your alert messages in report and your project is Maven project then add following in pom.xml


    Using Reporter.log("Your message"); you can add your messages and can see in Test Output-> index.html ->Reporter Output

    For more details

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2