Questions tagged [page-objects]

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

Filter by
Sorted by
Tagged with
28
votes
9answers
11k views

Page Objects design issues

I have started using the Selenium 2 /Webdriver web automation framework a couple of weeks ago and I'm generally pleased, but I find myself unsure about how to best design my Page Objects. The ...
21
votes
4answers
58k 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 explanation....
17
votes
4answers
7k 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
7k 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 -- ...
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 ...
10
votes
1answer
412 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 ...
9
votes
4answers
557 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 ...
9
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....
8
votes
6answers
646 views

Page Object Model how much abstraction? [duplicate]

When developing a page object model, the whole intention is generally to abstract the page into methods that keeps code reusable and increase readability. Something I often get stuck on how high of a ...
8
votes
1answer
13k views

How to use Selenium's PageFactory annotations with dynamic loaded elements?

I'm rewriting some Selenium tests according to the page object design pattern taking advantage of Seleniums' annotations. My problem is that I have some html select elements whose option elements are ...
7
votes
2answers
6k views

How do I split my PageObject Model classes?

My page object model class is getting rather long. Should I create a different class with the same name as the page object model with a 2 added at the end. Or does this go against the page object ...
7
votes
1answer
3k views

POM vs PageFactory

I'm starting my career as a QA Automation Engineer coming from a Jr dev background. I noticed that there are two main design patterns for Selenium, POM and PageFactory. Which is the preferred design ...
7
votes
3answers
551 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
7
votes
1answer
1k views

PageObjects: Aggregation/Composition vs Inheritance for nested components

I need to refactor my Selenium tests, and was wondering what the best design solution would be for a portal with a hierarchical page organization. We are using tiles, and we have defined a baselayout ...
6
votes
3answers
501 views

Is the Page Object Pattern the ideal approach for browser automation for a website which has a front-end that has frames in frames?

I'm confronted with a web application which has a front-end that has frames in frames in frames. Regarding automated UI Tests with Selenium and Cucumber, is the Page Object Pattern the right approach ...
6
votes
3answers
711 views

Is page object a framework or design pattern?

Currently I'm using page object design pattern with testing.
6
votes
2answers
275 views

Page Object Model: How much abstraction is necessary?

So i've been working on a Page Object Model framework for a large web application for our current company. It's the first time i've made my own framework and implemented the page object model. Im ...
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 ...
6
votes
2answers
1k views

Include assertions/expectations within the Page Objects, yes or no?

Martin Fowler favors having no assertions in page objects however is not definitive on the subject: Advocates of including assertions in page objects say that this helps avoid duplication of ...
6
votes
2answers
2k views

Extending or passing the driver in page objects?

I have 2 different ways of working with the driver in the page object model: Creating the driver in all the pages and passing it from one class to another. You have an example here. Extending the ...
6
votes
1answer
5k views

How should I organize a TestNG suite for Selenium 2 WebDriver tests that use page objects?

I'm trying to organize a functional test suite for the UI in a CRUD web application using TestNG-style Selenium 2/WebDriver tests. I've isolated page-interaction logic into distinct page objects, and ...
6
votes
1answer
190 views

How would you convince someone that the Page Object Model pattern is important?

I'm looking for canonical answers explaining the importance and advantages of the Page Object Model design pattern, specifically answers that I could point to for people who claim the pattern is ...
5
votes
3answers
761 views

How to design automation framework when the app to be tested has 500 web pages?

I have a web application which has around 500 pages. Can we use POM framework and if so, is it a good practice? if not, please suggest some ideas.
5
votes
4answers
5k 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 ...
5
votes
4answers
2k views

How to choose page object design & structure

We had a discussion between several automation engineers on page object design, specifically about how many layers it should have and what are the responsibilities of the layers. I hope you guys could ...
5
votes
4answers
921 views

Does page factory pattern improve Selenium test performance

Is there any major performance difference between the traditional way of finding web elements vs using the page factory pattern? public WebElement username=driver.findElement(username).sendKeys(...
5
votes
1answer
110 views

PoM Design/Architecture questions

Apologies if this is an improper question, as it's actually a multi-part question (But it seems like unnecessary clogging of the site to make multiple posts). Im writing my first PoM framework, it's ...
5
votes
1answer
390 views

Structure of page object-based test projects

Are there techniques and/or best practices to create and manage the structure of page object-based test projects? I'm not concerned about the implementation of the page objects, but rather how to ...
5
votes
1answer
211 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 ...
5
votes
3answers
431 views

Page Object Model confusion with Automation?

So i've been researching the Page Object Model when composing an automation framework. Most examples are done in Java, but since im using Capybara with Selenium Webdriver (Ruby) for Rails, I imagine ...
5
votes
2answers
2k views

How do I structure my Python project based on the Page Object Model

I'm currently trying to implement a base for my automated tests based on the page object pattern with Python, Selenium and Behave. I've never really worked in a reasonably big QA project, especially ...
5
votes
1answer
227 views

Page object Model discussion

I am building a test framework for my Website using Selenium, I actually want your ideas of good practices when using Page Object Model: let us say that I have a Welcome page that contains a header ...
4
votes
1answer
391 views

Selenium PageFactory vs Page Object Model

I've created a framework in C# using the Page Object Model for fun and am now creating a framework in Java to learn Jenkins etc... also for fun. I have come across the PageFactory concept for Java ...
4
votes
4answers
379 views

How to deal with huge PageObject using POM in Selenium?

I've got a question about dealing with huge PageObject. In the website that I'm currently testing there is a form with circa 50 inputs/dropdowns/selects. In the current state my class got about 900 ...
4
votes
1answer
19k views

What does PageFactory.initElements(driver, this) do?

What I think is that this involves the lazy loading mechanism, where the loading of the page factory WebElements are deferred till it's required. Now if this is the cases then what's the need of ...
4
votes
5answers
2k views

POM Framework Design with Global Elements

New to C#, started learning in order to do test automation using Selenium C# with MS Visual Studio. Currently a manual tester. I've been building a testing framework using TDD and the POM pattern. I'...
4
votes
2answers
2k views

How to reduce the repetition of code?

I am using page object pattern with java language.First step is driver initialization then go to login page.These steps are repeatable in every test pages. Here is my code.. util package util; ...
4
votes
1answer
138 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
239 views

Page Object Model in Selenium [duplicate]

I never had to test an application with Page Object Model, so trying to study up on that. Questions: Is it true that it is only used when you need to enter different sets of data into the same edit ...
4
votes
2answers
1k 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 ...
4
votes
3answers
4k views

How to implement Page Objects Pattern for an utter dynamic page

Can any one throw some ideas for the best approach for implementation of page object in the below case? - The more the ideas the better - please do write what ever you think small or big dosent matter....
4
votes
1answer
1k views

Java + Selenium + log4j: How to write generic function for Logging in pagefactory? Possible?

I have written a selenium framework using page object design pattern. To make it better I am also using PageFactory. Example: BasePage.java @FindBy(xpath= FinalLocators.userName) WebElement uname; @...
3
votes
3answers
263 views

How to use Page Objects in this scenario?

I have a website with a home page that requires a user to be authorized or logged in to see all pages of the website. If you try to access the home page, but you are not logged in, then the website ...
3
votes
3answers
3k views

Test data couldn't able to read from properties file

I got an error in my selenium program. I am using page object design pattern. And I want reading test data from properties file. But it couldn't able to read ? Any one please help me to solve page ...
3
votes
3answers
287 views

Page objects - use a separate method for each step or 1 method for all steps?

I just want to ask ideas from you on which is more appropriate to use. I'm currently automating a project using Selenium Webdriver adapting the Page Object Model approach. In the midst of my testing, ...
3
votes
2answers
81 views

Selenium WebDriver - should explicit waits be held in the test method or within the page object?

As the question title says: If you're putting a test together and you need to wait for an item to be displayed (as an example), is it best to put the explicit wait within the test or against the page? ...
3
votes
4answers
5k views

Test strategy for sorting

What will be a good test strategy to test sorting? I have a scenario where when clicking on a sort, i.e. sort the make/model from Z to A, then the listing should be sorted alphabetically from Z to A....
3
votes
2answers
144 views

What high level operations should be tested on a page from Automation perspective?

I'm interested in defining a minimum set of high-level operations which should be validated over a page using the Page Object Model in Selenium Automation Framework. So far I know about the following:...
3
votes
2answers
1k views

How do I make my test code DRY?

My test code has a lot of repetition. First I login to my page then go to the client registration page. Here you can see the repeated code for login. For each page I write first login then current ...
3
votes
1answer
21k views

How do I extract the inner element in Selenium?

I am new to Selenium and C#, which we are using right now. I am also new to using the Page Object model, to make our codes readable. Though I am having troubles using the FindsBy, so my original code ...