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

Clicking on an image or label in PageObject

label(:enable_allchild, :id => 'colHeader-Status') image(:enable_allchild, :src => 'image/selectAll.gif') label(:enable_allchild, :text => "Enable") Tried all three of these enable_allchild_element.click…
partydog
  • 302
  • 2
  • 12
0
votes
1 answer

empty field validation still fires if the fields are not empty in Selenium + Specflow

When I fill the fields with values and submit, empty field validation still fires randomly and not everytime. As you can see in the image, the fields are non empty , still validations are fired. I have noticed, usually selenium takes time to enter…
Arpan Buch
  • 1,380
  • 5
  • 19
  • 41
0
votes
4 answers

Checking and unchecking of a checkbox using Selenium WebDriver

Checking and unchecking of a checkbox using Selenium WebDriver. I am using the page object pattern, so my code appears this way. SelectCheckBox("Check"); OR SelectCheckBox("Uncheck"); [FindsBy(How = How.Id, Using =…
Arpan Buch
  • 1,380
  • 5
  • 19
  • 41
0
votes
1 answer

How to click on a div using page_objects gem?

Using page_objects gem, Cucumber and Watir-Webdriver. I have a link/button that I want to click on. In IRB I can click on it via the div as such: b.div(:text, "Verify your membership").click The HTML: div class="verification-header button -gray…
Farooq
  • 1,925
  • 3
  • 15
  • 36
0
votes
0 answers

PageObject/Watir clicking a Span with given text

on(AccountSelect) do |page| @account_number = page.data_for(:customer) account = @account_number['account'].to_s @four = account.split(//).last(4).join end #on(AccountSelect).span_element.click @browser.span(:text =>…
James
  • 11
  • 1
  • 3
0
votes
2 answers

Selenium webdriver pageobjects login failure

I am writing a new Web app test using selenium web driver. I have gone through various example however each page returns next page class. The only doubt I have in my mind is if the login fails due to password change etc? in such scenario page is…
DesertRose
  • 23
  • 1
  • 7
0
votes
1 answer

Unable to pass page objects to the spec file in protractor

We are new to Protractor and are going through the code to better understand its functionalists and in comparison with writing tests with selenium. As an exercise we have tried to automate the angularjs home page (http://www.angularjs.org) using…
0
votes
1 answer

Best practice for checking for error messages using Page Objects

Best practice for checking for error messages using Page Objects. So I have duplication in regards to my code where I'm checking for various error messages. My question is using Page Objects/page_objects gem, is there a way I can remove this…
Farooq
  • 1,925
  • 3
  • 15
  • 36
0
votes
1 answer

Passing in an existing variable into a Ruby method

I'm trying to write a test to make sure existing users can't register (Using Cucumber, Watir-Webdriver and Page Objects) I have the following code: text_field(:email, :id => "user_email") text_field(:password, :id => "user_password") …
Farooq
  • 1,925
  • 3
  • 15
  • 36
0
votes
1 answer

What should be the criteria for creating a new type of PageObject

If a button is optionally shown on a page (or part of page), does it qualify that part to be represented as two different PageObjects, where one PageObject provides methods to interact with the button while other PageObject does not? Or, should it…
Asad Iqbal
  • 3,241
  • 4
  • 32
  • 52
0
votes
1 answer

what pageobject to return from a pageobject back action

In my application, a record page has a 'Back' button. The page can be accessed from either a home page or a list of records page; and the back button should return to the previous page. What should the back method return? One way is to pass a…
Asad Iqbal
  • 3,241
  • 4
  • 32
  • 52
0
votes
2 answers

PageObject Gem - Alert popup not being handled

I am new to PageObject (and ruby)... I am having issues handling the Alert popup when user ID is not provided. Here is the code and scenario: When I click 'sign in' button without user ID then I am expecting an alert with a message, which I am…
Asif
  • 1
  • 3
0
votes
1 answer

Getting text all all links on a page.

I am writing a test where I want to get all the options that are displayed in a menu. The HTML for the menu is as follows:
0
votes
1 answer

Webdriver - Page Object model using page factory, web page withh too many links - Best Practice

Webdriver - In page Object model using page factory, i have around 25 links in a page. Should i create a variable for each of these links or is there a better way to handle this.
user2048204
  • 729
  • 4
  • 13
  • 27
0
votes
0 answers

How can I model a Master Page/template with Page Objects, using Selenium

I was curious as to the best way to model a page object that could use a master page or template for functions that any page can do in selenium. For example, look at this website. We have questions, tags etc buttons and search box on every page.…
CodyK
  • 3,426
  • 4
  • 36
  • 52