title: Method Priority in testng
body: <p>I'm facing problem in running test method on basis of priority. Below is my code snip</p>
  
  <pre><code>Class TestHarness{
        @BeforeSuite
        setUP(){ }
  
        @AfterSuite
        tearDown(){}
  }
  
  XYZ extends TestHarness{
  
        @Test(Priority=1)
        verifyXYZ{}
  }
  
  ABC extends TestHarness{
        @Test(Priority=2)
        verifyABC{}
  } 
  </code></pre>
  
  <p>Testng.xml</p>
  
  <pre><code>&lt;suite name="SmokeTestSuite"&gt;
    &lt;listener class-name="TestResultListener" /&gt;
      &lt;test name="SmokeTests" &gt;
        &lt;classes&gt;
          &lt;class name="XYZ" /&gt;             
          &lt;class name="ABC"/&gt;                 
        &lt;/classes&gt;
      &lt;/test&gt;
   &lt;/suite&gt;
  </code></pre>
  
  <p><code>ABC.verifyABC()</code> methods gets executes prior of <code>XYZ.verifyXYZ()</code>. Even though <code>preserve-order</code> has not set with false in <code>testng.xml</code>. </p>
  
  <p>Main intention to run all test on basis of test class order defined in <code>testng.xml</code>. Tried below solutions but didn't work:</p>
  
  <ol>
  <li><p>re-priority test methods of all classes(in <code>testng.xml</code>) by extending <code>IMethodInterceptor</code>. </p>
  
  <p>Result: In this case execution order was,</p>
  
  <pre><code>    i. BeforeSuite Method 
     ii. ABC.verifyABC method
    iii. override intercept method
  </code></pre></li>
  <li><p>Specified priority on all test methods of all the test classes but somehow this also didn't work for me. </p></li>
  </ol>
  
  <p>I'm using testng 6.11 version. Can anybody help me out in this context.</p>
  
  <p>Thanks in advance!</p>