As now we have created our first hello selenium test successfully, I think it is the good time to know something about architecture of framework that we are going to design. It is always good to know what actually happens when you do something as it gives you a better understanding of it and you can easily know what you need to do, how you need to do and where could be the fault if something wrong happens.
So, let's go through it in brief.
Page Object Model
The basic idea of this page object model is that we have a class for each page or a logical part in our application and it contains methods in it which represents the functionality of this page. Further, tests interacts with the corresponding page class and access its methods as required.
In above picture there is a login page that is there in our application and corresponding to this login page there is a LoginPage class having all the methods defined in it which corresponds to the various functionalities of this login page.
After this, there are few tests which are interacting with the login class to execute a particular scenario.
In page object model, it is not necessarily true that there could be a class for each page in our application. We might create a page for each logical module too e.g. header and footer.
Further, methods in page class could be all the actions that user can perform on this page rather than creating one for each ui element on the page.
In general, effectiveness of the framework depends upon how actually we manage different layers? How good our classes are? Have we covered all the functionalities that a page represents? Can user write all his test scenarios using this framework and how easily he/she can use this framework?
So, we should always keep these things in mind while creating a framework besides other important things.
In my next post I will be writing about some useful facts that you should keep in mind while developing a framework.
Thanks for reading this post and see you in next post. Cya!
Comments
Post a Comment