Jun 3, 2018

Selenium WebDriver Automation Best Practices (Refer to testautomationguru)

Notes while learning from testautomationguru.com (THANKS!) which need strong development skills ;) With help of Katalon, seems most best practices could be implemented :) Keep the summary to remind best practices will always help!

1. Page Objects Model, + Arquillian Framework
  1. Page Objects: Page objects is a well known design pattern, widely accepted by the automation engineers, to create separate class file for each page of the application to group all the elements as properties and their behaviors / business functionalities as methods of the class. But it might not be a great idea always, especially when the page has more / different sets of elements / complex element like a grid / calendar widget / a HTML table etc. ex http://www.testautomationguru.com/keyword-driven-framework-for-localization-testing-using-selenium-webdriver/ (Table/keyword driven + page objects model)
  2. Selenium WebDriver – Blackbox Automated Testing using Arquillian Framework 
  3. Selenium WebDriver – Advanced Page Object Pattern with Page Fragments using Arquillian Graphene (Single Responsibility Principle)


3. Design patterns in Test Automation: http://www.testautomationguru.com/category/design-pattern/

"Note: Your aim should not be to implement a certain pattern in your framework. Instead, identify a problem in the framework and then recognize the pattern which could be used to solve the problem. Do not use any design pattern where it is not really required!!"

Refer to https://sourcemaking.com/design_patterns or http://www.oodesign.com/ for design patterns.

4. WebDriver in Fluent Style (java 8 Stream)

Selenium WebDriver – How To Design Page Objects In Fluent Style

5. Test Suite Management:
(By creating a custom annotation and using TestNG’s listener, We are able to skip methods without any issues and maintains the order the test execution.)

No comments: