Questions tagged [page-objects]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
806 views

How to use the page object model pattern in C# without deprecated libraries

What can I use as an alternative option to the soon-to-be deprecated OpenQA.Selenium.Support.PageObjects library? I still want to make sure I encapsulate the elements and be able to assemble the ...
0
votes
3answers
2k views

How to resolve 'No such element exception'?

I am getting below error even though I was using correct identifier. No such element exception: Unable to locate element: {"method":"id","selector":"input_001"} HTML Code: <input type="text" ...
9
votes
4answers
554 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 ...
0
votes
2answers
838 views

How to parameterize locator in Selenium

I am new to selenium, And In my scenario I need to select a product for list of products in the page. And Product name to select is a test data. Now my query is,Can I create Object in Class level ( ...
3
votes
2answers
114 views

Using different sets of page objects with the same selenium tests

[This is cross-posted from StackOverflow - https://stackoverflow.com/questions/51702719/using-different-sets-of-page-objects-with-the-same-selenium-tests] I'm working on a selenium test suite for a ...
2
votes
3answers
3k views

Selecting element value from drop down list with selenium using POM

I'm trying to make a simple test to register in website - https://www.midomi.com/. I'm using c# and selenium but have stuck in selecting values from a dropdown list using Page object model. My project ...
0
votes
1answer
530 views

Cucumber - Feature file with page object model approach

I am totally new to cucumber, I am using page object model approach. Let's say I have 3 page and 3 test classes Ex: login Page.java / loginTest.java Registration Page.java/Registration Test.java ...
1
vote
1answer
111 views

Is there a C# equivalent for @FindAll in Java

Java's @FindAll allows the user to match at least one of the given criteria e.g. @FindAll({ @FindBy(className = "class1") @FindBy(className = "class2") }) private List<WebElement> ...
0
votes
1answer
311 views

NullPointerException in Webdriver/POM implementation

I have the code that is supposed to implement Page Object Model pattern using WebDriver. package com.practice; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa....
5
votes
3answers
430 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 ...
0
votes
2answers
635 views

How to resolve Null pointer Exception?

Class 1: Logintest: import Utility.BrowserFactory; import org.testng.annotations.BeforeMethod; import org.openqa.selenium.WebDriver; import org.openqa.selenium.support.PageFactory; import org.testng....
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'...
5
votes
1answer
389 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 ...
1
vote
2answers
5k views

How to send variable (dynamic value) at @findby in POM using java

How to send variable with dynamic value at @findby in POM using java like - //div[@class='item']/div[@class='containerbody'][@columnid=' "+i+" ']/div/div[contains(@class,'swimLaneheader')] where i ...
1
vote
2answers
3k views

Can't use if condition using selenium webdriver

I've got the following situation: I want to fill a field which is displayed some times and others don't. So, to solve this I used a if condition along with page objects. public static WebElement ...
3
votes
2answers
76 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 ...
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 ...
1
vote
0answers
134 views

How to inspect an element with multi attributes by OR operator in Page Objects model in watir?

I have a problem when trying to find an element with the different attribute as sample bellow <i>bold</i> Sometime <i class='icon'/i> I want to try inspecting this element with OR ...
5
votes
1answer
209 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 ...
0
votes
1answer
952 views

How to pass data through Excel sheet in Page Factory framework

I have created a login test script and verified home page also but now I have to add new customer and the form accepts following values Customer Name Gender Date Of Birth Customer Address , city, ...
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 ...
3
votes
1answer
5k views

Timing Page Load in Selenium

I am working with Selenium C# .NET. What I want to accomplish is elegant, extendable page load time logging within my page object architecture. Most new pages are loaded as the result of some action, ...
5
votes
4answers
917 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(...
-1
votes
1answer
56 views

How to write a java programme to find unique patterns by removing duplicates for API urls?

How to write a java program to find unique patterns for API URLs? Note: I have a file which contains 10000 API URLs with duplicates api.csv: http://abc.com/XMLFeed?clientkey=abtc&type=Products&...
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 ...
2
votes
2answers
5k views

Dynamically using @FindBy to get linkText value (Localisation)

Thanks for your time first & foremost. Problem: I am automating a product which in the not so distant future will have multilingual support switched on, I have setup a simple resource bundle ...
2
votes
1answer
1k views

How to implement the page-objects ruby gem with selenium

I would like to use the page-objects gem in my selenium test projects, but before I can do that I need to get a small proof of concept project working so I can play around with it. I have been ...
1
vote
2answers
247 views

Questions Regarding POM Framework

I am developing a framework for the popular e-commerce trading website platform (Amazon) – from scratch. I will be starting a new automation testing role, and, I need to get more practice before I ...
0
votes
0answers
45 views

Advice For Creating POM Test Framework [closed]

I am developing a framework for the popular e-commerce trading website platform (Amazon) – from scratch. I will be starting a new automation testing role, and, I need to get more practice before I ...
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 ...
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....
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 ...
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 ...
1
vote
1answer
663 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
909 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
739 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 ...
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 ...
0
votes
1answer
161 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 ...
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 ...
2
votes
3answers
4k views

How to select from the dropdown list in PageFactory

The dropdown list is triggered by an input field. Once the dropdown list is shown, I wanted to select the item based on the index. When I am using PageFactory, (@FindBy) to identify the WebElement, ...
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 ...
1
vote
2answers
430 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 ...
6
votes
3answers
709 views

Is page object a framework or design pattern?

Currently I'm using page object design pattern with testing.
5
votes
1answer
226 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 ...
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 ...
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 ...
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; ...