Questions tagged [pageobjects]

A design pattern to represent a web page as an object. Usually used in UI / end-to-end testing and browser automation.

A page object provides access to a web page. In its implementation, a page object typically makes use of a web driver like or . The page object hides the html and web driver details, and provides an abstract interface to the page in terms of its application domain.

The page objects are subsequently used to create end-to-end test scenarios that click through the application. The use of page objects make these tests easier to maintain when details of the underlying pages change.

This tag can be used for questions on the design, implementation, and use of page objects for end-to-end testing of web applications.

More information:

845 questions
11
votes
5 answers

How to avoid Compound Class name error in Page Object?

When I try to use the class name that having space class = "country name" in page object, I'm getting: Compound class names not permitted Selenium::WebDriver::Error::UnknownError) How can I use the class name that having space. Eg: class = "country…
KAK
  • 905
  • 4
  • 14
  • 33
10
votes
2 answers

Can multiple operations with Streaming break The Law of Demeter?

I went little fancy and wrote Selenium page-object with Java 8 streaming as mentioned in below code and got a review comment that my code is breaking Law of Demeter, since I am doing lot of operations in a single line. I was suggested to break the…
10
votes
5 answers

Selenium WebDriver page object

Quick question about page objects in selenium webdriver. our site is very dynamic with lots of ajax and various authentication states. It is tough to figure out how to define each page object BUT lets say I have figured that out and defined…
ducati1212
  • 855
  • 9
  • 18
  • 29
9
votes
1 answer

Combining Galen and Protractor frameworks

The Story We've been using Protractor framework extensively and have established a rather large test codebase. We've also been following the Page Object pattern to organize our tests. Recently, we've started to use the Galen framework to fill the…
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
9
votes
1 answer

How to initialize SelectElements while using PageFactory / FindsBy in Selenium C#?

I am building a Page Object Model in Selenium WebDriver for C#, using the PageFactory. Unfortunately, I have discovered that the FindsByAttribute will not initialize a SelectElement (HTML