java-client icon indicating copy to clipboard operation
java-client copied to clipboard

@FindAll annotation not compatible with @iOSXCUITFindBy

Open nir-tal-talkspace opened this issue 3 years ago • 1 comments

Description

I'm trying to use @FindAll with @iOSXCUITFindBy to find multiple IOS elements but it does not work.

this code works:

    @FindAll({
            @FindBy(xpath = "//XCUIElementTypeSearchField"),
            @FindBy(xpath = "//XCUIElementTypeSearchField")
    })
    private WebElement searchField;

but IOS elements have accessibility attribute which is not present in the @FindBy annotation.

Environment

  • Java client build version or git revision if you use some snapshot: latest
  • Appium server version or git revision if you use some snapshot: latest

Details

Incompatible types. Found: 'io.appium.java_client.pagefactory.iOSXCUITFindBy', required: 'org.openqa.selenium.support.FindBy'

Code To Reproduce Issue [ Good To Have ]


    @FindAll({
            @iOSXCUITFindBy(accessibility = "a"),
            @iOSXCUITFindBy(accessibility = "b")
    })
    private WebElement searchField;

nir-tal-talkspace avatar Jul 12 '22 19:07 nir-tal-talkspace

try this

    @iOSXCUITFindAll({
            @iOSXCUITBy(accessibility = "skip_btn"),
            @iOSXCUITBy(iOSClassChain = "**/XCUIElementTypeButton[`name == "skip_btn"`]")
    })
    public WebElement skip;

pramodKarande avatar Apr 16 '23 06:04 pramodKarande