Reputation: 3534
I am writing a series of automated tests for my e-commerce company, specifically checkout tests. I need to write the exact same set of tests using a (fake) Visa, Discover, AmEx, and MasterCard. I would love to be able to write a set of tests in one or more classes and then, during the same test run, repeat the tests again only with slightly different inputs (i.e., the credit card numbers). Is there anyway to do that? I am already running these tests in parallel using <parameters>
in the testng.xml, but I want these checkout tests to run sequentially as a part of the entire test run for a particular browser, but those test runs on different browsers are ran in parallel (which I already have accomplished).
Upvotes: 0
Views: 165
Reputation: 3433
Read up on the @DataProvider
annotation and how to use it in the TestNG documentation. It's what makes TestNG special. The data provider method will send as many rows of data to a test method as you want.
Upvotes: 3