title: @DataProvider and @BeforeMethod order
body: <p>What method is invoked first in a test class with testng annotations:</p>
  
  <blockquote>
    <ul>
    <li>annotated with @DataProvider</li>
    <li>annotated with @BeforeMethod</li>
    </ul>
  </blockquote>
  
  <p>?</p>
  
  <p>During my testing I found the order: 1. @DataProvider 2. @BeforeMethod</p>
  
  <p>But my @DataProvider uses the variable that will be initialized only in @BeforeMethod.
  What workaround may be the best here?</p>
  
  <p>My case is the following:</p>
  
  <pre><code>class Test 
    @BeforeClass
      //here I initialize pages (pageobjects in context of selenium)
    @BeforeMethod
      //here i 'get' the page I want (and the one i'll use in dataprovider)
  
    @Test(dataProvider = "dp")
      //my test goes here...
  
    @DataProvider
    dp
      //here I use page. The page may be 'usable' only if it was already 'get'.
  </code></pre>