由范围报告生成的HTML没有显示任何数据,可能是什么错误?

时间:2018-03-16 11:10:42

标签: maven selenium-webdriver testng extentreports

您好我正试图通过范围报告创建报告;代码没有错误并且运行成功,但生成的html报告是空白的。以下任何人都可以帮助我的代码 同时附上我的报告示例 - Report Sample

public class VerifyLoginPageWithReport 
{

    WebDriver driver;
    String email = DataProviderFactory.getExcel().getData(0, 0, 0);
    String pass = DataProviderFactory.getExcel().getData(0, 0, 1);

    ExtentReports report;
    ExtentTest logger;

    @BeforeTest
    public void setup() 
    {
    report = new ExtentReports("\\Reports\\LoginPageReport.html", true);
    // Start the test using the ExtentTest class object
    logger = report.startTest("VerifyLoginPage", "This page will verify signout link");
    // passing browser type and url
    driver = BrowserFactory.getBrowser("chrome");
    driver.get(DataProviderFactory.getConfig().getApplicationUrl());
    logger.log(LogStatus.INFO, "Application is up and running");
    }

    @Test
    public void testHomePage()
    {    
    // initialize the home page
    HomePage home = PageFactory.initElements(driver, HomePage.class);
    String title = home.getApplicationTitle();
    // verifying the homepage
    Assert.assertTrue(title.contains("Online Shopping"));
    logger.log(LogStatus.PASS, "HomePage Loaded and verified");
    home.clickOnSignInLink();
    logger.log(LogStatus.INFO, "Sign In link clicked");
    // Initialzing login page
    LoginPage login = PageFactory.initElements(driver, LoginPage.class);
    // passing credentials
    login.loginApplication(email, pass);
    logger.log(LogStatus.INFO, "Login to application");
    // Verifying the signoutlink
    login.verifySignOutLink();
    logger.log(LogStatus.PASS, "Signout link verifed");
    }

    @AfterTest
    public void tearDown()
    {
    BrowserFactory.closeBrowser(driver);
    report.endTest(logger);
    report.flush();
    }
}

0 个答案:

没有答案