Questions tagged [page-objects]

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

Filter by
Sorted by
Tagged with
2
votes
0answers
244 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
131 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
253 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
2answers
2k 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 ...
1
vote
1answer
352 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 ...
0
votes
1answer
625 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
59 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 ...
2
votes
1answer
117 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 ...
3
votes
3answers
4k 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 ...
0
votes
4answers
274 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 ...
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 ...
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" ...
0
votes
2answers
120 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
91 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
219 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
1answer
62 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: ...
0
votes
1answer
139 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, ...
1
vote
1answer
825 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 ...
3
votes
2answers
117 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 ...
0
votes
1answer
533 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
112 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
322 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
436 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 ...
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 ...
0
votes
2answers
649 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'...
6
votes
3answers
713 views

Is page object a framework or design pattern?

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

Things to consider when starting project with Cucumber and Page Object Pattern?

I'm trying to build a new framework based on Cucumber and Page Object Pattern. Could you please advice me what approach to take based on your experience before doing automation project like: What's ...
0
votes
1answer
973 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, ...
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
5answers
54k 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 java....
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 ...
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, ...
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
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, ...
0
votes
3answers
265 views

Is there any Java based page object framework similar to Taza?

This is probably not a typical SO question. But, I need to post this here because google searches have not given me the answer I was looking for. Hopefully, the experienced developers here can give ...
-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
6k 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 ...
9
votes
1answer
3k 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....
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
251 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 ...
0
votes
1answer
322 views

Behat/mink - Javascript redirect on page->open

Using behat/mink, I'm testing the "remember me" functionality. Functionally, when the user visits the main page, javascript/ajax code verifies if the user is "remembered". If yes, then the ...
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 ...
7
votes
1answer
2k 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 ...