Questions tagged [page-object-gem]

A simple gem that assists in creating flexible page objects for testing browser based applications. The goal is to facilitate creating abstraction layers in your tests to decouple the tests from the item they are testing and to provide a simple interface to the elements on a page. It works with both watir-webdriver and selenium-webdriver.

A simple gem that assists in creating flexible page objects for testing browser based applications. The goal is to facilitate creating abstraction layers in your tests to decouple the tests from the item they are testing and to provide a simple interface to the elements on a page. It works with both watir-webdriver and selenium-webdriver.

For more details see https://github.com/cheezy/page-object

319 questions
11
votes
5 answers

How to avoid Compound Class name error in Page Object?

When I try to use the class name that having space class = "country name" in page object, I'm getting: Compound class names not permitted Selenium::WebDriver::Error::UnknownError) How can I use the class name that having space. Eg: class = "country…
KAK
  • 905
  • 4
  • 14
  • 33
7
votes
3 answers

Capybara integration with page-objects gem

Is it possible to use the page-object gem and capybara to automate Ruby on Rails testing? When I attempt to access a page object after starting up my test I receive the following error: Unable to pick a platform for the provided browser…
5
votes
2 answers

Watir, Page-objects: how to get all elements that have the same identifier

I have the following code code on my page I wanna check: ...
Annet
  • 673
  • 1
  • 7
  • 17
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,…
4
votes
3 answers

Watir Webdriver Text Input Slow on IE

I'm using Cucumber and Watir-Webdriver to create some automated tests. I am also using the PageObject gem. Some Example code is below require 'page-object' class LoginPage include PageObject text_field(:username, :name => 'username') …
Nathan24
  • 1,372
  • 1
  • 11
  • 20
4
votes
2 answers

Cheezy PageObject. undefined method `text_field' for HomePage:Class (NoMethodError)

I am trying to get my first page object to work. I am new to ruby and cucumber so i am not sure what i am doing wrong. Its a very simple program so far. My goal is to go to google and search for 'bacon' I have my page_object's folder inside my…
Fidel
  • 109
  • 2
  • 9
4
votes
2 answers

Can we handle the browser cookies using Page Object?

Can we able to handle the cookies in a browser at the time of execution? Actually I need to get the cookies from the browser and need to set the modified cookies in between the scenario execution. Can we able to do it using Page Object? I check the…
KAK
  • 905
  • 4
  • 14
  • 33
4
votes
1 answer

Stale Element Reference Error

Using the page-object gem and Watir webdriver, we occasionally come across a Selenium::WebDriver::Error::StaleElementReferenceError on a page that loads some basic stuff, makes an ajax request, and repopulates with more info (for the illusion of…
Gayle
  • 3,053
  • 3
  • 20
  • 13
4
votes
1 answer

can there be a divs method in PageObject::Accessors and is my workaround ok?

In page object I would like to have access to multiple divs in a particular way. This is access to the first div that matches: div(:search_result, id: /rptSearchResults/) This would be access to multiple divs that match if divs existed in…
3
votes
2 answers

"Watir::Exception::NoMatchingWindowFoundException: browser window was closed" error when using IE 11 x64 with Page-Object

I'm running tests in Ruby Mine 2.7.1 using Page-Object + Rspec. Environment: Windows 7 x64, Ruby 1.9.3 p551, IE 11. Gems: watir, rspec, bundler, page-object When i run tests in Chrome or Firefox everything is ok. But when i try to run them in IE,…
3
votes
1 answer

How can I use pageobject navigation routes when I have multiple methods with parameters?

Here, I have two methods in a class with one parameter each and I want to use routes advantage. How can I pass parameters if I am using cucumber I mean how can I pass parameters from step definitions to method if I use like this: feature: Feature:…
3
votes
4 answers

How to perform drag and drop using page-object?

I need to perform drag and drop action for a scenario, How can I able to achieve this using Page-Object. I need to click an element (like button from options) and drop it in a text area. I have search for a solution but I can't able to find. Please…
KAK
  • 905
  • 4
  • 14
  • 33
3
votes
1 answer

Accessing nested divs using page object model

I am having trouble accessing the nested divs. here is my scenario. I need to access the total in inner div. Can some one please shed some light here.
Requests Sent
Swaroop Tata
  • 89
  • 10
3
votes
2 answers

Waiting on large SelectList arrays using page-object gem

I am trying to select an item in a SelectList element that is loaded dynamically. I'm using a wait_until like so: select_list(:oem, :id => 'oem_1') def wait_for_oem(oem_name) self.oem_element.wait_until(20) do self.oem_options.include?…
garrmark
  • 89
  • 1
  • 10
3
votes
1 answer

Select a value from a select List by value element

recently I came upon an issue while using page object that I could not find an answer to. When using a select list to choose an option. I need to select by partial text or by attribute. here is an example: