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
2
votes
1 answer

Webdriver enters wrong text in wrong input-elements

I'm using selenium to test a webapp. It has to do with adding Announcements/data. It has alot of inputs... Problem: Randomly, text-A, meant for input-A get typed in input-B as well as text-B. Since there's a lot of repetition, I read text-inputs…
terle
  • 86
  • 10
2
votes
1 answer

How to prevent StaleElementReferenceException in PageFactory in Selenium C#?

I have a Selenium WebDriver Page Object Model in C# 6. I am experiencing StaleElementReferenceExceptions while trying to click on ajax-loaded nav bar elements. This is confusing, because I'm using PageFactory, without any [CacheLookup]s. Here's the…
MartinRosenberg
  • 189
  • 2
  • 10
2
votes
1 answer

NullPointerException when run a test using PageObjects pattern

I have tried to find the answer to this but none of those helped me. I'm sure I'm missing one detail, but I can't figure out what exactly. I get NullPointerException when run a test case. I think it happens when I try to pass driver to my page…
2
votes
2 answers

Selenium webdriver Page Object Pattern and ExtentReports

Someone could tell me how to write a functional application tests which combine Selenium Page Object Pattern and ExtentsReports (http://extentreports.relevantcodes.com/) to generate reports from these test cases. How to design test class? because I…
2
votes
2 answers

Selenium POM Model: java.lang.NullPointerException Error. Not Able To Enter Values For Webelements Or Select Elements

I am implementing POM model sleneium for the first time. I am using skeleton function to initialize my WebDriver. It is as below: File pathToBinary = new File("\firefox.exe"); FirefoxBinary binary = new FirefoxBinary(pathToBinary); …
Abhinav
  • 1,037
  • 6
  • 20
  • 43
2
votes
1 answer

Abbreviated definition of a webdriver html element

In webdriver, with c#, you can define a html element using this: //Textfields public static IWebElement userFieldElement { get {return Configuration.driver.FindElement(By.XPath(".//input[@name='USER']"));} } Is it there an…
pfernandez
  • 303
  • 2
  • 12
2
votes
1 answer

Use page-object gem to check a box in a table

My page has a table with a checkbox in the first column. I want to check the box in each row up to a given number. I can do this in watir-webdriver, but not with page-object; possibly due to the HTML structure. HTML - edited for relevancy (there is…
B-Mac
  • 61
  • 8
2
votes
5 answers

Selenium Page Object (PO) and Key Word Driven Framework

I am a novice in Selenium, need some advice. As I understand, in Page Object, we must create a Java class for each page. In Keyword Driven Framework, we need to create a generic module, which based on input key perform an action based on the…
2
votes
1 answer

Using @FindBy with my own class, not with WebElement

Is it possible to use @FindBy not only with WebElement, but with my own class? I would like to have my class for cooperating with page elements and to override some methods of WebElement interface in it. So that I implemented the class: public…
2
votes
0 answers

Creating page object for dynamic content page types

I want to write page object for a page that has a dynamic section which toggles on button click. Since the view is not same, logically there are three sections, of which only one can be seen at a time.
or
or
2
votes
1 answer

Running multiple browser instances in the same test spec

If I have a single spec that is using page object model, how do I run multiple browser instance for that same spec? For example I have spec: it('should run multi browser', function() { browser.get('http://example.com/searchPage'); var b2 =…
awaken
  • 789
  • 1
  • 11
  • 22
2
votes
1 answer

Using Data Objects while E2E testing with Protractor

So a coworker and I were discussing making a data object for our e2e tests. From my understanding about data objects they are used for decoupling your test suites. For example, my first test suite is to create an account and to test if the fields…
2
votes
1 answer

JavaScript: Choosing dropdown list items using Page Objects for Protractor testing

So I can't figure this one out. My test calls for choosing a list item as part of a form to create a new user. However, when I run the test it does not choose an item from the list. And Protractor doesn't return any errors, it thinks the test was a…
Dylface
  • 93
  • 2
  • 10
2
votes
1 answer

How to select from a dropdown using POM Selenium

so i need to select from a drop down and all the code seems to do is highlight the value and not select it, package uk.co.brightfuture.bfslogin.selenium.page; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import…
GingerFish
  • 457
  • 3
  • 11
  • 26
2
votes
1 answer

Is Page Object Design Pattern with Selenium creating classes of pages and invoking their constructors by the objects of them?

I've already created a Java Maven test project with Selenium. And I need to convert it into the Page Object Design Pattern. As I could understand from the official documents, we are creating the classes of the pages and then we invoke them by the…
Ensar Turkoglu
  • 124
  • 2
  • 14