Questions tagged [page-objects]

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

Filter by
Sorted by
Tagged with
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 ...
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 ...
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 ...
3
votes
2answers
2k views

Does WebDriver simulate mouse clicks? [closed]

The question came to me from our team, we are using the WebDriver for our browser testing and accessing our pages using the Page Object model. There is a sporadic problem with a page that begins to ...
1
vote
1answer
1k views

Add reusable code to existing protractor page objects file

I inherited 45 spec files with correlating page object files that are used only to locate elements on the pages. I am trying to create reusable code, is it best practice/can additional exports be ...
1
vote
1answer
4k views

Locating ng-click in protractor

I cannot figure out how to locate ng-click in the page object file for the code below: <a ng-click="toggleGuestParams('personal')" class="ng-click-active">Select/Unselect All</a> There ...
5
votes
1answer
228 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 ...
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 ...
2
votes
4answers
275 views

Importance of selenium Framework

I am just finish my selenium code. I'm following page object pattern. My code does not follow any frameworks. My senior who reviewed my code said that:: You need to keep the test data separately. Not ...
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 ...
1
vote
1answer
672 views

Can you create a Page Object Model framework inside of TestComplete?

I have some experience with using Selenium and Python to set up testing frameworks for web applications using the Page Object pattern. However, my current employer wishes to keep all of our tests ...
2
votes
3answers
160 views

What is the most standard way to use POM in Selenium?

I have a login page in my application which I am trying to automate. Should that be automated with a POM class which has a different function for each action, like this: public class LearningPOM { ...
1
vote
1answer
2k views

Specflow Page Object Model Maintainability

I was wondering if anyone could assist in a Code Review on my Specflow Page Object Model code. I have included a small sample of the code I use, most of the pages follow identical patterns. Step ...
1
vote
1answer
925 views

Facing problem while returning page objects from a method based on the arguments provided to the method

In the web application i am trying to automate there is a Login page and a Secure page. When user enters valid credentials in Login page s/he is navigated to Secure page with a success message. If ...
1
vote
1answer
759 views

How to use properties (element locators) from another class

As on the image I have few elements on the POMLogin.java class (which i think I am following POM). And I need to access these elements from another class which is jUnitLogintest.java How am i going ...
0
votes
1answer
165 views

Selenium Dynamic Selectors for WebElements

I am building a testing framework, my objective is to test many websites that have similar pages with light difference between each other using this framework. I have an issue where I want ...
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; ...
1
vote
2answers
432 views

Page object practices

I am building a testing framework for a website using Page Object Model with Selenium I am thinking that in general if I have two pages with the exact user controls and functions but different URLs I ...
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 ...
1
vote
0answers
98 views

Which is the better way of initializing elements in a page object? [duplicate]

I know that elements in page objects can be initialized and used in both the following ways Option 1: public class LoginPage { WebDriver driver; By usernameLocator = By.id("username"); ...
2
votes
2answers
735 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 ...
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 ...
2
votes
2answers
6k 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 ...
1
vote
1answer
79 views

Some text boxes doesn't automate

I am automating a scenario. I am using selenium with page object. Here some text fields doesn't enter the value.. There is no error in the program no error in console. locators are correctly ...
0
votes
1answer
3k 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' ?
3
votes
3answers
289 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
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 ...
2
votes
1answer
2k 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. ...
1
vote
2answers
19k 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
1answer
2k 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 ...
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
3
votes
5answers
957 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(); page....
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 -- ...
2
votes
2answers
97 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
123 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, ...
0
votes
2answers
465 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
666 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> ...
1
vote
1answer
61 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?
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....
1
vote
1answer
161 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 correct....
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 ...
0
votes
2answers
854 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 ...
2
votes
2answers
85 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 ...
0
votes
2answers
557 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 ...
3
votes
2answers
145 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:...
2
votes
7answers
2k 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 ...
3
votes
3answers
3k 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 ...
2
votes
3answers
6k 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 ...
1
vote
1answer
456 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 ...