Page Object Model - Implementation

In the previous post, we discussed Page Object Model concepts. In this post, discussing its implementation with Python and Java

Python Implementation

Let's look into the implementation with Python. The framework has developed with PyTest. The folder structure of the test suite is given below

The base class file name is and it contains the commonly used UI methods such as click, enter_text, assert_text, etc

Let's have a look at page object class files. we've two class files, are Login and Registration. As mentioned in the previous post, The page object class file should contain the UI elements and methods associated with the Login page

Now we're looking at how the test class files are created. Class files are created in the AAA pattern like Arrange, Act and Assert. All tests are independent, Have a look at the below code snippet

The complete framework is available in the git repository 

Java Implementation 

Technically, there is no difference with the above implementation. There are page object class files and test class files. Please have a look at its Github repository. 

Share this