Thursday, October 22, 2020

Another fun cases to automate in Wordpress

 TC1: Validate all plans in plan and pricing page

  • Go to plan and pricing page
  • Validate availability of Personal plan
  • Validate availability of Premium plan
  • Validate availability of Business plan
  • Validate availability of eCommerce plan
  • Validate availability of Configure plan

TC2: Validate login functionality
  • Go to login page
  • Read username and password from a text file
  • Enter username and password
  • Validate successful login attempt

TC3: Validate logout functionality
  • Go to profile page
  • Try to logout 
  • Validate successful logout attempt

tfw_play.robot (Robot test suite file)
  • Add resource files
  • Configure suite setup and teardown
  • Perform TC1, TC2 and TC3

tfw_initial.robot (Robot resource file)
  • Provide site URL
  • Open browser
  • Set selenium times
  • Maximize window size

tfw_header_bar.robot (Robot resource file)
  • Get all locators
  • Navigate menu links

tfw_plan_price_page.robot (Robot resource file)
  • Get all plan type locators
  • Validate presence of different types of plans in the page

tfw_login_page.robot (Robot resource file)
  • Get all locators
  • Read username and password from text files
  • Provide username and password and try to login

tfw_loggedin_page.robot (Robot resource file)
  • Get locators
  • Verify successful login attempt
  • Try to logout

tfw_loggedout_page.robot (Robot resource file)
  • Get locators
  • Verify successful logout attempt

user_name.txt (Text file to read)
  • Provide username

user_password.txt (Text file to read)
  • Provide password

Git repository link: https://github.com/wasiqul

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