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

populate_page_with method gives an error "Undefined method send_keys" when used with selenium web-driver

I am using page object gem with selenium web-driver. I am trying to automate gmail sign in page. So to enter mail_id and password I am using populate_page_with method. I am storing my login credentials in a variable "data" data = { :mail_id =>…
Sujit
  • 1
  • 1
0
votes
0 answers

What is the difference in defining Page Objects with GET vs VALUE in Protractor?

I have seen two ways of defining functions/objects when reviewing javascript in Protractor: One looks like this: name1: { get: function() { return element.all(by.css('.mything')); }}, Another looks like this: name2: { value: function() { return…
Serious
  • 153
  • 11
0
votes
1 answer

Require: Doesn't find a file (Page Object Pattern)

I'm trying to incorporate the Page Object pattern in my Protractor testing but for some reason I don't know it's not working. I must say that before doing any change, everything was running perfect. In test folder I have the file test.spec.js with…
Cremix_hellven
  • 895
  • 2
  • 7
  • 13
0
votes
2 answers

how to make a PageObject method act like Protractor methods

With protractor we can do this: beforeEach(function() { browser.get(myLoginUrl); this.username = element(by.model('username')); this.password = element(by.model('password')); this.loginButton = element(by.css('[ng-click="login()"]')); …
lostdorje
  • 6,150
  • 9
  • 44
  • 86
0
votes
1 answer

Testcase design for verifying many textboxes on webpage

I have webpage with 60 textinputs. All of this inputs has 'info' links which expand/collapse textbox (see example) with description for required input. I have a file with all required strings. I need to check expand/collapse functionality and text…
user3535807
  • 248
  • 2
  • 3
  • 15
0
votes
1 answer

How to pass username and email in Selenium

I am using C#, Selenium with the page object model. I need to understand how to pass a username and password from my test code, into my page object. Example of my current test below: [TestMethod] public void Registeruser() { …
Parkyster
  • 155
  • 3
  • 14
0
votes
1 answer

WebDriver: PageObjectFactory and Selenium Grid

I have developed a testing framework using Selenium WebDriver (PageObject Pattern) and TestNG. My page objects are initialized using pageFactory. While running single instance everything works fine. But, when I increases instances (running in…
star95
  • 111
  • 3
  • 16
0
votes
2 answers

Selenium Grid With Page Object Model Page Factory

How would I initialize the browser if I want to test on multiple browsers using Page Object Model Page Factory? Currently I have iniatialized the browsers in my Base Class like this. // initialise driver/browser public void initDriver() throws…
Ahmed Yaslem
  • 123
  • 1
  • 4
  • 20
0
votes
2 answers

How can i perform mouse move using Selenium WebDriver for Java and PageFactory

I have an link in HTML and I use Page Object pattern to write scripts with Selenium Webdriver. But my link is hidden and I can't perform MouseMove action when object is initialized with pageFactory. Here is my class: public class DashboardPage…
Ahmed Yaslem
  • 123
  • 1
  • 4
  • 20
0
votes
1 answer

Watir. How to make a call to an element of page object, inside a line like $browser.link.click?

We have a page objects elements like link (:test_link, xpath: './/a[@id = '3']) unordered_list (:list, id: 'test') And the code: def method(elementcontainer, elementlink) elementcontainer =…
0
votes
1 answer

Selenium WebDriver: Modal dialog present unhandled alert exception page objects

I am getting Modal Dialog Present error while saving a form and verifying the alert popup. Code: Method used for verifying the text of alert pop up def alert_text sleep 20 self.button_save alert_element = @browser.switch_to.alert …
0
votes
1 answer

Selenium Webdriver - TestNG - Null Pointer Exception

I am using Pageobjects to run my scripts. I declared two packages - one for Pageobject definition and the other for TestNGclasses. Supposed If I have 3 classes in Package-1 then I would correspondingly have 3 test classes in package-2. As of now I…
user3573671
  • 3
  • 1
  • 5
0
votes
1 answer

Geb / Groovy - Page content not recognized when used within other Page Object method

When I click a button I have to wait for some dynamic content to be rendered. When I put the waitFor closure in the test it works correctly. However, I wanted to put the waitFor in a method inside the Page object so I do not have to always call…
user3517049
  • 826
  • 1
  • 6
  • 9
0
votes
1 answer

How to change a cheezy page object class to a subfolder of pages

I have a cucumber project that uses Cheezy Page Objects. Everything is working fine but as I was already with too many page object classes I decided to move them from the /pages folder to some subfolders (/pages/homepage, /pages/checkout_page). The…
Tiago
  • 673
  • 1
  • 8
  • 24
0
votes
2 answers

Cheezy page objects getting the page URL?

I'm trying to return the current page object URL but I'm not sure how to do this. My code looks like this: class APage include PageObject page_url '/page_url.com' def get_page_url return @page_url end But this doesn't work, as the @page_url…
Tiago
  • 673
  • 1
  • 8
  • 24