Question

1
Replies
75
Views
DineshaN8974 Member since 2019 1 post
Melbourne Water Corporation
Posted: November 26, 2019
Last activity: December 3, 2019
Solved

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.

Below is the HTML file for the target element

Image removed.

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.

Low-Code App Development Testing Applications Mobile
Share this page LinkedIn