Questions tagged [pageobjects]

A design pattern to represent a web page as an object. Usually used in UI / end-to-end testing and browser automation.

A page object provides access to a web page. In its implementation, a page object typically makes use of a web driver like or . The page object hides the html and web driver details, and provides an abstract interface to the page in terms of its application domain.

The page objects are subsequently used to create end-to-end test scenarios that click through the application. The use of page objects make these tests easier to maintain when details of the underlying pages change.

This tag can be used for questions on the design, implementation, and use of page objects for end-to-end testing of web applications.

More information:

845 questions
-1
votes
1 answer

Can i use PageFactory.initElements to create an object while WebDriver isn't direct (yet) to the page where the WebElements are stored

My question is about Page Object Model in selenuim. I will try to explain myself by an example Let's say i have 2 site. The first one (www.aaa.com) that has a button that clicking on him take us to the second url (www.bbb.com) For both pages i have…
Eitanos30
  • 1,331
  • 11
  • 19
-1
votes
2 answers

How to fetch data from website and print in excel Page object model, Data driven and page factory this is hybrid framework

**Element Page** public class BasePage { @FindBy(className = "_42ft _4jy0 _52e0 _4jy6 _4jy1 selected _51sy")//Signin Button private WebElement SigninButton; public void clickOnSigninButton() { SigninButton.click(); } …
-1
votes
2 answers

playwright test website with Keycloak, can't find a way to logIn via pageObjectModel

Hi (i am pretty new in palywright), I need/want to find a way in playwright, to login via pageObjectModel in a aplication which uses keycloak, but I don't know how. I found a way without pageObject, to logIn in first test and saving the auth in…
Angel Lopez
  • 35
  • 1
  • 5
-1
votes
1 answer

Page Object Model and Page Factory in case of list of web elements

I have n-elements (input fields) in webpage with common xpath. I am trying to figure out how to fill up all this field using page object model, page factory and for each method (value is same for all fields). Everything works properly when I am…
-1
votes
1 answer

How can I set up Page Objects in JavaScript?

I have used page objects in Ruby. How can I do them in JavaScript? I want the ability for simple references but also be able to pass parameters for cases where several page objects are similar, for example home street address lines vs billing street…
Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
-1
votes
1 answer

Unable to use GET_PAGE_NAME keyword with multiple GO_TO Page

I am creating a Suite File where a TestCase contains multiple PageObject and to get_page_name where I am landed. Getting below error Error if 2 pageobject Suite File Suite File
-1
votes
2 answers

How to specify a list of elements in a pageobject without having a element for each of them

I have a long list of elements I would like to access. They all have a similar id with a index from 1 to 47. Is there a good way to access these as an array or list, as i would like to be able to iterate through them, instead of doing this for each…
Jaco9307
  • 13
  • 7
-1
votes
1 answer

Getting no such element exception when I am using @FindBy annotation, working fine when I used driver.findelement(By.id())

I am using java with appium. I executed my code using 2 ways. One -when I am using below code it is working fine. public class On_BoardingPages MobileElement smsField = driver.findElement(By.id("pinEntryViewVerifyCode")); …
Tester
  • 51
  • 1
  • 12
-1
votes
1 answer

Navigating between page objects correctly in Protractor with TypeScript

I'm attempting to get a protractor test suite off the ground with TypeScript and I'm having an issue with the chaining of pageObjects that I'm unsure how to solve or do in a better way. Any example I've seen never deals with multiple pages. I'll…
shicky
  • 2,076
  • 5
  • 30
  • 44
-1
votes
2 answers

why am I receiving stale element reference on test method?

I am currently working on an automation framework using java, selenium, selenium-grid, pageObject with pageFactory. I am trying to create a method for testing the following html code:
-1
votes
2 answers

Loading multiple files with require statement on JS

The execution returns the following error when trying to load multiple js: TypeError: Cannot read property 'get' of undefined The solution that I am implementing has a login_steps.js: var LoginSteps = function() { var LoginSteps =…
-1
votes
2 answers

Passing parameters in Data Tables Selenium/Cucumber/Java

I using POM model and using Cucumber for my Automation. I am trying to implement a negative scenario for login and I have used the below strategy. I need to know whether this is the correct approach or I am messing it up somewhere. I am using xpath…
moh17
  • 223
  • 1
  • 6
  • 25
-1
votes
1 answer

Page Object model in Leanft - Initialize elements

I use TestNG in LeanFT. I created separated classes for pages and identified objects as it shown in code snippet below: public class HomePage { private Browser browser; public HomePage(Browser browser) throws GeneralLeanFtException { …
plaidshirt
  • 5,189
  • 19
  • 91
  • 181
-1
votes
1 answer

selenium POM web driver in java error

I am using the following code for POM : @FindBy(xpath="[@value='Send query']") private WebElement queryButton; I am getting this error org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath…
-1
votes
1 answer

@FindBy error in class Select (java.lang.NullPointerException)

I am trying to implement Page Object Factory in Selenium WebDriver but, when run de code, the Eclipse Show me the following message error: java.lang.NullPointerException at org.openqa.selenium.support.ui.Select.(Select.java:44) at …
Leandro Pereira
  • 19
  • 1
  • 2
  • 7