Using 2 @iosFindBy annotation for the same element

I am using two different version of iOS for testing my mobile application.

Xpath of an element varies for both the application

Is it possible to use two @iOSFindBy for the element?

protected WebElement loginbtn;

Based on the version and availabilty of xpath will it automatically fetch the element ?

Yes, it’s possible to, you need to use HowToUseLocators annotation with LocatorStrategy.ALL_POSSIBLE which means either Login OR SignIn

@HowToUseLocators(iOSXCUITAutomation = LocatorGroupStrategy.ALL_POSSIBLE)
protected WebElement loginbtn;

The problem in using 2 locator strategy is it will make execution slow. Instead of that you can use NS Predicate, it would be faster as compared to earlier one

@iOSXCUITFindBy(iOSNsPredicate = “name == ‘Login’ OR name == ‘SignIn’”)
protected WebElement loginbtn;

For more info on predicate string