How to pass testname dynamically to ExtentReports.createTest() | Selenium Forum
G
Gururaj Kallur Posted on 27/11/2020

We are passing test name to ExtentReports.createTest() as

 

ExtentReports.createTest("LoginTest);

 

if a file contains more than one test,

then how to pass testname to ExtentReports.createTest() dynamically.


A
Ashish Thakur Replied on 28/11/2020

You want to make a seperate report for each test?

If yes the you can write this line in each test. Or you can write it once in @BeforeMethod annoation.

In @Beforemethod you can get the name of the test as well. Just watch the testng videos and you will come to know how


G
Gururaj Kallur Replied on 30/11/2020

Got the answer in next module. By using ITestResult in init()

Thanks


A
Ashish Thakur Replied on 01/12/2020

Thats good :)

 

More ways are there. I am creating new video for data driven framework. Will discuss in that


Related Posts