title: TestNG/Webdriver/Java - passing parameters via annotations?
body: <p>I am relatively new to Java, TestNG and Selenium Webdriver (3 weeks) and it seems Im not passing parameters correctly, the way TestNG wants me to.</p>
  
  <p>The test runs perfectly, but then it says it failed for the following reason:</p>
  
  <pre><code>org.testng.TestNGException: 
  The data provider is trying to pass 2 parameters but the method com.pragmaticqa.tests.AppTest2#twoUsersSignUp takes 1
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>public class AppTest2 {
       public WebDriver driver;
       public WebDriverWait wait;
  
           @DataProvider(name = "dataProvider")
           public Object[][] setUp() throws Exception {
           File firefoxPath = new File(System.getProperty("lmportal.deploy.firefox.path", "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"));
           FirefoxBinary ffox = new FirefoxBinary(firefoxPath);
           ffox.setEnvironmentProperty("DISPLAY", ":20");
           driver = new FirefoxDriver(ffox, null);
           wait = new WebDriverWait(driver, timeoutInSeconds );
           Object[][] data = new Object[1][2];
           data[0][0] = driver;
           data[0][1] = wait;
           twoUsersSignUp(data);
           return data;
       }
  
       @Parameters({ "data" })
       @Test(dataProvider = "dataProvider")
       public void twoUsersSignUp(@Optional Object[][] data) throws InterruptedException{
  
             //test here
  
           }
  }
  </code></pre>