Automation Framework Design and Implementation

Automation Framework Design and Implementation

Automation Framework Design and Implementation

What is Automation Framework?

It is a Systematic Approach to automate Software Test Process.
Or
It is a set of guidelines, assumptions and process developed by experts
in order to perform tasks in an effective and optimized way.

Why Automation Framework?

In a Project Test Automation we create and use different types of files and we perform different types of tasks, in order to store and organize them all a systematic approach(Automation Framework) is required.

a) Files to be Created during Test Automation using UFT:

i) Shared Object Repository files (.tsr)

ii) Function Library Files (.vbs)

iii) Environment Variables file (.XML)

iv) Test batch Files (.mtb)

v) Recovery Scenario files (.qrs)

vi) Test Data files (.txt/ Excel/Database files etc…)

vii) Test Result Files(.txt/ Excel/Database files etc…)

viii) AOM Script Files (.vbs)

b) Tasks to be Performed:

i) Get Environment Details from Development Team and Select Appropriate Add ins

ii) Analyze the AUT in terms of Object Identification

iii) Select Test Cases or Areas for Automation

iv) Tool Setting Configuration and Globalize

v) Automation Framework Implementation

1) Create a Folder Structure to store and organize Automation Resources

2) Create Automation Resources and store

3) Create Organizer file

4) Generate Driver Script
(Build Tests Using Automation Resources)

5) Create Initialization Script

6) Tests Run

7) Analyzing Test Results and Reporting Defects

8) Select Tests for Regression Testing and Regression Testing Cycle 1

9) Analyzing Test Results and Reporting Defects

10) Select Tests for Regression Testing and Regression Testing Cycle 2
.
.
.
11) Final Regression

12) Update Automation Resources (If required)

13) Automation Resources Maintenance

Types of Automation Framework

1) Record / Play back Or Linear Framework

Description: In this approach Tests can be created using Recording feature.

Advantages:

i) Scripting knowledge is optional

ii) Easy to generate Tests and takes less time.

iii) Recommended for Short term projects

iv) Recommended for Dynamically changing UI Designs

v) Recommended for Dynamically changing Requirements

Disadvantages:

i) No Centralized maintenance of Test Objects

ii) Low in Performance

iii) Less or No concentration on Complex functionality testing

iv) Testers may not have command on tests, so locating Errors is difficult

v) UFT can’t record all types of statements or Steps.

2) Data Driven Framework

Description:
In this approach Tests can be created and executed using multiple sets of Test Data

Advantages:

i) Positive and Negative Testing

ii) Reliability Testing

Disadvantages:

i) Low in performance

ii) Maintenance is difficult

3) Modular Framework

Description:

In this approach Tests can be created and executed using Reusable components.

Advantages:

i) High in performance

ii) Maintenance is easy.

iii) Concentration on Complex functionality testing

iv) Locating Errors is easy

etc…

Disadvantages:

i) Scripting knowledge is mandatory

ii) Not suitable for short term projects

iii) Not suitable for dynamically changing requirements

4) Keyword Driven Framework

Keyword Driven Testing:

In this approach tests can be created and executed using Keywords.

What is Keyword?

A key to the code.

Or

A reserved word that refers a Command or Function or method or object or statement etc….

Types Keywords in UFT Test Automation

i) Utility Objects (UFT)

SystemUtil, RepositoriesCollection, Reporter, Services, Environment, Description etc….

ii) Test Objects (UFT)

Browser, Page, Link, WinButton, WebButton, VbButton etc….

iii) Automation Objects (VBScript)

objFso, objExcel, objWord etc…

iv) Functions (VBScript)

a) Built in Functions
1) Array (Array, IsArray, Split, Join, LBound, UBound…)
2) String (Left, Right, Mid, StrComp etc…)
3) Date & Time (Date, Time, Now, DateDiff etc…)
4) Conversion (Cint, Cdbl etc…)
5) I/O (InputBox, Msgbox)
6) Micellanious (VarType, CreateObject etc…)

b) User defined Functions

Login, Register etc…

v) Methods

a) Local methods

Acitivate, Set, Select, GetRoProperty, GetVisibleTest, run, Click, Close, SetSecure, navigate, Sync etc…

b) Global Methods

CreateFolder, CopyFolder, Read, ReadLine, ReadAll, Write etc….

Add, open, Save, SaveAs etc…

Open, Close, MoveText etc…

vi) VBScript statements

Dim, Const, If, For, Set, Option Explicit, On Error Resume Next etc….

vii) Others

Not, And, Or, Mod etc….

Key Elements of Automation Framework
a) A well defined folder structure

b) Organizer file

c) Driver Script

d) Initialization script

e) Process guidelines docs

Folder Structure

MainFolder
TestScenarios (For storing Test Scenario files)
ObjectRepository (For storing shared object Repository files)
FunctionLibrary (For storing library files)
Environment (For storing environment variables file)
Recovery (For storing Recovery scenario files)
TestData (For storing Test data files)
TestResult (For storing test results files)
Organizer (For storing organizer spread sheets)
Drivers (For storing Driver scripts)
Micellanious (Process guidelines docs, Approval docs, instructions by team lead etc…)

Initialization Script (AOM Script file

Process Steps:

i) Create Folder structure to store Automation Resources

ii) Create Automation Resources and Store

iii) Create Organizer
(* It provides instructions to Driver Script)

iv) Generate Driver Script
(* All resources can be associated with Driver Script, It executes tests one by one and export test result based on Organizer instructions)

v) Generate Initialization Script
(* Lunches UFT tool, Calls the Driver Script and closes UFT Tool)

Follow me on social media: