1.1. Example of IExecutionListener
is a listener that monitors the beginning and end of a TestNG run. It has two methods, and . Method is called before the TestNG starts running the suites and is called after TestNG is done running all the test suites.
In the below example, we will create two listeners, and . In class , in method
In the output, you can see one set of messages are printed before TestNG starts running the suites and the other set of messages are printed once all the suites have been run.
Output :Starting On execution test from ExecutionListener1
Starting On execution test from ExecutionListener2
[TestNG] Running:
Am in Before Suite
In Test Method t...
===============================================
Suite
Total tests run: 1, Failures: 0, Skips: 0
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.