Skip to content

Make AppiumDriver page factory/objects compatible #22

Closed

Description

@abhinavn

Currently AppiumDriver doesn't support page factory or objects?

Any workaround with this?

Thanks

Activity

  1. abhinavn commented on May 13, 2014

    @abhinavn
    Author
  2. bootstraponline commented on May 13, 2014

    @bootstraponline
    Member

    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.

  3. abhinavn commented on May 13, 2014

    @abhinavn
    Author

    👍

    As tests get as complex as it can, PageFactory support is big win.

    @bootstraponline - Does ruby_lib support PageFactory?

  4. bootstraponline commented on May 13, 2014

    @bootstraponline
    Member

    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.

  5. alatyshev commented on May 13, 2014

    @alatyshev

    I am also facing this issue, voting for enhancement.

  6. abhinavn commented on May 16, 2014

    @abhinavn
    Author

    @Jonahss : Any timeline when we can expect this feature? I am really not interested in rewriting my tests without Page Objects

    cc: @bootstraponline

  7. alatyshev commented on May 16, 2014

    @alatyshev

    You can cast WebDriver object "driver" to AppiumDriver, for example:

    ((AppiumDriver) driver).sendKeyEvent(AndroidKeyCode.ENTER);

    This allows me to use AppiumDriver with PageFactory.

  8. Jonahss commented on May 16, 2014

    @Jonahss
    Member

    @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...

  9. abhinavn commented on May 16, 2014

    @abhinavn
    Author

    @alatyshev - Not a fan of doing too much casting, thanks for suggestion

    @Jonahss - Sure. Thanks

  10. TikhomirovSergey commented on May 26, 2014

    @TikhomirovSergey
    Contributor

    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.

  11. achiarifman commented on Jun 4, 2014

    @achiarifman

    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.

  12. Jonahss commented on Jun 4, 2014

    @Jonahss
    Member

    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.

  13. TikhomirovSergey commented on Jun 22, 2014

    @TikhomirovSergey
    Contributor

    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.

  14. Jonahss commented on Jun 23, 2014

    @Jonahss
    Member

    cool, thanks @TikhomirovSergey
    Create issue #52 for adding

    @FindBy(ByAndroidUi = "new UiSelector()...bla bla bla")
    WebElement someElement;
    
  15. conan55 commented on Jul 2, 2014

    @conan55

    We need at @findby equivalent for:

    driver.findElement(MobileBy.AccessibilityId("Done"))

  16. conan55 commented on Jul 2, 2014

    @conan55

    FindBy doesn't support MobileBy.

  17. Jonahss commented on Jul 28, 2014

    @Jonahss
    Member

    This should be fixed by #68 thanks to @TikhomirovSergey

  18. samsonbarukula commented on Nov 17, 2017

    @samsonbarukula

    how to initialize iosDriver for POM
    can you pls give example

  19. samsonbarukula commented on Nov 21, 2017

    @samsonbarukula

    Can you please show / send the path of the class from where this IOSPageFactoryTest.java is called...

  20. samsonbarukula commented on Nov 21, 2017

    @samsonbarukula

    thank you sai...

  21. samsonbarukula commented on Nov 21, 2017

    @samsonbarukula

    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

  22. conan55 commented on Nov 22, 2017

    @conan55
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