Appium IOS Java-Client PageObjects

So right now we are using the Ruby lib for testing the IOS tablet. We would like to move to the “java-client” because that is what we are using for Android. What i’m trying to do is use “pageObjects” to select both the Class, Name and “hint”. As you can see i have a few elements that have the same Name/Class.

I will be working with the dev to clean that up but that takes time.

// Here is the current interface. I was hoping it would easy to add “String hint() default “”;” to help find what i’m looking for. // But that does not work.
public @interface iOSFindBy {
String uiAutomator() default “”;
String accessibility() default “”;
String id() default “”;
String name() default “”;
String className() default “”;
String tagName() default “”;
String xpath() default “”;

The code i’m using is the following:

        @iOSFindBy(className = "UIAButton"),
        @iOSFindBy(name = "Refresh")
private List<MobileElement> refreshButton;

public void refreshApp() {

    System.out.println("TEST.... Wait...");
    System.out.println("Refresh Objects: " + refreshButton.size());


The output is:

TEST… Wait…

There are 3 buttons in my view.



{“UIAButton”:{"@":{“name”:“Refresh”,“label”:“Refresh”,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:“Reload dashboard content.”,“path”:"/0/0/2",“x”:73,“y”:992.5,“width”:16,“height”:32},">":[]}},

Ruby Code that works but i want to use java.

def refresh_dashboard_button
  # Make a reference to the Refresh button
  refresh = find_ele_by_attr(:UIAButton, :hint, 'Reload dashboard content.')

  # click the refresh button

Anyone with any thoughts?



I am suspecting that something wrong with your locators.
FindByAll is descrided here (examle for Android):

Engines for iOS are same.
Does it find the wrong element? I think it should find some

[quote=“xsmaster, post:1, topic:3226”]
[/quote]. But I am suspecting that it is not expected element.

Find All annotations were designed to avoid the problem when visually the same element has different locators. It depends on conditions like user profile, OS version etc.

Does it find nothing?