Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [page-factory]

page factory is an approach used to initialize webelements in Class of a page-object-model of selenium.

0
votes
1answer
35 views

what is the good practice to instantiate page object in POM and PageObjectFactory

I am practicing POM and Page Object factory. I would like to learn good practices in instantiating the pages. till now I am Instantiating the pages from test class (e.g. TC_01_Register.java) using ...
1
vote
1answer
49 views

How to parameterize @findBy in pageFactory

I am trying to implement a page class for footer in OpenCart application. which is having multiple links with same or similar properties except link text. What is the best way so that we can define ...
-1
votes
0answers
164 views

Message: Error: Polling for changes failed: NetworkError when attempting to fetch resource

The inner HTML for catalogContainer, which is a WebElement, prints to the console -- but only from the constructor. Why? thufir@dur:~/NetBeansProjects/com.toscrape.books.selenium$ thufir@dur:~/...
1
vote
1answer
38 views

Scrape items from an HTML list

When Catalog receives a fragment for a book category, it seems to my eyes, to be just list items. For space, I didn't include that output. How can I ensure that only categories which belong to the ...
-1
votes
0answers
57 views

debugging an HTML list iterator with PageFactory

How do I assign, and what do a assign, to listItems in Catalog? Looking to iterate a HTML list using the Page Object Model with PageFactory. Output for this project: thufir@dur:~/NetBeansProjects/...
1
vote
1answer
46 views

POM: driver is passed as an argument? Always?

Example code: Driver is being passed as an Argument so that Selenium is able to locate the element on the browser (driver). Element is returned, so that an Action can be performed on it. ...
1
vote
1answer
33 views

How to pass the data provider data when page factory method is applied

I have created a sample project using the page factory. Now I want to use the data provider in the code and this is how I have done below. Is the approach correct? I have defined CommonElements class ...
1
vote
1answer
47 views

Page Object Model: need help with tests that uses more than 1 page object - Appium-Java-TestNG

I have a framework based on POM model. I am able to write test that only uses elements from 1 page but when I need to access elements from another page tests fail because I think it uses the wrong ...
1
vote
1answer
50 views

Element is not identifed in the second test method

I have a strange behavior : I created Test Class with 2 Test Methods as below. When I call AddLimitedBuyOrderwithRandom in the first method it works fine without any exception, but if I call ...
0
votes
2answers
61 views

How can I keep the variable alive across the project globally?

I have a BaseClass.java which extends PageObject.java class i.e. net.serenitybdd.core.pages.PageObject; Then I have two Page classes LoginPage.java and ProfilePage.java, these two also extending the ...
0
votes
2answers
127 views

How to parameterize locator in Selenium

I am new to selenium, And In my scenario I need to select a product for list of products in the page. And Product name to select is a test data. Now my query is,Can I create Object in Class level ( ...
3
votes
2answers
65 views

Using different sets of page objects with the same selenium tests

[This is cross-posted from StackOverflow - https://stackoverflow.com/questions/51702719/using-different-sets-of-page-objects-with-the-same-selenium-tests] I'm working on a selenium test suite for a ...
0
votes
3answers
451 views

How to locate “Login” button of Flipkart bootstrap login page? I tried in many ways, but still unable to locate element

Below are three options I tried, but I'm not able to locate Login button. When I tried using seleniumIDE, I got this xpath=(//button[@type='submit'])[2] But its not working in Webdriver. Can someone ...
0
votes
2answers
743 views

How to wait presence of elements in page factory

I'm using page factory and need to explicitly wait until particulate elements load. Please advise how to do that. up to now I have following.. public class HomePage { final WebDriver driver; ...
1
vote
2answers
455 views

What are the other ways of storing and accessing the webelement(locators) during automation testing

I'm aware and have also used two ways of storing the WebElements/locators (a.k.a Object Repository) External File (example: .properties , .yaml, .xml, etc...or any other file type) Using page ...
0
votes
2answers
43 views

How to retrieve a variable from one page and pass the same in another page

Is there any possibility to fetch a unique value from one page and search the same unique number in the other page? Workflow: 1.Entering details in a webpage (while entering the details, a unique ...
6
votes
1answer
2k views

POM vs PageFactory

I'm starting my career as a QA Automation Engineer coming from a Jr dev background. I noticed that there are two main design patterns for Selenium, POM and PageFactory. Which is the preferred design ...
0
votes
1answer
633 views

How to pass data through Excel sheet in Page Factory framework

I have created a login test script and verified home page also but now I have to add new customer and the form accepts following values Customer Name Gender Date Of Birth Customer Address , city, ...
4
votes
4answers
463 views

Does page factory pattern improve Selenium test performance

Is there any major performance difference between the traditional way of finding web elements vs using the page factory pattern? public WebElement username=driver.findElement(username).sendKeys(...
2
votes
4answers
915 views

Will the variable be still referencing the same webelement on page after page refresh, while using PageFactory

I use Page object pattern with Page Factory in selenium Webdriver with Java (as language). Will my inputSearch variable be still referencing to the same webelement on page, after refreshing the ...