Stack Exchange Network

Stack Exchange network consists of 174 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.

1
vote
3answers
23 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 ...
0
votes
1answer
35 views

what is the good practice to instantiate page object in POM and PageObjectFactory

I am practicing POM and Page Object factory. I would like to learn good practices in instantiating the pages. till now I am Instantiating the pages from test class (e.g. TC_01_Register.java) using ...
1
vote
1answer
49 views

How to parameterize @findBy in pageFactory

I am trying to implement a page class for footer in OpenCart application. which is having multiple links with same or similar properties except link text. What is the best way so that we can define ...
4
votes
0answers
94 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 ...
-1
votes
0answers
164 views

Message: Error: Polling for changes failed: NetworkError when attempting to fetch resource

The inner HTML for catalogContainer, which is a WebElement, prints to the console -- but only from the constructor. Why? thufir@dur:~/NetBeansProjects/com.toscrape.books.selenium$ thufir@dur:~/...
1
vote
1answer
38 views

Scrape items from an HTML list

When Catalog receives a fragment for a book category, it seems to my eyes, to be just list items. For space, I didn't include that output. How can I ensure that only categories which belong to the ...
-1
votes
0answers
57 views

debugging an HTML list iterator with PageFactory

How do I assign, and what do a assign, to listItems in Catalog? Looking to iterate a HTML list using the Page Object Model with PageFactory. Output for this project: thufir@dur:~/NetBeansProjects/...
1
vote
1answer
46 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. ...
2
votes
0answers
37 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 ...
0
votes
2answers
44 views

While following Page Object Model, how handle Fragments in Android

I was searching over INTERNET, i didn't find solution for this coding puzzle, let say we have listView and each option will return different screens object. Now I need to create a method that on click ...
2
votes
1answer
40 views

Object Oriented Programming with Selenium Page Objects

I'm struggling with how to apply inheritance and composition with Java for scraping sample data. App driver: package dur.bounceme.net.SeleniumBase; import java.io.IOException; import java.util....
1
vote
1answer
59 views

how to Iterate a List of links?

This "Books" link shows that it has the following xpath: /html/body/div/div/div/aside/div[2]/ul/li/a Then follows the catalogue categories: Travel, Mystery, etc. Reading the xpath above I see ...
1
vote
2answers
41 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
37 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:~/...
1
vote
1answer
36 views

Same element locators under different parents

This is more of a "code review" question but it is very SQA specific so posting it here. There are two different menus on a page: "left" and "right" both containing "save" and "cancel" buttons with ...
0
votes
4answers
69 views

Selenium PageObject model returns multiple objects

Please find the below code and I'm trying to return 2 objects ( Page6 and Page7 ) but it's asking me to remove the second object. Please let me know how to return multiple objects using return type ...
1
vote
1answer
47 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 ...
0
votes
2answers
39 views

Selenium - Design considerations for filling out forms

I am using Selenium to develop automated test cases, some of which involve filling out forms with dozens of input fields. At the moment, I am following the Page Object Model/Page Factory design ...
1
vote
1answer
49 views

Which Page Class (POM) to verify successful actions from?

I am working with Selenium WebDriver + Java and following the POM design pattern to create automated tests, one of which involves verifying successful logout of a user account from a webapp. Does it ...
0
votes
2answers
53 views

POM Model -Fetching mobile number from excel sheet like 9.5512395512E9

Working on Page Object Model by using Data driven Framework, fetching data from Excel sheet.When executing the test script the mobile number displays like 9.5512395512E9. In excel sheet Original ...
0
votes
2answers
61 views

How can I keep the variable alive across the project globally?

I have a BaseClass.java which extends PageObject.java class i.e. net.serenitybdd.core.pages.PageObject; Then I have two Page classes LoginPage.java and ProfilePage.java, these two also extending the ...
0
votes
1answer
50 views

How modularized should page class methods be?

When following the POM design pattern, how modularized/specific should the page class methods be? i.e. if I have a test that involves entering a username and password, is it better practice to: ...
2
votes
1answer
54 views

How to iterate i value in page object model

I need a solution how to iterate value of i. Actually my test case contain one webtable and table have five column also fifth column contain four buttons. So depending on the first column value(for ex ...
-1
votes
1answer
66 views

Question about handling random “no such element” exception in WebDriver Java

So here's the setup, we have tests where we fetch test data from excel sheet and iterate over all the rows within a particular test. So, for example, there are tests that create some user profiles, ...
0
votes
1answer
203 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
112 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
229 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
127 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
65 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
1k views

Selecting element value from drop down list with selenium using POM

I'm trying to make simple test to register in website - https://www.midomi.com/. I'm using c# and selenium but have stuck in selecting values from dropdown list using Page object model. My project ...
0
votes
1answer
292 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
59 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
90 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
177 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
190 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
593 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'...
6
votes
1answer
205 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 ...
0
votes
2answers
2k 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
1k 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 ...
4
votes
2answers
57 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 ...
6
votes
1answer
2k 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
108 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 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
155 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
633 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, ...
4
votes
2answers
1k 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
2k 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, ...
4
votes
4answers
463 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
1k 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
3k 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 ...