PageObjects gets elements API instead of element API
See original GitHub issue@TikhomirovSergey need help on this
Works fine
@HowToUseLocators(androidAutomation = CHAIN)
@AndroidFindBySet({
@AndroidFindBy(xpath = "(.//*[@resource-id='org.wordpress.android:id/note_content_container'])[position()=2]"),
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"org.wordpress.android:id/note_subject\")")
}) //gets the third text from the note_subject view
Does not work
@HowToUseLocators(androidAutomation = CHAIN)
@AndroidFindBySet({
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"org.wordpress.android:id/note_content_container\").enabled(true).instance(2)"),
@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"org.wordpress.android:id/note_subject\")")
}) //return the first text from the view
https://gist.github.com/anonymous/d4440cab5e3213f9084498471201cd84
The above works fine, when we cast AndroidDriver
((AndroidDriver) driver).findElementByAndroidUIAutomator("new UiSelector().resourceId(\"org.wordpress.android:id/note_subject\").enabled(true).instance(2)").getText()
https://gist.github.com/anonymous/3b1fcc5761c370a1025d52c42b60b9fd
Issue Analytics
- State:
- Created 7 years ago
- Comments:18 (18 by maintainers)
Top Results From Across the Web
Page object module - API Reference | Nightwatch.js
This is used to access those commands that are not part of the subset of commands within the page object API. elements, Object,...
Read more >switch between page object api and main nightwatch api
1st : api will return this.api instead of this page-object so we are only able to call this page object via page
Read more >Stop using Page Objects and Start using App Actions - Cypress
In this post I argue that page objects are a bad practice, ... addTodo to add items directly using the application's internal “api”....
Read more >Automation in Selenium: Page Object Model and Page Factory
Webpage classes or Page Objects containing web elements need to be initialized using Page Factory before the web element variables can be used....
Read more >Page Object Pattern - WebdriverIO
Version 5 of WebdriverIO was designed with Page Object Pattern support in mind. By introducing the "elements as first class citizens" principle, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yes. It is here https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/pagefactory/AppiumElementLocator.java#L157
I really think that root cause is here. But I can check it only tomorrow or on the 1 Jan.
Yep. I will try to search for the root cause on the 1 Jan. For now please use xpath instead.