Wednesday, October 21, 2020

A fun case to automate cont.

A few month earlier I wrote an automation script in Robot framework which will go to bongobd and navigate to a specific section and play a video. Few days ago I tried to run it and found out it is failing. Upon further investigation I realize the whole section is removed from the site thus the locator is not able to find it and the whole case is failing. I decide to fix it to run it again.

When I was fixing it I feel the need to validate all category pages first so that I can find it in advance if any sections are missing or updated. Then search for the same video and play it. While updating I feel the need to redesign the code for the ease of maintenance, reusability and better understanding. So I decided to go for page object modelling (POM).

In order to design it in POM first I investigate which parts of the website is remaining the same across all pages so I can model them as page objects. Find out header navigation bar and footer are always remaining the same. So, created headerBar.robot and footer.robot objects.

After that as I am interacting with the search result page, I created another object called searchResult.robot and all my test cases were listed in bongo.robot like before. And also make sure that all validations are done here and no where else.

Project was running fine and notice that some actions need to taken at start and writing those action in test case file does not feel right to me. So, I created another object called initial.robot and call it upon setup. And put all locators and inputs in variable so future updates will be easy.

I know that there is still room for improvement but still I am satisfied with all changes I have done. I think it is much more maintainable and reusable than before.

Here is the git hub repository link,

github.com/wasiqul/robotframework_bongobd

No comments:

Post a Comment