android
. . . private final Locator loginButton = Locator.buildLocator () .web (By.id ("login-button")) // highlight-next-line .android (AppiumBy.accessibilityId ("test-LOGIN")) .name ("Login Button") .parent (this.loginBox) .build (); . . .
filter
. . . private final Locator title = Locator.buildLocator () .web (By.tagName ("h3")) // highlight-next-line .filter (e -> e.getText ().contains ("Some Text")) .name ("Title") .build (); . . .
index
. . . private final Locator title = Locator.buildLocator () .web (By.tagName ("h3")) // highlight-next-line .index (1) .name ("Title") .build (); . . .
parent
. . . private final Locator loginBox = Locator.buildLocator () .web (By.id ("login_button_container")) .android (AppiumBy.accessibilityId ("test-Login")) .name ("Login Box") .build (); private final Locator username = Locator.buildLocator () .web (By.id ("user-name")) .android (AppiumBy.accessibilityId ("test-Username")) .name ("User Name") // highlight-next-line .parent (this.loginBox) .build (); . . .
waitStrategy
. . . private final Locator username = Locator.buildLocator () .web (By.id ("user-name")) .android (AppiumBy.accessibilityId ("test-Username")) .name ("User Name") // highlight-next-line .waitStrategy (WaitStrategy.CLICKABLE) .build (); . . .
web
. . . private final Locator loginButton = Locator.buildLocator () // highlight-next-line .web (By.id ("login-button")) .name ("Login Button") .build (); . . .
getLocator
. . . private final Locator username = Locator.buildLocator () .web (By.id ("user-name")) .android (AppiumBy.accessibilityId ("test-Username")) .name ("User Name") .waitStrategy (WaitStrategy.CLICKABLE) .build (); . . . By locatorElement = username.getLocator (); . . .
Was this page helpful?