Skip to content

Page Object design extension question #320

Description

@SergeyErmakovMercDev

Hello,
I'm using new page object design with Widget class. And recently caught some unexpected behaviour.
Let me describe my classes:

publicclassMovies {
@iOSFindBy(uiAutomator = ".tableViews()[0].cells()")
publicList<Movie> items;
}
publicclassMovieextendsWidget {
@iOSFindBy(uiAutomator = ".staticTexts()[0]")
publicIOSElementnameElement;
publicIOSElementgetNameElement() {
returnnameElement;
}
}

And these classes I use smth like this:

Moviesmovies = ...
List<Movie> items = movies.items; //items is not nullMovieitem = items.get(0);
IOSElementfieldElement = item.nameElement; // fieldElement is nullIOSElementmethodElement = item.getNameElement(); // methodElement is not null

Why does it work so?
Are there any ways to get element directly from field without creating getter?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions