TestNG - cannot run same test twice in a suite

前端 未结 2 1766
小鲜肉
小鲜肉 2020-12-21 17:56

I have a TestNG test suite that is working fine except for one thing: I cannot run the same test twice. The reason I want to run a test twice is that I am testing web servic

2条回答
  •  旧巷少年郎
    2020-12-21 18:06

    Solving the problem of code duplication in TestNG test I could find only this solution:

    Create a rootsuite.xml file like:

    
    
        
        
        
        
    
    
    
        
        
        
        
    
    
    

    Important! You can not include duplicated suite-files inside Test1.xml, Test2.xml, Test3.xml, Test4.xml - all duplicated suites will be ignored.

    Note the version of TestNG must be at least 6.9.9

    
      org.testng
      testng
      6.9.9
      test
     
    

提交回复
热议问题