Parallel = tests, classes,methods in testing.xml of testNG

阅读更多
How to understand parameter "parallel" when setting up it in testing.xml file;


Structure of test suites




       
           
           
       
 
   

   
       
           
           
       
 
   


      
parallel = "tests":
search and search2 run in parallel, all the items under the test  ( search8, search9 ) run in order.


parallel = "classes":
all the under run in parallel, but and run in order.  Search8 and Search9 run in parallel, after running completed. the Search10 and Search11 will run in parallel.


parallel = "methods":
will run in order, all the methods under class will run in parallel.


Conclusion comes out:
if the parallel equals to a small scope. ( parallel = "methods"). then all the big scope (class,test,suite) will run in order, and methods will run in parallel.

(parallel = "classes"), then all the big scope (test,suite) will run in order, the class under classes will run in parallel.

(parallel = "tests"), then all the big scope( suite..)  will run in order, the test will run in parallel.


So if we want to run some scope in parallel, we must make sure the scope running in parallel will be separated from others. This is say, there is no any dependency for any small scope you want to run. Or else, you will get error when you run them in parallel.



你可能感兴趣的:(testNG)