Stack Exchange Network

Stack Exchange network consists of 175 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
33 views

The name PageFactory does not exist in current context

I am using a POM in C# with Xunit as a framework, and am getting error in pagefactory for the following code: PageFactory.InitElements(driver, login); Error: "The name PageFactory does not exist ...
0
votes
1answer
159 views

PageFactory is deprecated in C# (.NET) - what to use instead of that

I was using for a long time PageFactory (in Java). Now writing tests in .NET I found out it's deprecated. Right now I just initialize all page objects when application starts using [BeforeScenario] ...
0
votes
1answer
52 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
84 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
vote
1answer
48 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
vote
1answer
54 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
59 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
55 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
52 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
64 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
192 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
70 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
601 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
1k 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
582 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
689 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
575 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
1k 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 ...