title: TestNG Wrong Number of Arguments With DataProviders
body: <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;suite name="Suite" parallel="tests" configfailurepolicy="continue" thread-count = "10" verbose="1"&gt;
  &lt;parameter name="dev" value="true"&gt;&lt;/parameter&gt;
      &lt;test name ="Chrome" parallel="methods"&gt;
          &lt;parameter name="myBrowser" value="chrome" /&gt; 
              &lt;classes&gt;
                  &lt;class name="package.TestClass"&gt;&lt;/class&gt;
                  &lt;/classes&gt;
              &lt;/test&gt;
  
              &lt;test name ="Firefox" parallel="methods"&gt;
          &lt;parameter name="myBrowser" value="firefox" /&gt; 
              &lt;classes&gt;
                  &lt;class name="package.TestClass"&gt;&lt;/class&gt;
                  &lt;/classes&gt;
              &lt;/test&gt;
  &lt;/suite&gt;
  </code></pre>
  
  <p>In this .xml file I have a parameter named "dev" set to true. I am trying to have my dataproviders read this variable and use a different excel sheet if true.</p>
  
  <pre><code>@Parameters("dev")
  @DataProvider(parallel = true)
  public Object[][] testData(String dev) {
      String path;
      if(dev.equals(true)){
          path =  System.getProperty("user.dir") + "\\src\\data\\dev-data.xlsx";
      }
      else{
          path =  System.getProperty("user.dir") + "\\src\\data\\reg-data.xlsx";
      }
      ExcelReader reader = new ExcelReader(path);
      Object[][] obj = new Object[reader.getSheetRows("url")][reader.getSheetColumns("url")]; //four test, one argument
      for(int i = 0; i &lt; reader.getSheetRows("url"); i++){
          for(int j = 0; j &lt; reader.getSheetColumns("url"); j++){
              obj[i][j] = reader.getCellData("url", j, i);
          }
      }
  
      return obj;
  }
  </code></pre>
  
  <p>The issue is that the methods are saying that I am passing an incorrect number of arguments </p>
  
  <pre><code>@Test (dataProvider="testData")
  public void test1(String url)
  {}
  </code></pre>
  
  <p>java.lang.IllegalArgumentException: wrong number of arguments</p>