Questions tagged [page-factory]

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

Filter by
Sorted by
Tagged with
0
votes
3answers
63 views

How to get value of WebElement init in PageFactory?

For example: @FindBy(xpath = "//div[@id='panel']//span[@class='name']") private WebElement panel; I've got a panel element. Is it possible to get value of XPath that I init above? I need a solution ...
1
vote
1answer
59 views

Is there a way to disable the logs created by the pagefactory

Could someone please let me know if there is any way we can disable the logs generated by the page factory for Chrome and Firefox I did try the below options for chrome and firefox and I had also ...
0
votes
1answer
44 views

Null PointerException on TESTNG ,pagefactory

LoginPage.Java package TestCases; import org.openqa.selenium.WebDriver; import org.openqa.selenium.support.PageFactory; import org.testng.annotations.Test; import ObjectRepository....
0
votes
1answer
53 views

POM + PF on project with web and responsive mobile web

I am using Selenium POM (page object model) with PF (page factory) for various desktop web browser tests. I just started quest - testing responsive mobile web on real mobile devices. I already have ...
0
votes
1answer
113 views

Selenium WebDriver “Cannot instantiate class ” error is coming

Below is my Base Class: package com.mercury.qa.base; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Properties; import java.util....
0
votes
1answer
32 views

Compilation error when extending class and defining a method

I am getting compilation error when I am extending Loginpage class through Loginbusiness, define a method but compilation throws an error to remove illegal identifiers(eg. public) and also for ...
2
votes
4answers
509 views

Replacement of @Findby in pagefactory for dynamic value with locator

I like to use POM pattern with page factory and in fact I have been using it since long in my various automation frameworks. Some time I am facing issue where I have to write text based xpaths in ...
-2
votes
1answer
74 views

How to assert that particular element is not displayed? [duplicate]

Can someone help me fixing NoSuchElementException. Let me explain what I am trying to do. I am trying to login into an application with multiple sets of data. Lets say, 1) Valid username and ...
-1
votes
1answer
54 views

Getting “java.lang.NullPointerException” exception when i try to run my POM test [duplicate]

I have 2 classes in my project First class contains all the webelements Second one for method where i am using this elements package facebook; import org.openqa.selenium.By; import org.openqa....
0
votes
1answer
440 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 ...
1
vote
1answer
2k 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
167 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
357 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
73 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
172 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
269 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 ...
3
votes
1answer
174 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
56 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
94 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
392 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
86 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
5answers
1k 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
2k 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
1k 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
46 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 ...
7
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
790 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
762 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
2k 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 ...