嗨我想通過範圍報告創建報告;該代碼沒有提供任何錯誤並且運行成功,但沒有生成html報告。任何人都可以請幫下面是我的代碼 -範圍報告沒有生成html
package ca.automation.com;
import org.testng.annotations.Test;
import com.relevantcodes.extentreports.ExtentReports;
import com.relevantcodes.extentreports.ExtentTest;
import org.testng.annotations.BeforeTest;
import org.junit.Assert;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.testng.annotations.AfterClass;
public class ExtentReport {
WebDriver driver;
ExtentReports extent;
ExtentTest test;
@BeforeTest
public void startReport(){
extent = new ExtentReports("C:\\Report.html", true);
}
@Test
public void installapp() {
test = extent.startTest("installapp");
System.setProperty("webdriver.ie.driver", "C:\\Anuj\\Downloads\\IEDriverServer_Win32_2.46.0\\IEDriverServer.exe");
driver = new InternetExplorerDriver();
driver.manage().window().maximize();
driver.get("https://www.tripadvisor.com/");
String Title = driver.getTitle();
Assert.assertTrue(Title.contains("Trip"));
extent.endTest(test);
}
}
謝謝,但它添加extent.flush()沒有幫助;沒有錯誤代碼運行良好,但沒有創建html。 –