当testng被执行时,只有第一个类被执行,然后被传递,其他类被跳过。
如何按顺序运行所有测试用例。。
testngxml:它有两个类要执行
projectwrappers:除了@beforeclass和@test之外,它有testng的所有标记
testcaseclass:每个文件中都有@beforeclass和@test
注意:我也尝试过给予优先权,但没有帮助
testng.xml文件:
<test name="Test">
<classes>
<class name="testcases.P_VerifySignUp"/>
<class name="testcases.P_VerifyCompanyProfileUpdate"/>
</classes>
</test>
</suite>
public class ProjectWrappers extends GenericWrappers{
@BeforeSuite
public void beforeSuite(){
startReport();
}
@BeforeTest
public void beforeTest(){
loadObjects();
}
@BeforeMethod(alwaysRun=true)
public void beforeMethod(){
startTest(testCaseName, testCasedescription);
invokeApp(browserName, confURL);
}
@AfterMethod
public void afterMethod(){
closeAllBrowsers();
}
@AfterClass
public void afterClass(){
endTest();
}
@AfterTest
public void afterTest(){
unloadObjects();
}
@AfterSuite
public void afterSuite(){
endReport();
}
}
public class P_VerifySignUp extends ProjectWrappers{
@BeforeClass
public void beforeClass(){
testCaseName="P_VerifySignUp";
testCasedescription="Verify Sign Up Flow - Positive";
browserName="chrome";
}
@Test(alwaysRun = true)
public void verifySignUpPage() throws InterruptedException{
//code
}
}
public class P_VerifyCompanyProfileUpdate extends ProjectWrappers{
@BeforeClass
public void beforeClass(){
testCaseName="P_VerifyCompanyProfileUpdate";
testCasedescription="Verify Company Profile Update Flow - Positive";
browserName="chrome";
}
@Test(alwaysRun = true)
public void verifyCompanyProfileUpdate() {
// code
}
}
暂无答案!
目前还没有任何答案,快来回答吧!