# Combining IOSclasschain Locators issue

**URL:** <https://discuss.appium.io/t/combining-iosclasschain-locators-issue/40162>\
**Category:** Issues/Bugs\
**Created:** [September 2, 2023, 3:41am UTC](https://discuss.appium.io/t/combining-iosclasschain-locators-issue/40162 "2023-09-02T03:41:40Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Aleksei](https://discuss.appium.io/user_avatar/discuss.appium.io/aleksei/32/6267_2.png) [@Aleksei](https://discuss.appium.io/u/Aleksei)\
**Post date:** [September 2, 2023, 7:58am UTC](https://discuss.appium.io/t/combining-iosclasschain-locators-issue/40162/3 "2023-09-02T07:58:19Z")

</div>

If you are with Java try use Appium annotations. They combine all possible values you can imagine.  
Mine real example

```auto
    @HowToUseLocators(iOSXCUITAutomation = LocatorGroupStrategy.ALL_POSSIBLE, androidAutomation = LocatorGroupStrategy.ALL_POSSIBLE)
    @iOSXCUITFindAll(value = {
            @iOSXCUITBy(iOSNsPredicate = "name == 'closeBarButton' AND visible == 1"),
            @iOSXCUITBy(iOSNsPredicate = "name == 'backBarButton' AND visible == 1"),
            @iOSXCUITBy(iOSNsPredicate = "name == 'Back' OR label == 'Back' AND visible == 1")
    })
    @iOSXCUITFindBys(value = {
            @iOSXCUITBy(iOSNsPredicate = "type == 'XCUIElementTypeNavigationBar' AND visible == 1"),
            @iOSXCUITBy(iOSNsPredicate = "type == 'XCUIElementTypeButton' AND visible == 1")
    })
    @AndroidFindAll(value = {
            @AndroidBy(accessibility = "Navigate up"),
            @AndroidBy(uiAutomator = "new UiSelector().resourceId(\"appbar.navigation\")"), // recurrent details
            // back
            @AndroidBy(id = "iv_back"),
            // close
            @AndroidBy(id = "iv_close"),
            @AndroidBy(id = "iv_close_dialog"),
            @AndroidBy(id = "close_button_cross"),
            @AndroidBy(id = "iv_base_bottom_sheet_close") // Bottom Sheet close
    })
    @AndroidFindBys(value = {
            @AndroidBy(uiAutomator = "new UiSelector().resourceIdMatches(\".*toolbar.*\")"),
            @AndroidBy(className = "android.widget.ImageButton") // shitty android locator
    })
    @AndroidFindBys(value = { // onboarding
            @AndroidBy(id = "entitlement_container"),
            @AndroidBy(className = "android.widget.ImageButton")
    })
    private WebElement headerCloseOrBackButton;

```

---

_[View the full topic](https://discuss.appium.io/t/combining-iosclasschain-locators-issue/40162)._
