Need to print log4j logs in extent reports. HOw can I do that?
相关问题
- Selecting an item from a combo box selenium driver
- Selenium in Java is not finding element when using
- How to send text to the search field through Selen
- What is the difference in “find_element_by_xpath”
- Cloudflare and Chromedriver - cloudflare distingui
Firstly, create a class with a synchronized method which returns an instance of
ExtentReports
:Secondly, create another class which declares only test related synchronized methods ( & of course, those method must be handled Thread wise). Code snippet:
Finally, modify your BaseClass accordingly:
EDIT :
Create a test class (
ExampleTest.java
) with your test:Required
testng.xml
:Try to end the test and flush the report in @AfterMethod and close the report in @AfterTest Method. It worked for me. Try it Like Below Code: