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

Page Objects erro (java.lang.NullPointerException)

I did a basic project to training about Page Objects using selenium WebDriver with java and Junit. So, I make a page object class and Junit class too. I Make a call of method and pass the parameters to method but, the eclipse show a message that…
-1
votes
1 answer

How to implement List FindALL webelement

@FindAll(@FindBy(xpath = ".//input[contains(@name,'adv_xfer_fields') and contains(@name,'::amounts')]")) List amounts; I have dynamic web-table in the input field, Ideally I need to pass value to this. But I'm not sure how to…
-1
votes
1 answer

FindBys and List always return null list

As far as my understanding goes, FindBys Annotation in pagefactory returns you elements which satisfies all the condition mentioned inside. The code below always returns 0 elements. Similarly,If I'm using FindAll annotation with same id and Xpath…
-1
votes
1 answer

how to implement the key words methods in selenium according to page when framework is keyword driven and data driven

I am using a framework which is key word driven and data driven in selenium. The problem is all the methods or actions for entire application is written in one single class which has gotten very lengthy and confusing like spaghetti. I want to…
-1
votes
2 answers

Adding explicit wait in POM by doing it as a common method for all pages

I am using POM with having some common operations like, click, checkText, etc declared in my TestBase class. I have the problem while transition from one step to another. To overcome this issue i want to add explicit wait, and i want to put it in my…
faheem
  • 11
  • 2
  • 8
-1
votes
1 answer

java.lang.nullpointerexception when using page objects with bDD

I am getting nullpointexception on login page and in actual step definitions I have a base page : package pages; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org .testng.annotations.AfterClass; import…
-1
votes
3 answers

converting string to element in page object

Page object gem with ruby, and I have defined some number of page-objects for links like: link(:link_for_1week, text: /1 wk/) link(:link_for_2week, text: /2 wks/) link(:link_for_3week, text: /3 wks/) link(:link_for_4week, text: /4 wks/) …
-1
votes
3 answers

Selenium WebDriver [Java] How do I store the elements of an iframe in a PageFactory

I am following Page Object Model to automate a flow in one application. In one of the module I have to add a new post which have a "Title" and a "Body" field. As of now, I am able to send the text in the "Title" field as it is in the Top Window. But…
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
-1
votes
1 answer

Selenium WebDriver page object navigation best practice

Mostly I implement frameworks using Page Object/Page Factory approach base on Java and I would like to improve my existing codebase. My questions are: My methods are returning page objects.(return PageFactory.initelements(...)); I have read some…
brobee
  • 231
  • 1
  • 5
  • 25
-1
votes
1 answer

How to initialize diferrent web elements using selenium page factory for single page?

My page has buttons,textboxex and select elements. But when initializing the page objects using PageFactory.initElements(driver,MyPage.class), all elements are initialized except Select element. I read somewhere that this can be achieved by…
Prasanta Biswas
  • 761
  • 2
  • 14
  • 26
-1
votes
1 answer

Button not getting enabled upon selection of value in dropdown Selenium

There is a "Continue" button in my application which is enabled upon selection of a value in a dropdown i.e. "Year". When using Selenium for this, even after selecting this value, the button is not enabled, and hence the test fails, since Selenium…
-1
votes
1 answer

How to design class using page object model for 2 tabs with same functionality

while running the application, 2 new tabs open which has same functionalities.Using Page object model in selenium how to design a class for this. If single class is enough how to differentiate those 2 tabs
vijay
  • 1
  • 1
-1
votes
1 answer

How to run tests cases in one test

im looking for solution to run test where are included test cases from several test cases. I need to make test like this: 1.open homepage 2.click on login link 3. type login and pass + submit I have 2 classes (pages) HomePage and LoginPage, I want…
ciupakabrans
  • 45
  • 1
  • 2
  • 7
-1
votes
1 answer

TestNG Asserts put under Page Objects are not reflected in the TestNG report for webdriver test

I am working on Java-selenium test framework. We are calling individual page objects for testing methods viz: verifyOrderSummary() These methods sitting inside Page Object will have individual TestNG asserts Now, when I run my main calling methods /…
user2451016
  • 1,857
  • 3
  • 20
  • 44
-2
votes
2 answers

Driver Null pointer exception while using the driver from Test class in Page class

I have two classes a Base class and Test class Base class: public class Base { public static WebDriver driver; public void browser() { System.setProperty("webdriver.chrome.driver", …
1 2 3
56
57