Run TestNG groups both sequentially and in parallel -



Run TestNG groups both sequentially and in parallel -

ok, referring testng doc can run tests either sequentially (by default in test suite) or in parallel using <suite parallel="tests">.

now here testng config

class="lang-xml prettyprint-override"><?xml version="1.0" encoding="utf-8"?> <!doctype suite scheme "http://testng.org/testng-1.0.dtd"> <suite name="complete test suite"> <listeners> <listener class-name="com.uas.test.portlet.integration.util.webdriverlistener" /> <listener class-name="org.uncommons.reportng.htmlreporter" /> </listeners> <test name="parallel tests" parallel="methods" thread-count="4"> <groups> <run> <exclude name="sequential-test"></exclude> </run> </groups> <packages> <package name="com.uas.test.portlet.integration.main" /> <package name="com.uas.test.portlet.integration.main.categorymanager" /> <package name="com.uas.test.portlet.integration.main.admin" /> </packages> </test> <test name="sequential tests" parallel="false" > <groups> <run> <include name="sequential-test"></include> </run> </groups> <packages> <package name="com.uas.test.portlet.integration.main" /> <package name="com.uas.test.portlet.integration.main.categorymanager" /> <package name="com.uas.test.portlet.integration.main.admin" /> </packages> </test> </suite>

as can see, have 2 types of tests : tests can run in parallel , others should run in sequential. no parallel=tests attribute in suite <test> tags run sequentially, in such manner first parallel test grouping run first , sequential ones.

that perfect, go bit farther , have 2 subgroups of sequential tests, each of run in parallel with each other, both after main parallel tests... unfortunately haven't been able that... summarize want :

1. run parallel tests main grouping 2. run sequential tests main grouping --> sequential subgroup runs in parallel sequential subgroup b (test 1 subgroup run in parallel test 3 subgroup b, independant) --> each test within subgroup should run sequentially --> each test within subgroup b should run sequentially

any thought on how testng config file ? (i avoid using ant or such).

two separate suites may help. executed sequentially. set tests within of them depending on need.

<suite-files> <suite-file path="./suite1.xml" /> <suite-file path="./suite2.xml" /> </suite-files>

testng

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -