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
6
votes
2 answers

Selenium Webdriver: Page factory initialization using paths relative to other elements?

I'm trying to write a page object in Selenium Webdriver using the page factory @FindBy annotations. The page object is for a sidebar, and the parent WebElement containing all elements the page object needs to interact with is initialized in this…
kesslern
  • 190
  • 2
  • 8
6
votes
1 answer

Using PageObjects, Page Factory and WebDriverWait in Selenium WebDriver using Java

I've been using Selenium WebDriver to implement functional tests for some projects that I've worked with. I'm trying to use the Page Object design pattern with Page Factory to factor out my locators. I've also created a static WaitTool object…
Jamie Piltz
  • 205
  • 1
  • 3
  • 12
5
votes
2 answers

How to use WebDriver / Selenium 2 LoadComponents in PageObjects pattern?

I have a hard time to get used to the WebDriver PageObject pattern. Please share your experience and ways of using PageObjects pattern and loadableComponents. As PageObject represents usually a component or piece of functionality, it occurred to me…
lisak
  • 21,611
  • 40
  • 152
  • 243
5
votes
4 answers

How to wait for invisibility of an element through PageFactory using Selenium and Java

Is there a way to wait for an element not present in Selenium using PageFactory annotations? When using: @FindBy(css= '#loading-content') WebElement pleaseWait; to locate the element, and…
Mate Mrše
  • 7,997
  • 10
  • 40
  • 77
5
votes
2 answers

How to explicitly wait while using page factory in Selenium?

I'm going to organize an explicit wait in Selenium like this: WebDriverWait = new WebDriverWait(driver,30); WebElement element = wait.until(ExpectedConditions.presenceOfElementLocated(locator)); The problem is that I don't have the driver in my…
7cart project
  • 317
  • 1
  • 4
  • 13
5
votes
4 answers

Should we write separate page-object for pop-up with a selection drop-down?

I am new to Page-Object model automation using selenium and java. I am using the Page Object model and have each page as a single class and the actions in that page as methods. Should we write separate page-object for a simple pop-up which appears…
Silverbullet
  • 144
  • 1
  • 12
5
votes
1 answer

Protractor Timeout - "Failed: Timed out waiting for asynchronous Angular tasks to finish after 11 seconds."

As an e2e tester who has little interaction with the developer, how do I find out what is causing the angularJS website to hang? How do I debug the website and provide them with a tangible solution to my problem? Does Chrome Developer provide an…
Ged
  • 117
  • 1
  • 5
5
votes
2 answers

How do I determine if a WebElement exists with Selenium?

I know I could use (driver.findElements(By.xpath("Xpath Value")).size() != 0); However, I am using a Page Object Model, whose entire purpose is to predefine the WebElements in a separate class, so I don't have to "FindElements By" in my test…
dsidler
  • 489
  • 3
  • 13
  • 23
5
votes
6 answers

Best way to store locators

I'm following page object design pattern for Selenium automation and I can guess that many people store locators in .properties file and access them in code. It seems great to keep locators at separate place. Since, I haven't work on any big project…
Alpha
  • 13,320
  • 27
  • 96
  • 163
5
votes
2 answers

when do FindBy attributes trigger a driver.FindElement?

My question is: do webelements decorated with findby attributes call the findelement function upon each reference to them? If not, when? And what is the procedure with List< webelement > which is also decorated? Does it trigger when you reference…
Sergiu Todirascu
  • 1,367
  • 15
  • 23
5
votes
4 answers

Should Page Objects Return Page Objects?

We're currently working on building up a good test frame in our company. It's for a medium-to-large-sized webapp, perhaps with a couple dozen pages. We're currently writing mostly WebDriver Selenium UI-based tests. We are trying to decide on some…
joshin4colours
  • 1,656
  • 4
  • 16
  • 27
5
votes
3 answers

ImportError: No module named base

I'm trying to implement PageObject pattern for my first Login test. While running it I'm receiving the following error: >> py.test -v test_login.py ============================= test session starts ============================== platform linux2 --…
Showme
  • 69
  • 1
  • 3
  • 8
5
votes
1 answer

How to get the attribute_value of a page_object element?

Imagine i have a image like: the_image = @browser.image(:id, 'image01') The way to get the value of its class could be: image_status = the_image.attribute_value('class') Ok. I'm using page_object gem and lets suppose i have the image as element,…
5
votes
1 answer

Selenium PageObjects pattern and components

What is the standard approach when applying the PageObjects pattern to components of a page? For the sake of an example lets say I am writing tests for the Features on an Amazon product page. That page contains a large number of separate features,…
Grant Trevor
  • 1,052
  • 9
  • 23
4
votes
3 answers

How to design Selenium 2 tests with the Page Object pattern using inheritance

We are now writing a new test suite using Selenium 2 (Webdriver) and TestNG. Our tests use the Page Object pattern and we are very happy with the the way things are looking so far. However, we ran into a design issue with our tests and we don't seem…
Mario Duarte
  • 3,145
  • 7
  • 27
  • 37
1 2
3
56 57