Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [page-objects]

Page Object is a design pattern used when creating browser automation.

19
votes
4answers
52k views

How to Implement Page Object and Page Factory Pattern in Selenium Webdriver?

I am a beginner in learning selenium Webdriver. I am not able to understand how page object and factory models works and how it can be beneficial? Kindly help me explain it with detailed ...
18
votes
4answers
4k views

Screen Play vs Page Object pattern

I've recently stumbled upon Senenity/JS framework which advocates the Screen Play pattern, which was proposed as a better alternative to Page Objects. What are the key fundamental differences between ...
15
votes
5answers
6k views

What are the trade-offs of using page objects instead of a collection of functions in UI automation?

I've been using Selenium off and on for the past two years. Recently I've been seeing more references to page objects. (I'm referring to page objects as an means of organizing UI automation code -- ...
6
votes
3answers
3k views

Use Page Object vs other models for Automation in Selenium Webdriver? [duplicate]

I have been doing automation testing since last 2 years and I am following below ways for any website and mobile application automation testing. Create Global Method class where I implement all test ...
10
votes
1answer
385 views

Does the Page Objects pattern scale?

This question asks if the Page Objects pattern for automated GUI testing works for bigger projects. But as the question was focused on a single testing tool/framework I think its a good idea for a bit ...
2
votes
3answers
4k views

PageObject. Should I initialize all pages at start or not?

Java + Webdriver + PageObject. I have a question about pages organization. At this moment I have class which contains all pages in the project. At start all pages are initializing, and it looks like ...
5
votes
1answer
186 views

Canonical way to define page objects/locators in big enterprise level automation projects?

Background: As automation testers in selenium world, we have to work on multiple languages/frameworks(wrappers over selenium) in different projects however there is an one thing which remains common ...
10
votes
4answers
269 views

In Page Object pattern, aren't we creating over-specialized methods than generalized re-usable functions?

Background: In the Selenium UI automation we all have been using Page Objects pattern as the "Best Practice" for years. In Page Objects "methods" are tightly coupled to pages instead of generic ...
8
votes
1answer
2k views

PageFactory and nested page objects

In some languages, like Javascript, you can create a hierarchial structure of Elements within a PageObject, like so: class HomePage { loginBox = { usernameTextBox = findElement(By....
4
votes
2answers
64 views

How you decide the right level of function abstraction in Page object model?

I wonder how people take a call in deciding the right level of function abstraction in Page objects, I sometimes find myself either on a very high level like "CreateOrder" or sometimes very low level ...
13
votes
1answer
4k views

Is Selenium's LoadableComponent a good solution as test design pattern?

I need to refactor my Selenium tests, and come across their LoadableComponent wiki page. I began trying to use it, though I couldn't really understand what is it good for. I took a look at their ...
7
votes
3answers
529 views

What is page object modelling? and Why is it so important?

I have been hearing a lot about page object modelling? Why is it so important? Can someone please outline me page object model? I'm currently working as QE in webservices area
5
votes
4answers
4k views

What framework is Page Object Model

What framework is Page Object Model? I would argue that it is data-driven, since, even though many actions are wrapped in user created methods, it is not totally reliant on keywords. Thus it is not ...
7
votes
3answers
624 views

Is page object a framework or design pattern?

Currently I'm using page object design pattern with testing.
5
votes
1answer
99 views

Hierarchy and names of objects in mapped name of a same object are varying from browser to browser in TestComplete

I'm automating(using record) a functional scenario using TestComplete. The NameMapping future is automatically adding elements to repository and when I run the script in other browser the tool is ...
4
votes
2answers
933 views

Is it a good idea to use Page Object Model with TestComplete?

We're using TestComplete at this company, and we're intertwining a bit of scripting in our Keyword tests. I'm thinking about just turning it into just Page Object Model type tests since the recording ...
2
votes
0answers
73 views

decompose an HTML list with page fragments

note: Looking for simplest possible example of PageFactory and fragments. I've been referencing an article which uses additional libraries I wasn't aware of. The desired structure: Where there's ...
1
vote
3answers
128 views

Flaws in the Page Object Model?

I read this article about flaws in the Page Object Model/POM, authored by a lady at ThoughtWorks - https://blog.getgauge.io/are-page-objects-anti-pattern-21b6e337880f She says that POM leads to ...
1
vote
1answer
87 views

Page Object Model: need help with tests that uses more than 1 page object - Appium-Java-TestNG

I have a framework based on POM model. I am able to write test that only uses elements from 1 page but when I need to access elements from another page tests fail because I think it uses the wrong ...
1
vote
1answer
70 views

POM: driver is passed as an argument? Always?

Example code: Driver is being passed as an Argument so that Selenium is able to locate the element on the browser (driver). Element is returned, so that an Action can be performed on it. ...
1
vote
1answer
603 views

Cucumber not finding @Findby annotations

Im trying to set up cucumber over my page object. I currently have as my login page object: @FindBy (id = cF.username) public WebElement username; @FindBy (id = cF.password) ...
1
vote
2answers
244 views

NullPointerException when using @FindBy

I'm getting a NullPointerException when trying to use @FindBy because the object reference is only declared and not instantiated. What is the usage? The docs give example declaration but no instance ...
0
votes
1answer
142 views

xpath query for specific String value

My project is crashing with: Element info: {Using=xpath, value=//a[contains(text(), 'Books')]/@href}. The output (crash): thufir@dur:~/NetBeansProjects/com.toscrape.books.selenium$ thufir@dur:~/...