方法结果未显示在控制台中

时间:2018-01-17 06:07:09

标签: java selenium selenium-webdriver testng

我有两种方法

1.public void VerifyLoan()
2.public void VerifyPersonalInfo

运行测试后,我在控制台中只看到VerifyLoan()的结果为通过。但是没有显示其他方法public void VerifyPersonalInfo的结果

附上我的代码和控制台

 @BeforeTest    
 public void beforetest()
 {
        System.setProperty("webdriver.chromedriver"," E:\\chromedriver.exe");
        driver = new ChromeDriver();
        String baseurl = "https://staging.centum.no/skjema";
        driver.get(baseurl);
        driver.manage().window().maximize();
 }

@Test
public void VerifyLoan() throws InterruptedException
{
        Locators loan = new Locators(driver);
        loan.LoanPurpose();
}

public void VerifyPersonalInfo() 
{
        Locators Info = new Locators(driver);
        Info.PersonalInfo();
}

@AfterTest
public void aftertest()
{
}

控制台输出

Starting ChromeDriver 2.34.522940 (1a76f96f66e3ca7b8e57d503b4dd3bccfba87af1) on port 33313
Only local connections are allowed.
PASSED: VerifyLoan

===============================================
    Default test
    Tests run: 1, Failures: 0, Skips: 0
===============================================


===============================================
Default suite
Total tests run: 1, Failures: 0, Ski

1 个答案:

答案 0 :(得分:0)

请尝试以下代码

 @BeforeTest   
 public void beforetest() 
 {
        System.setProperty("webdriver.chromedriver"," E:\\chromedriver.exe");
        driver = new ChromeDriver();
        String baseurl = "https://staging.centum.no/skjema";
        driver.get(baseurl);
        driver.manage().window().maximize();
 }

@Test(priority=1)
public void VerifyLoan() throws InterruptedException
{
        Locators loan = new Locators(driver);
        loan.LoanPurpose();
}

@Test(priority=2)
public void VerifyPersonalInfo() 
{
        Locators Info = new Locators(driver);
        Info.PersonalInfo();
}

@AfterTest
public void aftertest()
{
}