title: Received Data Provider Mismatch error
body: <p>Tried below code but receiving Data Provider Mismatch error. Could anyone help out on this?</p>
  
  <pre><code>package appModules;
  
  import org.testng.annotations.Test;
  
  import jxl.Sheet;
  import jxl.Workbook;
  import jxl.read.biff.BiffException;
  
  import org.testng.annotations.DataProvider;
  import org.testng.annotations.BeforeTest;
  
  import java.io.FileInputStream;
  import java.io.FileNotFoundException;
  import java.io.IOException;
  
  import org.openqa.selenium.By;
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.firefox.FirefoxDriver;
  import org.openqa.selenium.support.ui.WebDriverWait;
  import org.testng.annotations.AfterTest;
  import org.testng.annotations.BeforeClass;
  
  public class NewTest {
  public WebDriver driver;
  public WebDriverWait wait;
  String appURL = 
  "https://dev.agencyport.rsagroup.ca:8443/agencyportal/ProcessLogoff";
  
  //Locators
  private By username = By.id("USERID");
  private By password = By.id("PASSWORD");
  
  @BeforeClass
  public void testSetup() {
      System.setProperty("webdriver.firefox.marionette", 
  "C:\\Automation\\geckodriver.exe");
      driver=new FirefoxDriver();
      driver.manage().window().maximize();
      wait = new WebDriverWait(driver, 5);
  
  
  }
  
  @Test(dataProvider = "login")
  public void Login(String Username, String Password) {
  
    driver.findElement(username).sendKeys(Username);
    driver.findElement(password).sendKeys(Password);
  
  }
  
  @DataProvider (name="login")
  public Object[][] dp() throws Exception{
    Object[][] arrayObject = 
  getExcelData("C:\\Automation\\testData.xls","New");
    return arrayObject;
  
  }
  
  public String[][] getExcelData(String fileName, String sheetName) throws 
   Exception {
    String[][] arrayExcelData = null;
    try {
        FileInputStream fs = new FileInputStream(fileName);
        Workbook wb = Workbook.getWorkbook(fs);
        Sheet sh = wb.getSheet(sheetName);
  
        int totalNoOfCols = sh.getColumns();
        System.out.println(totalNoOfCols);
        int totalNoOfRows = sh.getRows();
        System.out.println(totalNoOfRows);
        arrayExcelData = new String[totalNoOfRows-1][totalNoOfCols];
  
        for (int i=1 ; i &lt;totalNoOfRows; i++) {
  
            for (int j=0; j &lt;totalNoOfCols; j++) {
                arrayExcelData[i-1][j] = sh.getCell(j, i).getContents();
                System.out.println(arrayExcelData[i-1][j]);
            }
  
        }
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
        e.printStackTrace();
    } catch (BiffException e) {
        e.printStackTrace();
    }
    return arrayExcelData;
  }
  
  @Test
  public void tearDown() {
    driver.quit();
  }
  }
  </code></pre>
  
  <p>Received below error - </p>
  
  <pre><code>org.testng.internal.reflect.MethodMatcherException: 
  Data provider mismatch
  Method: Login([Parameter{index=0, type=java.lang.String, 
  declaredAnnotations=[]}, Parameter{index=1, type=java.lang.String, 
  declaredAnnotations=[]}])
  Arguments: [(java.lang.String) agent,(java.lang.String) password,
  (java.lang.String) ]
  atorg.testng.internal.reflect.DataProviderMethodMatcher.getConformingArguments(DataProviderMethodMatcher.java:45)
  at org.testng.internal.Parameters.injectParameters(Parameters.java:796)
  at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:982)
  at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
  at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
  at org.testng.TestRunner.privateRun(TestRunner.java:648)
  at org.testng.TestRunner.run(TestRunner.java:505)
  at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
  at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
  at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
  at org.testng.SuiteRunner.run(SuiteRunner.java:364)
  at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
  at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
  at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
  at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
  at org.testng.TestNG.runSuites(TestNG.java:1049)
  at org.testng.TestNG.run(TestNG.java:1017)
  at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114)
  at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
  at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)`
  </code></pre>