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

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Suite1" parallel="classes" thread-count="4">
<test name="search">
<classes>
<class name="com.testcase.Search8"></class>
<class name="com.testcase.Search9"></class>
</classes>
</test>
<test name="search2">
<classes>
<class name="com.testcase.Search10"></class>
<class name="com.testcase.Search11"></class>
</classes>
</test>
</suite>

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


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


parallel = "methods":
<class> 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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值