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

'Failed: object.method is not a function' error when trying to use Page Object with Protractor

I've got a: TypeError: page.fillForm is not a function every time I try to run my tests. Before I started to use PageObject everything was ok. Here is my spec file: contactBook_spec.js describe("Contact book", function(){ …
dave
  • 25
  • 1
  • 4
2
votes
2 answers

org.openqa.selenium.ElementNotVisibleException: element not visible

My test fall down when I run test, I run the test again, test is pass, code do not change but the result is different. Why? This is my code: public ProductPage clickOnAccessories(){ //Click on link “Accessories” …
MY DZON
  • 109
  • 1
  • 4
  • 9
2
votes
1 answer

How to use [FindsBy] annotation so that I can resuse the element found to find its inner elements?

The DOM I am working on has lots of nested elements (box inside box structure ) and I am finding it difficult to code using POM design pattern. I have used FindsBy, FindsByAll, FindsBySequence but it appears that anytime I need to identify inner…
Meg-90
  • 259
  • 2
  • 8
2
votes
0 answers

Which is better to use in Selenium POM, Xpath or FindsBySequence?

I am trying to find elements following POM design pattern in Selenium and I would like to know which is a better locator to use? Xpath or FindsBySequence? Planning to use FindsBySequence to find all my inner elements as I read that Xpath takes…
Meg-90
  • 259
  • 2
  • 8
2
votes
2 answers

Selecting a row in table based on content and clicking link from selected row - Protractor

I have a page object that looks like this:
Email action
admin@example.com
anks
  • 303
  • 2
  • 12
2
votes
1 answer

How to handle multiple popup alerts with Serenity's PageObject

Here's the issue. I am using Serenity to run tests in Internet Explorer and PageObject is handling all my actions, either through Serenity's steps or by direct reference in Junit's tests. The scenario I am currently working on is simple: Enter date…
JDelorean
  • 631
  • 13
  • 26
2
votes
1 answer

How to embed an element in a page object widget

I have the following widget... class MdRadioButton < PageObject::Elements::RadioButton extend PageObject::Accessors label :title, :class => "control-label" def select self.click end def selected? self.class_name.include?…
Jackie
  • 21,969
  • 32
  • 147
  • 289
2
votes
0 answers

What's the difference between ImplicitlyWait and RetryingElementLocator regarding PageObject?

When I use PageObject and I want to set a time to wait for elements on the page then I use ImplicitlyWait: Driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(3)); This means that when my page object is…
Denis Koreyba
  • 3,144
  • 1
  • 31
  • 49
2
votes
0 answers

How to cast java.lang.reflect.Field to org.openqa.selenium.WebElement to use for Keyword Driven in Page Factory Framework

A snippet of the LoginPage - Class LoginPage extends BaseClass { public LoginPage() throws Exception { eDriver = BrowserDriver.getDriverInstance(); PageFactory.initElements(eDriver, this); } @FindBy(name = "rememberMe") public WebElement…
Chris
  • 21
  • 3
2
votes
1 answer

Create Keywork/Page Object framework: Selenium or Protractor?

My company's web application is Angular based ? Is it a good idea to implement Page Object/Keyword based test automation framework using Protractor ? As of now what I have done it, I have 1 spec file which gets called, which in turn calls a test…
2
votes
2 answers

Protractor testing: Can someone tell me what I'm doing wrong with Require?

I'm trying to break my Protractor tests up into manageable files. Can someone tell me what I'm doing wrong with Require? Here is an example: Variables: C:/tests/variables/signInVariables.js var emailAddress =…
2
votes
1 answer

Selenium WebDriver - Ruby, PageFactory, PageObject

im beginner in WebDriver. But I have question, becouse i cant find it in the internet. Is in ruby something like PageFactory, PageObiect? Where can I find tutorials?
ciupakabrans
  • 45
  • 1
  • 2
  • 7
2
votes
1 answer

Protactor: should I put assertions in my PageObject?

I have multiple scenarios in which I'd like to test pretty much the same things. I am testing a backoffice and I have widgets (like autocomplete search for instance). And I want to make sure that the widget is not broken given that: I just browse…
Nihau
  • 474
  • 3
  • 20
2
votes
2 answers

Setting up SpecFlow to pass in identifiers

I am new to C# and am trying to use SpecFlow as I used to use Gherkin by giving a unique name to an item and then passing in the name in the Step Definition. My question is about how to add in the identifier when I create an object so I can call…
DAP
  • 51
  • 1
  • 5
2
votes
3 answers

Element should have been 'select' but was 'ul' - Selenium WebDriver Java

I am having this issue in my selenium code, while accessing drop down list elements. Using page object model, below is my page class: package Pages; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import…
Uziii
  • 763
  • 7
  • 11
  • 26