Java 仅执行Testng中的第一个测试,跳过所有其他测试

Java 仅执行Testng中的第一个测试,跳过所有其他测试,java,selenium-webdriver,automated-tests,testng,testng.xml,Java,Selenium Webdriver,Automated Tests,Testng,Testng.xml,当执行testng时,只有第一个类在执行,然后被传递,其他类被跳过 如何按顺序运行所有测试用例 testngxml:它有两个类要执行 Projectwrappers:除了@Beforeclass和@test之外,它拥有testng中的所有标记 Testcaseclass:每个文件中都有@Beforeclass和@test 注意:我也尝试过给予优先权,但没有帮助 Testng.xml: <test name="Test"> <classes>

当执行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
        
    }
}

公共类ProjectWrappers扩展了GenericWrappers{
@套房前
在套房()之前公开作废{
startReport();
}
@试验前
测试前公共无效(){
loadObjects();
}
@BeforeMethod(alwaysRun=true)
方法()之前的公共无效{
startTest(testCaseName,testCasedescription);
invokeApp(浏览器名,confURL);
}
@后置法
公共方法(){
closeAllBrowsers();
}
@下课
公共空舱后舱(){
endTest();
}
@事后
公开无效后验(){
卸载对象();
}
@事后
公共空间无效后套件(){
endReport();
}
}
公共类P_VerifySignUp扩展了ProjectWrappers{
@课前
类()之前的公共无效{
testCaseName=“P_VerifySignUp”;
testCasedescription=“验证注册流-正”;
browserName=“chrome”;
}
@测试(始终运行=真)
public void verifySignUpPage()引发InterruptedException{
//代码
}
}
公共类P_VerifyCompanyProfileUpdate扩展了项目包装器{
@课前
类()之前的公共无效{
testCaseName=“P_VerifyCompanyProfileUpdate”;
testCasedescription=“验证公司档案更新流程-正”;
browserName=“chrome”;
}
@测试(始终运行=真)
public void verifyCompanyProfileUpdate(){
//代码
}
}