Re: how to run a suite with multiple parameterized classes

49 views
Skip to first unread message

edwolb

unread,
Nov 22, 2012, 3:15:35 PM11/22/12
to testng...@googlegroups.com
Make sure your XML file has parallel="false", and not parallel="classes" or "methods".  With this setting, it should definitely kick off in serial.

On Wednesday, 21 November 2012 11:50:01 UTC-5, StatusQuo wrote:
I am trying to create a test suite with multiple classes (all are parameterized test classes with @Dataproviders). All of these tests run perfectly individually and each have initilization code in their constructors(driver initilization and other setup procedures).
I tried three ways( with parallel attribute set to false)
1) Run a single xml suite with different classes 
2) Create different xml suites for each class and then a master suite with the paths of each individual xml suites
3) Created a class file with an main method and added all tests to Xml suite object.
I am trying to run each test class sequentially (order does not matter)  but somehow tests get fired up parallelly with two or more browser instances running simultaneously. 
Seeking some advice.

StatusQuo

unread,
Nov 27, 2012, 11:21:36 AM11/27/12
to testng...@googlegroups.com
I had tried that but didn't work.

Abraham Lin

unread,
Nov 27, 2012, 11:33:33 AM11/27/12
to testng...@googlegroups.com
Test class instances are constructed before test execution occurs, so any logic in initializers (including constructors) will be triggered well before the test methods are invoked. If this is a problem, then move your initialization logic into @BeforeClass methods instead.

StatusQuo

unread,
Nov 27, 2012, 12:27:50 PM11/27/12
to testng...@googlegroups.com

Thanks Abraham! I had browser initilization methods in my constructors and changing the constructor to a setup method with @BeforeClass did the trick.

Reply all
Reply to author
Forward
0 new messages