I am trying to send some parameters from TestNG XML to the test method and at the same time, that test method receives the data from dataProvider to implement various combinations of email and passwords
The problem that I am facing is that when both these send parameters I get the error Data Mismatch. I am using the @Parameters because I am running the test cases on multiple simulators so I would need both these annotations
@Test(dataProvider = "getEmailData", dataProviderClass = TestData.class)
@Parameters({"deviceName","platformVersion","wda","portNumber"})
public void loginScenarios(String username, String password,String deviceName,String platformVersion,String wda,String portNumber) throws MalformedURLException, InterruptedException {
AppiumDriver<MobileElement> driver = desiredCapabilities(false,deviceName,platformVersion,wda,portNumber);
UtilityBase.loginScenariosBase(driver, username, password);
OnBoardingPage login = new OnBoardingPage(driver);
Properties prop = UtilityBase.globalProperties();
if (username.equalsIgnoreCase(prop.getProperty("username")))
Assert.assertEquals(prop.getProperty("invalidPasswordLabel"), login.invalidPasswordLabel.getText());
else if (username.contains("short"))
Assert.assertEquals(prop.getProperty("userNotFoundLabel"), login.userNotFoundLabel.getText());
else
Assert.assertEquals(prop.getProperty("invalidEmailLabel"), login.invalidEmailLabel.getText());
driver.quit();
}