title: dataProvider with @Before testng
body: <p>I am working with one TestNG script with SauceLab and Jenkins. I stuck with one problem. When I run my project from Jenkins I will select browsers from there, so I can use it with "dataProvider", but dataProvider is only working with @Test annotations, I want to use dataProvider with @before.</p>
  
  <p>Steps:</p>
  
  <ol>
  <li>@Before will initialize the driver (Webdriver) object.</li>
  <li>@Test with execute first test case with driver object.</li>
  <li>@Test (2nd) with execute second test case with same driver object.</li>
  </ol>
  
  <pre class="lang-java prettyprint-override"><code>public class test
  {
      Webdriver driver;
  
      // Over here I want to use @Before
      @Test(dataProvider = "dynamicParameters", priority = 0, alwaysRun = true)
      public void init(String browser, String version, String os, Method method) throws Exception
      {
          System.out.println("Init Method");
          String BASE_URL = System.getProperty("baseUrl");
          PCRUtils pcrUtils = new PCRUtils();
          driver = pcrUtils.createDriver(browser, version, os, method.getName());
  
          driver.get(BASE_URL);
          driver.manage().window().maximize();
          Thread.sleep(50000);
       }
  
       @Test(priority = 1)
       public void verifyTitle() throws InterruptedException
       {
          AccountPage accountPage = new AccountPage();
          accountPage.verifyTitle(driver);
       }
  }
  </code></pre>