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

Verifying multiple product's features added in the cart is same in the Order Summary page with Selenium webdriver + Specflow + C#+ page object pattern

I have added 2 products in my basket. in the first step of my Test. In the last step I assert that same product that were added in the first step of the test comes in the Last step which is the "Order Summary page". Please find below the code and…
Arpan Buch
  • 1,380
  • 5
  • 19
  • 41
2
votes
1 answer

Are elementfinder promises resolved on declaration?

I know that ElementFinders are promises but I'm not sure how the promise behaves if we define the ElementFinders in the beginning of the Page Object. Looking at an example: var EventHeader = function (context) { this.eventName =…
jpsstavares
  • 3,303
  • 5
  • 25
  • 32
2
votes
3 answers

Page Object Extension with Behat 3 and Mink 1.5 throws an Exception

I've a project running with Behat 2.4, Mink 1.4 and Behat Page Object Extension, with this version my tests is fine, 100% passed. But now i'm migrating to Behat 3 due to the fully integration with Browserstack, Behat 2 doesn't support BrowserStack…
Thiago França
  • 1,817
  • 1
  • 15
  • 20
2
votes
2 answers

Puts statement is not printing the messages to the console

I am placing a few puts statements in my script. But the messages are not printed; the script is passing through these statements. I observe the moment execution goes into rake puts is not working throughout the flow. In spec helper class…
2
votes
1 answer

Architecture (like File structure) of a Selenium webdriver projects(Java) which is easy to maintain and not using any build tool

Can anyone suggest the best architecture for a selenium webdriver project (Java) which is easy to maintain. Although there are design patterns available like Page Objects etc but I want to know which is the best i.e. what architecture or framework…
2
votes
2 answers

Python, selenium webdriver - I need base class method to return type of its child class. How to achieve it?

I am quite new to Python (and stackoverflow) and I need some help. I have 2 classes as below class baseClass(object): def __init__(self): self.attribute = None def baseMethod(self): return 'xxx' +…
donatelo
  • 103
  • 2
  • 12
2
votes
2 answers

How to avoid Errno::ECONNREFUSED: (Connection refused - connect(2)

While I'm executing the scenarios suddenly I got the error message as follows: Retrying.. Errno::ECONNREFUSED: (Connection refused - connect(2) (http://localhost:37265)) Retrying.. Errno::ECONNREFUSED: (Connection refused - connect(2)…
KAK
  • 905
  • 4
  • 14
  • 33
2
votes
1 answer

WebDriver PageObjects & Large Amounts of Locators

Over the past year I built a very nice WebDriver framework for my group. Pretty standard fare: Page classes typically encapsulate the full functionality of a page in on our platform (controls as By objects, methods as needed) & extend a base class…
JordanD
  • 35
  • 2
2
votes
1 answer

Custom matcher not asserting in Astrolabe/Protractor + Jasmine test

I'm writing some page-object driven tests using Protractor and Astrolabe. Jasmine is being used to implement describe/it style specs. Adding custom matchers won't work using this.addMatchers (TypeError: Object # has no method…
yurisich
  • 6,991
  • 7
  • 42
  • 63
2
votes
2 answers

How to avoid page-object deprecated for checkbox

I use cucumber since one year, and I am adding page-object-gem into it since few weeks. When I execute the test, I get message : DEPRECATION WARNING You are calling a method named checkbox at commentPage.rb:23:in `block in delete_comment'. …
Fabrice31
  • 770
  • 11
  • 25
2
votes
1 answer

Can you find elements by id,title,link etc through site-prism or only by css selectors?

By using site-prism gem for integration testing, can I find page elements by referring to id or title or link or xpath or are they searchable only through css
bugsberry
  • 67
  • 1
  • 8
2
votes
2 answers

Selenium 2 WebDriver does not evaluate updated DOM as expected

I am using Selenium 2 WebDriver in C# to automate an input page. There is a validation summary control that is hidden when the DOM is loaded. Here's how it looks on additional load.
2
votes
2 answers

Selenium, Java, PageObject pattern, broken hierarchy

I am modeling my web app interaction using the Page Object pattern. Most pages in the app have some standard options like "log in", "log out", "home", etc. Additionally, they all have a protected WebDriver reference. So I created a super-super class…
R.V.
  • 532
  • 1
  • 6
  • 21
2
votes
3 answers

Site Prism, Capybara: Selector with variable

I'm mucking around with the site_prism to implement a Page Object Model in capybara. It looks very interesting. How would I specify a selector such as "[data-id='x']" where x is an integer? Something like this: class Home < SitePrism::Page set_url…
Rimian
  • 36,864
  • 16
  • 117
  • 117
1
vote
3 answers

Duplicate Checkbox in Page-Object is not defined?

I am trying to click a checkbox that enables a purchase button to appear. When I try to use it, I get a "NoMethodError: undefined method 'eula' for Cart:0x101f54810" error. I think it may be because there are two identical checkboxes, but I am just…
Dave McNulla
  • 2,006
  • 16
  • 23