21
GENERIC SCRIPT GENERIC SCRIPT Everything can be automated, even Everything can be automated, even automation process itself automation process itself . . www.rasswelltest.com ©Copyright © 2003-2007 RASSWELL International Ltd. All rights reserved

“GENERIC SCRIPT” Everything can be automated, even automation process itself. “GENERIC SCRIPT” Everything can be automated, even automation process itself

Embed Size (px)

Citation preview

““GENERIC SCRIPTGENERIC SCRIPT””

Everything can be automated, even Everything can be automated, even automation process itselfautomation process itself..

www.rasswelltest.com©Copyright © 2003-2007 RASSWELL International Ltd. All rights reserved

Purpose of the PresentationPurpose of the Presentation The purpose of this The purpose of this

presentation is to take a presentation is to take a practical approach to practical approach to Automated Software Automated Software Testing and explain Testing and explain requirements for its requirements for its success.success.

ObjectivesObjectives Proof of concept and main Proof of concept and main

principles of Keyword and principles of Keyword and Data-Driven Automation Data-Driven Automation Testing Approach if Testing Approach if compared to Regular compared to Regular Automation Testing Model.Automation Testing Model.

Regular Automation Testing ModelRegular Automation Testing ModelMany organizations spend thousands of dollars on automation Many organizations spend thousands of dollars on automation

tools without considering training issues, software release tools without considering training issues, software release deadlines and other factors. Since no one then has the training or deadlines and other factors. Since no one then has the training or

time, the tools sit unused on a shelf, collecting dust.time, the tools sit unused on a shelf, collecting dust.

Business requirements/Use Cases Done by BA

Test Cases Implemented by QA/Testers

Complicated Automated Test scripts Recorded/executed by Automation Specialist/programmer

Test Results Analysis, Reports, Bug Tracking Done by QA/TestersThe full process MUST be repeated

every time if BR/UC are updated. And Automation can ONLY be implemented after receiving stable version of the project (Environment-?).

Each Business Function requires a script. There may be Each Business Function requires a script. There may be hundreds of Business functions. But Automated Test Script hundreds of Business functions. But Automated Test Script Recording is time consuming as the process requires to Recording is time consuming as the process requires to create 1 Test Script per 1 Test Case (so, if there are 500 Test create 1 Test Script per 1 Test Case (so, if there are 500 Test Cases then 500 Test Scripts are to be recorded); Cases then 500 Test Scripts are to be recorded);

Object Data Repository must be created per test Object Data Repository must be created per test script/project and all the data in the file must be hard coded script/project and all the data in the file must be hard coded and changed manually every time when application’s objects and changed manually every time when application’s objects are changed or new objects are added to the application.are changed or new objects are added to the application.

Manual Test Cases cannot be used directly in Automation, so Manual Test Cases cannot be used directly in Automation, so changes in Manual Test Cases require updates in Automated changes in Manual Test Cases require updates in Automated Scripts accordingly by Automation Developer onlyScripts accordingly by Automation Developer only..

Disadvantages of Regular ModelDisadvantages of Regular Model

Disadvantages of Regular Model (Cont’d)Disadvantages of Regular Model (Cont’d)

To implement a stable and comprehensive test To implement a stable and comprehensive test automation project, Automated Test Specialist / automation project, Automated Test Specialist / programmer should understand ALL business rules of programmer should understand ALL business rules of the project as well as the QA rules and objectives when the project as well as the QA rules and objectives when analyzing Business Requirements and developing a Test analyzing Business Requirements and developing a Test Plan.Plan.Automated Test Specialist/programmer cannot start Test Automated Test Specialist/programmer cannot start Test Script Recording until he or she obtains Test Cases from Script Recording until he or she obtains Test Cases from manual Testers and is given a stable software release of manual Testers and is given a stable software release of the project.the project.Results created by any automation tool must be Results created by any automation tool must be translated by a professional Test Automation specialist. translated by a professional Test Automation specialist. Format of input/verification records must be strictly Format of input/verification records must be strictly adhered to or the tests will fail .adhered to or the tests will fail .

Majority of Testers are involved in Majority of Testers are involved in Manual Test Case development Manual Test Case development process;process;

Manual Testers are not involved in Manual Testers are not involved in Test Automation process.Test Automation process.

Automated Test Script Recording Automated Test Script Recording is time consuming and a Test is time consuming and a Test Automation specialist MUST Automation specialist MUST understand all business understand all business rules/requirements to create rules/requirements to create scriptsscripts..

Lessons learned from Regular Testing model usageLessons learned from Regular Testing model usage

The foremost factor in the long-term success of automated testing is The foremost factor in the long-term success of automated testing is

very simple. If the code is maintainable, then it can be used easily very simple. If the code is maintainable, then it can be used easily throughout the project and be re-used for future projects. How to throughout the project and be re-used for future projects. How to create automation that will be accessible to non-technical business create automation that will be accessible to non-technical business analysts and is easy to use and maintain? analysts and is easy to use and maintain?

Test Plan driven method is the most cost-effective:Test Plan driven method is the most cost-effective:

Requires a minimum of technical personnel, requires just ONE Requires a minimum of technical personnel, requires just ONE “Generic Script”“Generic Script”, , introduces the least amount of change for the introduces the least amount of change for the manual testers. Developed manual Test Cases can be used for manual testers. Developed manual Test Cases can be used for manual testing, and are automatically usable for automated testingmanual testing, and are automatically usable for automated testing

The decision is - Encapsulated test case.The decision is - Encapsulated test case.

KEY TO SUCCESS!KEY TO SUCCESS!

GENERIC SCRIPTGENERIC SCRIPTCreate Create GenericGeneric source code allowing test cases to be written in a source code allowing test cases to be written in a simplified table format. This approach is known as KEYWORD-driven, simplified table format. This approach is known as KEYWORD-driven, DATA-driven or even "third generation" automation.DATA-driven or even "third generation" automation.

Benefits:Benefits: The numerous quantity of recorded Automated Test scripts will be The numerous quantity of recorded Automated Test scripts will be replaced by 1 Generic Automated Test Script/source code;replaced by 1 Generic Automated Test Script/source code;

““Generic Script”Generic Script” developed to interpret and execute test statements developed to interpret and execute test statements according to Commands/test inputs specified in test casesaccording to Commands/test inputs specified in test cases

(Example: EXCEL FORMAT)(Example: EXCEL FORMAT) Benefits: Benefits: One of the primary benefits of this architecture is that it allows testsOne of the primary benefits of this architecture is that it allows tests to be specified in a format that is easy to write and review. It's well to be specified in a format that is easy to write and review. It's well suited for test teams with domain experts who may not be strong suited for test teams with domain experts who may not be strong programmers.programmers.

““Generic Script”Generic Script” developed without developed without having a defined functionality ofhaving a defined functionality of a a particular application. particular application.

Benefits:Benefits: Test cases and Datapool can be completed later, when Test cases and Datapool can be completed later, when

functionality is defined and implemented by developers.functionality is defined and implemented by developers.

KEYWORD AND DATA-KEYWORD AND DATA-DRIVENDRIVEN

Data-Driven : The data used by the automated test suite is pulled out into a separate file, which is used by the test script.

Keyword-Driven: This is similar to data-driven, except keywords are used to indicate what steps the automated test suite should follow. Keywords are stored in a separate file.

MaintainabilityMaintainability :: KDD architecture KDD architecture allows tests to be specified in a format allows tests to be specified in a format that is easy to write and review. Even that is easy to write and review. Even with test automation, the manual test with test automation, the manual test engineer retains the key role. engineer retains the key role.

Visibility:Visibility: Test case in a script becomes Test case in a script becomes simply a manual test case declaration, simply a manual test case declaration, passing in required variables, and passing in required variables, and making a single function call. Test making a single function call. Test results and Analysis can be automatedresults and Analysis can be automated

Advantages of KDD ModelAdvantages of KDD Model

The main requirements for Test Automation The main requirements for Test Automation design covered by “Generic Script” method:design covered by “Generic Script” method:

StabilityStability:: Generic Script is more Generic Script is more reliable, robust and easy to maintain, not reliable, robust and easy to maintain, not dependable on business rules and dependable on business rules and function changes in project during function changes in project during iterative development process;iterative development process;

Scalability:Scalability: Automated Testing Automated Testing becomes more comprehensive and cost-becomes more comprehensive and cost-effective.effective. Test Cases Development and Test Cases Development and “Generic Script” script Coding can be “Generic Script” script Coding can be performed as parallel and independent performed as parallel and independent processes that save time and money for processes that save time and money for project implementation and testing.project implementation and testing.

Advantages of the KDD ModelAdvantages of the KDD Model

KDD KDD ArchitectureArchitecture “Generic Script” is based on recognition of CLASSES & OBJECT PROPERTIES that initialize according to COMMAND line in test case (key-word design). Parameters inserted in PARAMETER line are used as data input for the test case (Data-driven design).

Test Step data Object Type Method associated with Object

Button_Click Button Click

ECButton_Click ToolBar Button Click

RadioButton_Click RadioButton Click

CheckBox_Click CheckBox Click

Generic Automated Test

Script

Automated Test Library

Calls of Custom-defined

Functions

Test Case 1

Test Case 2

Test Case 3

Application Under Test

Keywords & Data Input

Verification check-points Capture (Output)

TEST RESULTS

Create Index –Test Scenario Create Index –Test Scenario Open and read Test Case Open and read Test Case

keywords – Test Case Commandskeywords – Test Case Commands data -DATAPOOLdata -DATAPOOL

Find Application Under Test (AUT) objects by Find Application Under Test (AUT) objects by keywords and apply methods associated with keywords and apply methods associated with objects and / or insert data assigned to the objects.objects and / or insert data assigned to the objects.Verify Application Under Test (AUT) checkpoints.Verify Application Under Test (AUT) checkpoints.

Send output to Test Log Result fileSend output to Test Log Result file..

Test results Test results and Analysis and Analysis can be can be automatedautomated

TEST MANAGERTEST MANAGER

To simplify the To simplify the usage of “Generic usage of “Generic Script” Script”

To create Test To create Test ScenariosScenarios

To modify Test To modify Test InputsInputs

To see results saved To see results saved in Excel/MS in Excel/MS ACCESSACCESS

TEST MANAGERTEST MANAGER

Test InfoTest InfoSelect ProjectSelect Project

View/Update Test CaseView/Update Test Case

View/Update DATAPOOLView/Update DATAPOOL

View/Update Expected View/Update Expected ResultsResults

ViewView Results Results

Open Automation ScriptOpen Automation Script

TEST MANAGERTEST MANAGER

Test ExecutionTest Execution

Insert Test Cases to Insert Test Cases to scenarioscenario

Insert Iterations numberInsert Iterations number

Run TestRun Test