1

I have some basic selenium and java experience but I'm trying to learn more about page object pattern and I'm having some problems fully understanding how to use it in an actual project. I've tried looking for simple-yet-functional projects in google that I could copy and look over to see how the pattern was used (how the driver variable is passed from page to page, how the interaction was done, etc) but can't find any in java... do you guys have any idea where I could look or have any projects I could take a look at?.

Thanks!.

Laucien
  • 511
  • 2
  • 5
  • 17
  • Maybe it will make more sense if you think about it the context of a `Factory`? https://en.wikipedia.org/wiki/Factory_%28object-oriented_programming%29 Which is the main use of this. – SiKing Jul 17 '15 at 19:25
  • I have answered something similar [in the edit of this answer](http://stackoverflow.com/questions/18843581/wait-for-elment-webdriver-pageobject-pattern/18844275#18844275) – Erki M. Jul 18 '15 at 03:37

1 Answers1

0

Try the below link page object model is explained in detail

http://www.guru99.com/page-object-model-pom-page-factory-in-selenium-ultimate-guide.html

Hope this helps you

Vicky
  • 2,999
  • 2
  • 21
  • 36
  • Yeah I've gone over that page but it sorta clashes with some of the things I've read about the pattern in other sites. For example that in pageObject a class should always return another pageObject element/class... like the method "loginWithValidUser" in the login object should return the object homePage. – Laucien Jul 17 '15 at 19:00
  • 1
    Hi @Laucien No i would say that is not always the case.. the main goal of Page Object model was to separate the operations in the UI from verification part and to make POM classes independent of testcases so that they can be reused – Vicky Jul 17 '15 at 19:33