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


1 Answer 1


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 http://seleniumeasy.com/testng-tutorials/configuring-reportng-with-testng-to-generate-html-reports

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.