Hello,
I'm using new page object design with Widget class. And recently caught some unexpected behaviour.
Let me describe my classes:
public class Movies {
@iOSFindBy(uiAutomator = ".tableViews()[0].cells()")
public List<Movie> items;
}
public class Movie extends Widget {
@iOSFindBy(uiAutomator = ".staticTexts()[0]")
public IOSElement nameElement;
public IOSElement getNameElement() {
return nameElement;
}
}
And these classes I use smth like this:
Movies movies = ...
List<Movie> items = movies.items; //items is not null
Movie item = items.get(0);
IOSElement fieldElement = item.nameElement; // fieldElement is null
IOSElement methodElement = item.getNameElement(); // methodElement is not null
Why does it work so?
Are there any ways to get element directly from field without creating getter?
Hello,
I'm using new page object design with Widget class. And recently caught some unexpected behaviour.
Let me describe my classes:
And these classes I use smth like this:
Why does it work so?
Are there any ways to get element directly from field without creating getter?