Background:
Using Appium 2.0 with XCUITest and UiAutomator2 drivers, groovy as the language and extending Geb’s Module, Page and GebReportingSpec.
I have some elements on a page header that recur on most pages of our app. Therefore, I would like to move these into a module that is referenced in the content section of our BasePage.
So I’m moving the elements like headerText { findByResourceId('header_text') }
from BasePage into HeaderModule and then including header { module HeaderModule }
in the content section of BasePage.
However, when I move these elements from the BasePage’s content section into a module, appium is not able interact with the module well and gives the following errors.
For Android:
homePage.header.headerText.displayed | | | org.openqa.selenium.NoSuchElementException: An element could not be located on the page using the given search parameters.
For iOS:
homePage.header.headerText.displayed | | | groovy.lang.MissingPropertyException: Unable to resolve header as content for com.gravie.member.pages.HomePage, or as a property on its Navigator context. Is header a class you forgot to import?
Has anyone encountered and overcome this issue?