Question
Melbourne Water Corporation
AU
Last activity: 3 Dec 2019 19:51 EST
data-test-id for iOS mobile automation using appium
Hi,
I have to automate an iOS mobile app using Selenium with Appium. We have added data-test-id to refer the elements but still i'm getting error in selenium stating that unable to find the element.
Below i have attached the screenshot of the appium inspector view.
Hi,
I have to automate an iOS mobile app using Selenium with Appium. We have added data-test-id to refer the elements but still i'm getting error in selenium stating that unable to find the element.
Below i have attached the screenshot of the appium inspector view.
Below is the HTML file for the target element
Below is the selenium java code i used,
private IOSDriver<MobileElement> driver;
URL url = new URL(configFileReader.getAppiumUrl());
driver = new IOSDriver<MobileElement>(url, cap);
MobileElement enterValueToHeadOnWeir = driver.findElementByXPath("//input[contains(@data-test-id,'HeadOnWeir')]");
enterValueToHeadOnWeir.sendKeys(configFileReader.getHeadOnWeirValue());
Thanks.