You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make AppiumDriver page factory/objects compatible #22
I think appium's java-client should support the PageFactory as it's popular. I have an example page object pattern in the tutorial. It avoids the PageFactory class though as I don't think it makes sense for native mobile.
ruby_lib supports the page object pattern. PageFactory is a Java implementation of this pattern so it's not working on other languages. Each language has a slightly different take on how to do page objects. I think it won't take too much work to update java-client so PageFactory works.
@abhinavn : as for a timeline, not quite sure. I'm working on submitting pull requests to the regular Selenium Webdriver project, so java-client can be simpler.
This isn't just my project though. Feel free to submit a pull request of the implementation...
PageFactory works well with AppiumDriver against browsers (both Android Chrome and Mobile Safari). But I didn't try to instantiate PO that presents functionality of mobile app. I will try it soon. If problems there they will be posted.
I am also using PageFactory in all of our pages and this issue prevent from us to migrate from WebDriver to AppiumDriver.
It will be great to have it in the AppiumDriver as well so we could gain the benefits of AppiumDriver.
When I am executing IOSPageFactoryTest through junit it is giving the below error for ios11 real device:
Nov 21, 2017 8:19:23 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
Activity
abhinavn commentedon May 13, 2014
cc: @Jonahss , @bootstraponline
bootstraponline commentedon May 13, 2014
I think appium's java-client should support the PageFactory as it's popular. I have an example page object pattern in the tutorial. It avoids the PageFactory class though as I don't think it makes sense for native mobile.
abhinavn commentedon May 13, 2014
👍
As tests get as complex as it can, PageFactory support is big win.
@bootstraponline - Does ruby_lib support PageFactory?
bootstraponline commentedon May 13, 2014
ruby_lib supports the page object pattern. PageFactory is a Java implementation of this pattern so it's not working on other languages. Each language has a slightly different take on how to do page objects. I think it won't take too much work to update java-client so PageFactory works.
alatyshev commentedon May 13, 2014
I am also facing this issue, voting for enhancement.
abhinavn commentedon May 16, 2014
@Jonahss : Any timeline when we can expect this feature? I am really not interested in rewriting my tests without Page Objects
cc: @bootstraponline
alatyshev commentedon May 16, 2014
You can cast WebDriver object "driver" to AppiumDriver, for example:
((AppiumDriver) driver).sendKeyEvent(AndroidKeyCode.ENTER);
This allows me to use AppiumDriver with PageFactory.
Jonahss commentedon May 16, 2014
@abhinavn : as for a timeline, not quite sure. I'm working on submitting pull requests to the regular Selenium Webdriver project, so java-client can be simpler.
This isn't just my project though. Feel free to submit a pull request of the implementation...
abhinavn commentedon May 16, 2014
@alatyshev - Not a fan of doing too much casting, thanks for suggestion
@Jonahss - Sure. Thanks
TikhomirovSergey commentedon May 26, 2014
PageFactory works well with AppiumDriver against browsers (both Android Chrome and Mobile Safari). But I didn't try to instantiate PO that presents functionality of mobile app. I will try it soon. If problems there they will be posted.
achiarifman commentedon Jun 4, 2014
I am also using PageFactory in all of our pages and this issue prevent from us to migrate from WebDriver to AppiumDriver.
It will be great to have it in the AppiumDriver as well so we could gain the benefits of AppiumDriver.
Jonahss commentedon Jun 4, 2014
Duly noted, I'll put more priority on this issue.
In the meantime, @alatyshev has a comment above showing a workaround.
You can cast WebDriver object "driver" to AppiumDriver, for example:
((AppiumDriver) driver).sendKeyEvent(AndroidKeyCode.ENTER);
This allows me to use AppiumDriver with PageFactory.
TikhomirovSergey commentedon Jun 22, 2014
Hi, guys!
I tried to make page objects using AppiumDriver and PageFactory for apps.
Result you can see here (BBC News https://github.com/TikhomirovSergey/primitive/tree/master/primitive/src/test/java/mobiledescription/android/bbc) and here (Selendroid test app https://github.com/TikhomirovSergey/primitive/tree/master/primitive/src/test/java/mobiledescription/android/selendroid/testapp). Examples for iOS will be prepared soon.
There is an example of a test (Android on a Genymotion emulator for now): https://github.com/TikhomirovSergey/primitive/blob/master/primitive/src/test/java/mobiletest/MobileTestExamples.java
I won't tell you about some details now. But both AppiumDriver and PageFactory are used there without any workaround. These examples work well.
But I think it would be nice if WebElement could be instantiated this way (for example)
@findby(ByAndroidUi = "new UiSelector()...bla bla bla")
WebElement someElement;
instead of
driver.findElementByAndroidUIAutomator("new UiSelector()...bla bla bla")
But, as for me it is not crucial.
Have a nice day.
Jonahss commentedon Jun 23, 2014
cool, thanks @TikhomirovSergey
Create issue #52 for adding
conan55 commentedon Jul 2, 2014
We need at @findby equivalent for:
driver.findElement(MobileBy.AccessibilityId("Done"))
conan55 commentedon Jul 2, 2014
FindBy doesn't support MobileBy.
Jonahss commentedon Jul 28, 2014
This should be fixed by #68 thanks to @TikhomirovSergey
samsonbarukula commentedon Nov 17, 2017
how to initialize iosDriver for POM
can you pls give example
saikrishna321 commentedon Nov 20, 2017
@samsonbarukula https://github.com/appium/java-client/blob/master/src/test/java/io/appium/java_client/pagefactory_tests/IOSPageFactoryTest.java
samsonbarukula commentedon Nov 21, 2017
Can you please show / send the path of the class from where this IOSPageFactoryTest.java is called...
samsonbarukula commentedon Nov 21, 2017
thank you sai...
samsonbarukula commentedon Nov 21, 2017
When I am executing IOSPageFactoryTest through junit it is giving the below error for ios11 real device:
Nov 21, 2017 8:19:23 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
can you help pls
conan55 commentedon Nov 22, 2017