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

learn more… | top users | synonyms

23
votes
9answers
9k 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 ...
13
votes
5answers
3k 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 -- ...
11
votes
1answer
3k 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
1answer
150 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 ...
7
votes
1answer
9k 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 ...
6
votes
1answer
892 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 ...
5
votes
3answers
408 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
4
votes
2answers
249 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 ...
4
votes
3answers
376 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 ...
4
votes
4answers
16k 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. ...
4
votes
3answers
2k 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 ...
4
votes
1answer
4k 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 ...
4
votes
1answer
209 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 ...
3
votes
2answers
95 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 ...
3
votes
2answers
35 views

Where to define the selector for the navigation step - PageObject vs. Test Class?

I am using Selenium webdriver using the Page Object Model. My question is, where would it be best practice to define the navigation step selector? Should it be in the page object class or in each of ...
3
votes
1answer
294 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 ...
3
votes
1answer
77 views

Actions to search item and number of methods

I have questions about clean code. I'm writing a test in Java selenium page factory. I'm a beginner. I have two "actions", input text into search field and click button search. Now the question is, ...
3
votes
5answers
192 views

Webdriver - Page Object Validator

For a while I wrote test for our web application using the Page Object framework. But test after test, I notice, I always wrote the same kind of assert. MyPage page = navigateToMyPage(); ...
2
votes
7answers
298 views

Website with complex functionalities?

I'm tired of test automation because I don't feel challenged anymore. 99% of all automation I work with is straight forward, with click and type and no heavy logic. Any tips on websites with very ...
2
votes
1answer
1k views

Best approach for Page Object Model Framework where the page structure changes very frequently

We are developing Page Object Model Framework for our web application test. The problem is we are having three different structure for the same page type. We want our automation to work in all cases. ...
2
votes
4answers
159 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 ...
2
votes
2answers
674 views

Do I need the PageObjects design pattern or not?

Right now I have a Selenium WebDriver framework that looks like this (vastly simplified): \app_func.py -- app_func has the web app's "actions", such as "save a new search" \app_data.py -- app_data ...
2
votes
2answers
55 views

How to document my page object

What are some efficient and non-tedious ways to document my page objects? What I first did was take screen shots of my screen and label each page object to its corresponding web element but this ...
2
votes
1answer
263 views

Alternative automated test design patterns for the Page Objects pattern

I was wondering if there are alternative patterns for the Page Objects pattern. What possible design patterns are there for automated GUI testing? Looking for: Description and pro's and con's ...
2
votes
3answers
2k views

Cannot Instantiate class error - Selenium WebDriver

I am facing this 'Cannot insantiate class' error on running one of my test cases in Selenium webdriver using Java. Below is the class of the functionality of the test, package Pages; import ...
1
vote
1answer
71 views

Need info about WTWebUIAUTO package in .NET

I have recently gone through a Test Automation pattern i.e., BeyondPageObjectpattern in Selenium. While going through the code I came across a package WTWebUIAuto. Can anybody give me some info about ...
1
vote
1answer
74 views

C# Web Driver Page Object Framework: Retrieve Dollar Values from a <td> using class identifier

I am creating an C# / Web Driver automation script that uses a Page Object Framework. I would like to check certain dollar amounts on a page (premium and tax amounts) and verify that they are ...
1
vote
1answer
106 views

Selenium Timing Issue With Dialogs (Widgets) In Current Page

EDIT: I have narrowed the problem to its possible source see Update 2 and you can skip the intro. My issue is that selenium "thinks" it has clicked a link when the link click was never actually ...
1
vote
1answer
42 views

How can I move all my seleniumIDE locators to javascript variables (like page objects)?

My locators are all hard-coded into the tests. How can I extract these into variables?
1
vote
0answers
323 views

Page Object Design: Is there a Javascript equivalent to Ruby gem “site_prism”

I'd like to know if there is a framework in Javascript (NodeJS) for Protractor which supports a clean way to define the Page Object Elements on a Page Object as site_prism does. I've already checked ...
1
vote
1answer
274 views

Selenium WebDriver - how to cleanly code with PageObjects in combination with By locators?

I'm using the PageObjectModel as I'm understanding it. The FindsBy elements are instantiated by the PageFactory (in the constructor) public class wizard_Uittreksel_Bestemmeling { private readonly ...
1
vote
1answer
519 views

Best resources for learning Ruby/Cucumber/Rspec test suite organization and refactoring [closed]

I'm working with a Cucumber suite that needs refactoring and organization. The end goal is to have a maintainable suite of tests that matter enough that developers will stop if the cucumber tests are ...
1
vote
0answers
68 views

Any experience in generating UI pages and test wrappers for UI? [closed]

Imagine that there is a non-trivial logic in the page, for example: IF element E1 in dropdown D1 is selected THEN button B1 is disabled ELSE B1 is enabled IF element E2 in dropdown D2 is selected ...
1
vote
1answer
258 views

WebDriver - Using loadablecomponent design for URLs with query parameters

For example if the url is - http://blah.com?origin=home&id=54&level=2. This could be a dynamically generated link on a webpage with 'id' and 'level' values from the DB. Now if i want to use ...
0
votes
2answers
63 views

What do you assert in a test that causes navigation?

I'm looking for methods to assert that an action caused the expected navigation. For example, after logging out, I want to assert that I'm back at the login page. At first I did an assert on the ...
0
votes
1answer
43 views

How to use pagefactory in POM? why we pass parameters in pagefactory? [duplicate]

While developing a script using Page Object Model, we use PageFactory.initElements(driver,this) to initialize the webelement. How this is done and why we pass parameters 'driver' and 'this' ?
0
votes
2answers
136 views

Selenium - Best practice, mapping an object to HTML form?

I was wondering if anyone uses a design pattern where there is an object (similar to a page object) which has fields for each input in an HTML form. I guess the fields would be nullable and then the ...
0
votes
3answers
107 views

Page Factory @FindBy

I am currently learning page object model (POM) and I am trying to access a specific web element using @FindBy but I am not sure how to correctly write the syntax for my element into @FindBy? What I ...
0
votes
1answer
271 views

Blank screenshot with WebDriver

Im not sure why, but ever time my screenshot is executed, the images are saved as blank. heres the code: public void screenshotOnError() throws IOException { WebDriver driver = new ...
0
votes
2answers
801 views

XPath not recognised in page object model in WebDriver [closed]

xpath not recognised in page object model in webdriver. @FindBy(xpath = "//td[contains (text(),'xxx')]") public WebElement topMenu; topMenu.click(); Error: Unable to locate element: ...
0
votes
2answers
31 views

How to resolve NullPointerException error in my below POM code?

I am getting java.lang.NullPointerException while executing my test case , I am using Page Object Modle with PageFactory ,following are the code snippets LoginPageObjec.java public class ...
0
votes
2answers
27 views

I am getting java.lang.NullPointerException while executing my test case

I am getting java.lang.NullPointerException while executing my test case , I am using Page Object Modle with PageFactory ,following are the code snippets TestBase Class: ackage com.base; import ...
0
votes
1answer
80 views

Need help with getting list of items in Page factory, c#

I am new to Page factory model - I need number of elements in list, I am trying in the following way: **[FindsBy(How = How.XPath, Using = "//*[@id='ABC']/div")] public List<IWebElement> ...
0
votes
2answers
173 views

What exactly should be in a page object?

I'm having a bit of a hard time designing my page object. What sort of methods should be in there? Should I put wrapper methods for driver functionalities (e.g driver.findElement(...)) or shall I ...
0
votes
3answers
474 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 ...
0
votes
1answer
131 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) ...
0
votes
1answer
125 views

Getting NPE on screencapture with an error

I am currently setting up PageObject with PageFactory Automation tests. I currently have a screenCapture.java and I try to call the method within the screenCapture when there's an error. Here is the ...
0
votes
1answer
312 views

Setting up Page Objects with python and seem to be getting every error possible

WebTeam init.py BasePage.py UIMap.py Pages: init.py Common.py ContactPage.py test: init.py CompetitorsTest.py CreateAnonData.py CreateKnownData.py import unittest ...
0
votes
0answers
33 views

Can we use Data Driven approach with Page Object model using Page Factory, any example or link will help

Can we use Data Driven approach with Page Object model using Page Factory, any example or link will help. I am trying to implement POM with PageFactory but at the same time I want to make it data ...
0
votes
0answers
57 views

AjaxElementLocatorFactory = Implicit or Explicit

I'm looking for solution in page factory to wait. I don't want to use something like Implicit wait, but something like Explicit. I read about AjaxElementLocatorFactory, but I'm not sure that it ...