I want to add test data used in test case execution in Extent Report selenium. e.g. I have used username soni691 & password: 691990 in a login method. Then if this test case is passed I want to display in the extent report that this username & pwd is used to login into the page.
I want to know if this is possible?
On the ExtentTest instance you can call the info method which accepts any String. Apart from info you can call pass, fail, error and a few more. Use these to log the steps and assertions you take.
You could try something like the below.
pom.xml dependency:
EDIT: Since I cant comment yet Ill just edit the answer.
The source of data wont matter as long as you can make a String out of it. Since you can send the username and password I suppose you already have them in some variable.
EDIT2: I wrote the wrong variable name here. Didnt mean extent but rather extentReports which I initilized the row before.
EDIT3: Added flush to finish up the flow of creating a whole report.
EDIT4: Added Maven dependancy to be clear about the version and version number of the extent report used
EDIT5: Added Reporter