I just recently started automating a native iOS app recently using Appium Server 1.4.13 and Java client 3.4.1. I upgraded to Server 1.5.3 and Java client 4.0 so now all of my locators using “name” no longer work. I saw a posting on here about converting to use AccessiblityId so that is what I’m trying to do. So I changed my original method in my Page Object from:
public static WebElement storeLocatorLink(WebDriver driver){
** element = driver.findElement(By.name(“stores”));**
** return element;**
to:
public static WebElement storeLocatorLink(IOSDriver driver){
** element = driver.findElementByAccessibilityId(“stores”);**
** return element;**
After doing this, my tests had the error:
The method storeLocatorLink(IOSDriver) in the type StoreLocatorPO is not applicable for the arguments (WebDriver)
So… I changed the test method from:
public static void Execute(WebDriver driver, String searchQuery) throws InterruptedException{
to:
public static void Execute(IOSDriver driver, String searchQuery) throws InterruptedException{
Could somebody tell me if I’m going about this conversion from using “name” to “AccessibilityId” in a decent manner or is there a better way? Should I always use IOSDriver and never WebDriver? Thanks