POM for UI automation testing

We are now doing an UI automation testing in Selenium WebDriver. It is not a tough task because we are following POM, just need to find elements and perform operations on them. So, what is POM?
POM stands for Page Object Model. 

As be seen in above photo, under this model, for each web page in the application, we create a corresponding page class for it. This page class will find the WebElements of that web page and also we dedine page methods to perform operations on those WebElements. We put all the page classes in a Pages folder.

And then we create a separate class to do all the tests, puting all test methods in that class file. In the future, if any element is changed, we just need to change element in the page class instead of in every test related to that element. 

Code becomes less and optimized because of the reusable page methods in the POM classes!




0 comments:

Post a Comment