What is the Main difference between Page Object Model and Page Factory in Selenium? (Download Code)

preview_player
Показать описание
In this video, We are going to cover a very important topic for the Selenium interview and answers for experienced people, What is the main difference between Page Object Model and Page Factory in Selenium.

✅ What is Page Object Model?
Page Object Model (POM) is a design pattern, mostly used in test automation with selenium that creates Object Repository or OR for web UI elements(with Page object Classes.

We use the Page Object model because it reduces code duplication and improves test maintenance.

There are two important things -
There should be a corresponding Page Class
Page methods which perform operations on those WebElements

✅ Why Page Object Model?
Script maintenance
object repository is independent of test cases
Provides Structure to Automation Framework

✅ What is Page Factory in Selenium?
Page Factory in Selenium is an inbuilt Page Object Model concept for Selenium WebDriver but it is very optimized.

It is used for initialization of Page objects or to instantiate the Page object itself. It is also used to initialize Page class elements without using "FindElement/s."

Here as well, we follow the concept of separation of Page Object Repository and Test Methods. Additionally, with the help of PageFactory class, we use annotations @FindBy to find WebElement. We use initElements method to initialize web elements

@FindBy can accept tagName, partialLinkText, name, linkText, id, css, className, xpath as attributes.

-----------------------------------------------------

-------------------------------------------------------

#automationtesting #manualtesting #testautomation #thetestingacademy #scrolltest
🚀 Tools and services I recommend:
Some of the courses that I recommend to become better Automation Tester 🙌🙌

✅API Testing -

✅Cypress Tutorial with LIVE Projects -
Рекомендации по теме
Комментарии
Автор

Sir, Video is good and informative too. However please remove the background music from the video. It's causing problem to understand what you teaching and difficult to focus as well.

prashanttiwari
Автор

Please fix the audio. The popping and cracking is beyond obnoxious

jimbosliceOG
Автор

Any youtube series for POM without Page Factory

shilpac.g
Автор

Is it good to keep more than 1K locaters in page class or is there any way to manage this ?

corejavaforeveryone
Автор

Thank you for your tutorial. Can you provide us with the mindmap for this course because you have given us the wrong mindmap in your link!

SciencesEducationDE
Автор

What's the website you used for creating mindmap

AnjanPrasad
Автор

Hi Pramod,
is 30 days selemiun series is on..

deepak