Creating Object Repository In Selenium WebDriver Without Using Any External Data Source
We have seen Page Object Model In Selenium. In this post, I will explain a way ( Mostly what I have seen in many selenium frameworks) to design a proper page object model.
It is also asked in interview that if you have implemented encapsulation and abstraction in selenium framework. This post might help you.
We can achieve encapsulation and abstraction in page object model using this way. We will declare page objects as private and provide a getter method to access page object.
We will see an example below:
Page Object Class:
There might be many other ways of implementing or designing a better page object model. I shared what I have seen and used. If you have any other approach, please let others know as well.
If you have any doubt, feel free to comment below.
If you like my posts, please like, comment, share and subscribe.
Author: Amod Mahajan
A software Tester who is paid to judge products developed by others. Writing technical posts and creating YouTube videos are my hobbies.
1 thought on “Creating Object Repository In Selenium WebDriver Without Using Any External Data Source”
in above code we already entered Username and Password ,may i know why we are entering second time .