Reputation: 518
I'm using Extent report version 4,i've used same code mention in extent report java doc site but no lock and code is executed successfully but at last HTML report is not generating,any help will be appreciated.
Below is the Code:
import com.aventstack.extentreports.ExtentReports;
import com.aventstack.extentreports.ExtentTest;
import com.aventstack.extentreports.reporter.ExtentAventReporter;
import io.github.bonigarcia.wdm.WebDriverManager;
public class Reporting {
WebDriver driver;
public static ExtentTest test;
public static ExtentReports extent;
public static void test() {
// directory where output is to be printed
ExtentAventReporter avent = new ExtentAventReporter(System.getProperty("user.dir") + "./reports/TestExecution.html");
extent = new ExtentReports();
extent.attachReporter(avent);
test=extent.createTest("Login").assignAuthor("Rajesh");
}
@AfterMethod
public void after(){
extent.flush();
}
@Test
public void testings(){
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
test();
driver.get("http://www.google.com");
}
}
Upvotes: 1
Views: 1278
Reputation: 11
instead of
extent = new ExtentReports();
use
extent = new ExtentReports(outputDirectory + File.separator + "ExtentReportsTestNG.html", true);
Upvotes: 0