White Box Testing
Test your code
   Home      Test-Automation-Framework-Architecture
 




We can specify test framework for automation in following layers 


Test Cases, Specifications or Behavior

Test Cases, Spec or Behavior we can write in TDD, BDD or ATDD. In BDD approach specifications and in ATDD approach test cases can be written by business analyst also. Best way to write test cases avoid business logic and verifications in this layer, So that they can be easily understood and written by any business stakeholder who don't need to have deeper knowledge from coding perspective.


Driver classes and Workflows, Scenario or Business layer

There is thin line between Driver classes and Workflows, Scenario or Business layer. We may don't have separate Workflows, Scenario or Business layer. Driver classes should have implementation of all the test case steps. Workflows, Scenario or Business layer should have all the business logic, verifications and scenario in steps.


Having separate business layer or driver classes don't pollute test classes, spec or behaviors and we have very cleaner approach from implementation perspective.


Entity, Models or Pages

For automating any application don't start writing code randomly, first model your application and start automating with entities. UI application should be modeled in pages, and for more complex pages application should be modeled in functionality. For example in UI application we can model them as header, footer, login and logout etc. 


Page modeling or snippets of pages have following benefits

  • Logically grouped functionality
  • Simulates user actions
  • Reduces code duplication
  • Code modularity
  • One place changes


Webdriver integrated tools or wrappers

Here we use webdriver integrated tools or we can write webdriver wrappers.


Having webdriver wrappers or integrated tools have following benefits.

  • One place for complex actions on element locators
  • One place changes for browser drivers specific code
  • One place changes for library or integrated tools replacements
  • Reduces code duplication
  • Code modularity  


Utility or Helper Module

This layer will have code for test hooks, environment and third party library for example loggers, reports, configuration, test repository, test dashboard, perf tools lib, backend hooks, db integration etc. 


Common or Shared Code Module

This layer will have common or shared code used across helper classes, webdriver wrappers, page models and driver classes.