How to exclude class in TestNG?

后端 未结 8 1228
囚心锁ツ
囚心锁ツ 2020-12-30 05:17

Is this possible to exclude classes in testng.xml?

I tried with


    

         


        
8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-30 05:45

    Add (groups = { "anyName"}) right after tests you don't want to run, so it will be look like:

     @Test(groups = { "group1"})
    public void methodTestName(){..
    }
    

    And than in your xml file add just after test name="..."

     
            
                
            
        
    

    Methods with (groups = { "group1"}) wont be runned. This way works for me. Remember that you can't exclude Class, only package, methods and runs. Good luck

提交回复
热议问题