I want to execute my TestNG Class tests in order wise how they have written from to to bottom. To achive this right now i am using priority for each test in one testNG class. Sample TestNg Class: SecondTestNG.class assume this class also having 3 tests When i execute above mentioned classes alone from testNg xml file the out put will be as shown below. Now the problem is when i execute both FirstTestNG and SecondTestNG Classes at a time form testNg xml then execution sequence will be but i want as shown below: can we achive this ? You received this message because you are subscribed to the Google Groups "testng-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at https://groups.google.com/group/testng-users. For more options, visit https://groups.google.com/d/optout. |
We can achieve it by calling the test classes from different test tag in same xml file like below also put preserve-order =true at suite level: <test name="Test 1"> <classes> <class name="FirstTestNG"></class> </classes> </test> <test name="Test 2"> <classes> <class name="SecondTestNG"></class> </classes>
</test> On Mon, Nov 13, 2017 at 12:34 PM, adithya vardhanreddy <[hidden email]> wrote:
You received this message because you are subscribed to the Google Groups "testng-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at https://groups.google.com/group/testng-users. For more options, visit https://groups.google.com/d/optout. |
Hello,
-- I am also facing the same issue. My testng XML: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="CRM Test"> <test name="UI Test" group-by-instances="true"> <classes> <class name="test.java.com.testsuite.Class1"/> <class name="test.java.com.testsuite.Class2"/> <class name="test.java.com.testsuite.Class3"/> </classes> </test> <!-- UI Test --> </suite> <!-- CRM Test --> First Class: public class Class1{ @Test(priority = 1, dataProvider = "getData", dataProviderClass = DataUtil.class)
} Second Class: public class Class2{ @Test(priority = 1, dataProvider = "getData", dataProviderClass = DataUtil.class)
} Third Class: public class Class3{ @Test(priority = 1, dataProvider = "getData", dataProviderClass = DataUtil.class)
} I am generating XML runtime as user says I have to run only Class1 and Class2 then XML contains only Class1 and Class2. Output: Class1: Test1 Class2: Test1 Class1: Test2 Class2: Test2 Class1: Test3 Class2: Test3 Expected: Class1: Test1 Class1: Test2 Class1: Test3 Class2: Test1 Class2: Test2 Class2: Test3 I am using latest testng 6.11 On Monday, November 13, 2017 at 3:27:38 PM UTC+5:30, Pavankumar Vedantham wrote:
You received this message because you are subscribed to the Google Groups "testng-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at https://groups.google.com/group/testng-users. For more options, visit https://groups.google.com/d/optout. |
Hi,
-- It is the expected order: priority is used to order tests in <test> and tests with the same priority will be executed together. You may use another ordering feature like dependsOnMethods which is class scoped. Julien Le mardi 21 novembre 2017 10:47:07 UTC+1, [hidden email] a écrit :
You received this message because you are subscribed to the Google Groups "testng-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at https://groups.google.com/group/testng-users. For more options, visit https://groups.google.com/d/optout. |
Thanks Julien Herr.
-- On Tuesday, November 21, 2017 at 9:23:01 PM UTC+5:30, Julien Herr wrote:
You received this message because you are subscribed to the Google Groups "testng-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at https://groups.google.com/group/testng-users. For more options, visit https://groups.google.com/d/optout. |
Solution for the code: static List<Class<? extends ITestNGListener>> listenerClasses = new ArrayList<>(); public static List<XmlSuite> genarateXmlFile() { Where class values are dynamic. On Wednesday, November 22, 2017 at 10:52:27 AM UTC+5:30, [hidden email] wrote:
You received this message because you are subscribed to the Google Groups "testng-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at https://groups.google.com/group/testng-users. For more options, visit https://groups.google.com/d/optout. |
Free forum by Nabble | Edit this page |