#ATAGTR2018
Design Patterns in Test Automation
Shrinathacharya L M, Principal Quality Engineer, Allscripts
27th September 2018
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Schematic Diagram
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Tester is Coder!!
How many of you think?
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Tester is also a Designer!!
How many of you think?
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
For every successful test automation, how best framework is built, what are the
design patterns implemented in framework matters a lot.
This paper talks about design patterns implementation in test automation
framework starting from reusability, singleton, page object pattern, fluent
interface (Method chaining) and talk on different types of automation
framework. Also talk on how these patterns help in defining success of test
automation and return on investment for test automation.
This paper also gives the code snippet with example in explanation and
advantages of using it.
Abstract
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
What is Test Automation?
 Developing the automation scripts for the test cases by writing
code/script in C# or many other coding languages.
 Involves design test automation framework
 Implement design pattern in automation framework
 Implement to generating execution reports
 Develop utilities around automation
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
3 Mantra’s for Successful Test Automation
 Cost of Scripts Development
 Apply AI algorithms to auto generate scripts
 Cost of Maintenance
 Execution Efficiency
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Design Patterns used in Test Automation
 Page object pattern
 Fluent Interface (Method Chaining)
 Singleton pattern
 Facade design pattern
 Strategy design pattern
 Observer design pattern
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Test Automation Frameworks
• Data is pulled from flat file, excel, DB for
inputs
Data Driven
Framework
• Extension of data driven framework with
action to be performed on application under
test.
Keyword Driven
Framework
• Combination of more than one framework
Hybrid testing
framework
• Separating automation test scripts with
module level scripts by abstraction layer for
reusability and maintenance.
Model Based
Framework
• Functional validation with set of rules.
Behavior driven
framework
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Architecture of Model Based Framework
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Page Object Pattern
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Page Object Pattern – C# Code in Test Script
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Singleton Design Pattern– C# Code in Test Script
• A class with only one instance and provide a global point of access to it
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Model Based Framework Advantage
 Cost of Maintenance of automation scripts is easy
 Avoids duplication of code
 Modify code at single place
 Cost of Script development of automation script is cheaper
 Greater Coverage of automating test cases
 Page Object Pattern supports with reusability
 Singleton – Only one instance of object created with global point
of access.
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Fluent Interface (Method Chaining) Pattern
 Method Chaining within a Class
 Method Chaining with Multiple Class
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Typical Coding of Property Class and Usage
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Implementing Method Chaining in Single Class in C#
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Implementing Fluent Interface for Multiple Class in C#
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Continue…
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Advantages & Usage
 Used in Unit Testing and Automation Testing
 Readable and simple to understand by others
 Used in framework development and query based support
programming
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Test Automation Tools which supports C#
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Overcoming the challenges in Test Automation
 Implementing Design Patterns which are required for Test
Automation
 Direct access to third part WebAPI’s in case of complexities.
 Generating Web Based Reports
 Integrate with Test Management Tools (Ex: MTM- Microsoft
Test Management Tool)
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Author Biography
Shrinathacharya L M
Principal Quality Engineer
shrinathacharya.lm@allscripts.com
Allscripts
• Developer by profession | Automation tester by heart
| .NET programmer | Innovator
• TechGig Percentile in C# 98.65
• Patents filed as USPTO
• Specialist in automation framework development
• 15+ years of experience in development, automation (Web,
Windows, Mobile applications), Innovation
• Member of technology committee at Allscripts
• Speaker for Global Testing Retreat-2017 Conference,
DevOps++ Summit, Panel member -Selenium Summit-20178
• Speaker at ATA 13th Meetup, DotNetBLR meetup
• Published white paper in STC-2015, STC-2016
• Jury for STC-2018
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Question and Answers
#ATAGTR2018
As a author of this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media
marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us)
Thank You!!!

#ATAGTR2018 Presentation "Design Patterns in Test Automation" By Shrinathacharya L M

  • 1.
    #ATAGTR2018 Design Patterns inTest Automation Shrinathacharya L M, Principal Quality Engineer, Allscripts 27th September 2018
  • 2.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Schematic Diagram
  • 3.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Tester is Coder!! How many of you think?
  • 4.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Tester is also a Designer!! How many of you think?
  • 5.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) For every successful test automation, how best framework is built, what are the design patterns implemented in framework matters a lot. This paper talks about design patterns implementation in test automation framework starting from reusability, singleton, page object pattern, fluent interface (Method chaining) and talk on different types of automation framework. Also talk on how these patterns help in defining success of test automation and return on investment for test automation. This paper also gives the code snippet with example in explanation and advantages of using it. Abstract
  • 6.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) What is Test Automation?  Developing the automation scripts for the test cases by writing code/script in C# or many other coding languages.  Involves design test automation framework  Implement design pattern in automation framework  Implement to generating execution reports  Develop utilities around automation
  • 7.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) 3 Mantra’s for Successful Test Automation  Cost of Scripts Development  Apply AI algorithms to auto generate scripts  Cost of Maintenance  Execution Efficiency
  • 8.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Design Patterns used in Test Automation  Page object pattern  Fluent Interface (Method Chaining)  Singleton pattern  Facade design pattern  Strategy design pattern  Observer design pattern
  • 9.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Test Automation Frameworks • Data is pulled from flat file, excel, DB for inputs Data Driven Framework • Extension of data driven framework with action to be performed on application under test. Keyword Driven Framework • Combination of more than one framework Hybrid testing framework • Separating automation test scripts with module level scripts by abstraction layer for reusability and maintenance. Model Based Framework • Functional validation with set of rules. Behavior driven framework
  • 10.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Architecture of Model Based Framework
  • 11.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Page Object Pattern
  • 12.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Page Object Pattern – C# Code in Test Script
  • 13.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Singleton Design Pattern– C# Code in Test Script • A class with only one instance and provide a global point of access to it
  • 14.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Model Based Framework Advantage  Cost of Maintenance of automation scripts is easy  Avoids duplication of code  Modify code at single place  Cost of Script development of automation script is cheaper  Greater Coverage of automating test cases  Page Object Pattern supports with reusability  Singleton – Only one instance of object created with global point of access.
  • 15.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Fluent Interface (Method Chaining) Pattern  Method Chaining within a Class  Method Chaining with Multiple Class
  • 16.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Typical Coding of Property Class and Usage
  • 17.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Implementing Method Chaining in Single Class in C#
  • 18.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Implementing Fluent Interface for Multiple Class in C#
  • 19.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Continue…
  • 20.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Advantages & Usage  Used in Unit Testing and Automation Testing  Readable and simple to understand by others  Used in framework development and query based support programming
  • 21.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Test Automation Tools which supports C#
  • 22.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Overcoming the challenges in Test Automation  Implementing Design Patterns which are required for Test Automation  Direct access to third part WebAPI’s in case of complexities.  Generating Web Based Reports  Integrate with Test Management Tools (Ex: MTM- Microsoft Test Management Tool)
  • 23.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Author Biography Shrinathacharya L M Principal Quality Engineer shrinathacharya.lm@allscripts.com Allscripts • Developer by profession | Automation tester by heart | .NET programmer | Innovator • TechGig Percentile in C# 98.65 • Patents filed as USPTO • Specialist in automation framework development • 15+ years of experience in development, automation (Web, Windows, Mobile applications), Innovation • Member of technology committee at Allscripts • Speaker for Global Testing Retreat-2017 Conference, DevOps++ Summit, Panel member -Selenium Summit-20178 • Speaker at ATA 13th Meetup, DotNetBLR meetup • Published white paper in STC-2015, STC-2016 • Jury for STC-2018
  • 24.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Question and Answers
  • 25.
    #ATAGTR2018 As a authorof this presentation I/we own the copyright and confirm the originality of the content. I/we allow Agile testing alliance to use the content for social media marketing, publishing it on ATA Blog or ATA social medial channels(Provided due credit is given to me/us) Thank You!!!

Editor's Notes

  • #2 Schematic diagram