Я пытаюсь создать отчет о экстенте в селене. Я написал точный код для создания отчета, но папка, в которой должен быть сохранен отчет, пуста, я также обновил проект, но все еще не могу создать отчет. Сообщите мне, если я сделал что-то не так в кодирующая часть. Вот мой код:
public class ContactUsTestCase {
ExtentHtmlReporter htmlReporter;
ExtentReports extent;
ExtentTest test;
static WebDriver driver;
UtilityMethods util = new UtilityMethods();
@BeforeClass
public void launchBrowser() {
driver = UtilityMethods.openBrowser(Constants.BROWSER_NAME);
UtilityMethods.launchWebsite(Constants.URL);
}
@BeforeTest
public void startReport() {
htmlReporter = new ExtentHtmlReporter("D:\\ExtentReport");
extent = new ExtentReports();
extent.attachReporter(htmlReporter);
extent.setSystemInfo("OS", "win 10");
extent.setSystemInfo("Host Name", "Stewart");
extent.setSystemInfo("Environment", "Chrome");
htmlReporter.config().setDocumentTitle("Automation testig report");
htmlReporter.config().setReportName("Your Logo Report Name");
htmlReporter.config().setTestViewChartLocation(ChartLocation.TOP);
htmlReporter.config().setTheme(Theme.DARK);
}
@Test(priority = 1)
public void ContactUs() {
test = extent.createTest("ContactUs", "This wil check status for Conatct us page");
// util.clickElement(Constants.OPEN_CONTACTUS);
driver.findElement(By.id("email")).sendKeys("stewart****@yahoo.com");
driver.findElement(By.id("pass")).sendKeys("******");
driver.findElement(By.xpath("//input[@value='Log In']")).click();
test.log(Status.PASS, MarkupHelper.createLabel("PASS", ExtentColor.GREEN));
}
@AfterClass
public void teardown() {
extent.flush();
}
}




Вы пропустили расширение для html-отчета,
Ваш путь должен быть "D:\\Demo_ExtentReport.html"
Вы упомянули только имя папки. Измените эту строку
htmlReporter = new ExtentHtmlReporter("D:\\ExtentReport");
в вашем коде, чтобы
htmlReporter = new ExtentHtmlReporter("D:\\ExtentReport\\nameOfTheReport.html");