TestNG Sequence of test case -


I am working on test integration and using testing for it, here I am testing with several test data The order of the case needs to be run. Here are the dependencies between each other in cases of investigation.

The public class extends MyTestCase ISIntegrationTest {

  test bean testben; @factor (datatwvvor = "bnprovider") public matesthes (testben testben) {this.testbean = testbean; } @DetAdvPower (name = "BinProWidder") Public Static Test Bean [] [] Beanprovider () {New TestBen Back [] [] {{New TestBen ("Type 1")}, {New TestBean ("Type 2") }}; } @Test (weighing = true) Public Zero Test INIT () Exception {} @AfterTest throws (always turned on = true) Public throws at zero () Exception {} @Test (Hesheran = Truth, Description = "Test 1 ") Public Zero test1 () {System.out.println (" test1: "+ testbean.type); } @ Test (group = "wso2.is", description = "test2", depend on-method = "test1") public void test2 (exception) {System.out.println ("test2:" + testbean.type ) Throws; } @Test (groups = "wso2.is", description = "test3", dependOnMethods = "test2") throws public {1} test3 () exception {System.out.println ("test3:" + testbean.type); } Fixed class TestBean {string type; Test Bean (string type) {this.type = type; }}  

}

Here I need to run the test1, test2 and test3 as the sequence with the data element near the array. I give the following As expected, I am expecting production as below.

test1: type1 test2: type1 test3: type1 test1: type2 test2: type2 test3: type2

but I am receiving the following output

test1: type1 Test1: type2 test2: type1 test2: type2 test3: type1 test3: type2

Is there a way to address this problem?

Use the group on the basis of examples to run the test Create a suite XML as below and Set the group-by-example = "true", run this test using this.

  & lt; Suite thread-count = "2" verbose = "10" name = "test site" parallel = "test" & gt; & Lt; Test verbose = "2" name = "nameOfTheTestFirefox" group-by-instance = "true" & gt; & Lt; Parameter name = "browser name" value = "firefox" /> & Lt; Classes & gt; & Lt; Class name = "com.crazytests.dataproviderissue.MyTestCase" /> & Lt; / Sections & gt; & Lt; / Test & gt;  


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -