My code -
public class HomePage {
Data data;
String dataFile;
public IOSDriver<IOSElement> driver;
public HomePage(IOSDriver<IOSElement> driver, String dataFile) throws JsonParseException, JsonMappingException, IOException, InterruptedException {
this.data = Data.get(dataFile);
this.dataFile=dataFile;
this.driver=driver;
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
}
Tried with accessibility -
@iOSXCUITFindBy (accessibility = “Jio Welcome Polys”)
private IOSElement welcomeBanner;
Tried with xpath -
@iOSXCUITFindBy (xpath = "//XCUIElementTypeImage[@name='Jio Welcome Polys']")
private IOSElement welcomeBanner;
Assert.assertTrue(welcomeBanner.isDisplayed());
None of the annotations work ^^ -
Error thrown - Can’t locate an element by this strategy: By.chained({By.AccessibilityId:
java-client : 7.0.0
It works when i use -
driver.findElementByXPath("//XCUIElementTypeImage[@name=‘Jio Welcome Polys’]").isDisplayed();