sqamethods Approach to Building Testing Automation Systems

Similar documents
Design and Implementation of File Sharing Server

Standards for Test Automation

Microsoft SharePoint 2010

Dynamism and Detection

Designing an Automated Web Test Environment

Design for Testability of Web Applications Manager s Perspective

Getting Help...71 Getting help with ScreenSteps...72

The Case for Office 365 Backup. Uncovering critical reasons why organizations need to backup Office 365 data

3Lesson 3: Web Project Management Fundamentals Objectives

Heuristic Evaluation Project. Course Agent

Creating an Intranet using Lotus Web Content Management. Part 2 Project Planning

Create-A-Page Design Documentation

Heuristic Evaluation Project

Three General Principles of QA. COMP 4004 Fall Notes Adapted from Dr. A. Williams

Azon Master Class. By Ryan Stevenson Guidebook #5 WordPress Usage

SOFTWARE DESIGN DOCUMENT GROUP SUCH CARPOOL SYSTEM

Better late than never

Table of Contents What is Test Automation Framework?... 3 Different types of Frameworks used in QTP... 4 Linear Framework in QTP...

WHITE PAPER ENHANCING MANUAL TESTING Xoriant Inc. All Rights Reserved

DRACULA. CSM Turner Connor Taylor, Trevor Worth June 18th, 2015

Family Map Server Specification

Fully Optimize FULLY OPTIMIZE YOUR DBA RESOURCES

BEAWebLogic. Portal. Overview

HTML 5 Form Processing

How To Construct A Keyword Strategy?

4. Java Project Design, Input Methods

Sample Exam. Advanced Test Automation - Engineer

PYTHON GUI PROGRAMMING COOKBOOK BY BURKHARD A. MEIER DOWNLOAD EBOOK : PYTHON GUI PROGRAMMING COOKBOOK BY BURKHARD A. MEIER PDF

Smart Bulk SMS & Voice SMS Marketing Script with 2-Way Messaging. Quick-Start Manual

Senior Technical Specialist, IBM. Charles Price (Primary) Advisory Software Engineer, IBM. Matthias Falkenberg DX Development Team Lead, IBM

XBMC. Ultimate Guide. HenryFord 3/31/2011. Feel free to share this document with everybody!

This is an oral history interview conducted on. October 30, 2003, with IBM researcher Chieko Asakawa and IBM

RICH ENTERPRISES. Small Business Series. Getting Started with HTML

Software Testing Prof. Meenakshi D Souza Department of Computer Science and Engineering International Institute of Information Technology, Bangalore

ASNA Case Study. ASNA Wings: Re-imagining Modernization at INFOCON Both Ways. Leaders in IBM i Modernization

LeakDAS Version 4 The Complete Guide

Prototype 1.0 Specification

Architectural Design

Amyyon customers can t wait to get their hands on it s new application, developed in Uniface.

You Can t Move Forward Unless You Can Roll Back. By: Michael Black

Unit 1 : Principles of object oriented programming

MERCATOR TASK MASTER TASK MANAGEMENT SCREENS:- LOGIN SCREEN:- APP LAYOUTS:-

The RASTA Framework. Joel Becker October 3, 2001

Principles of Programming Languages. Objective-C. Joris Kluivers

PORTAL RESOURCES INFORMATION SYSTEM: THE DESIGN AND DEVELOPMENT OF AN ONLINE DATABASE FOR TRACKING WEB RESOURCES.

Digitized Engineering Notebook

with TestComplete 12 Desktop, Web, and Mobile Testing Tutorials

Successful Test Automation without Coding. Marc J. Balcer Chief Architect Model Compilers

Documentation Nick Parlante, 1996.Free for non-commerical use.

The 4 Ts of Test Automation: Your Planning Guide to Success Workshop. Presented By: David Dang Questcon Technologies

SharePoint 2013 Site Owner

A³ Platform Quick Start

Using X-Particles with Team Render

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #17. Loops: Break Statement

Know what you must do to become an author at Theory of Programming. Become an Author at. Theory of Programming. Vamsi Sangam

Four Essential Steps for Removing Risk and Downtime from Your POWER9 Migration

ManifoldCF- End-user Documentation

CLIENT ONBOARDING PLAN & SCRIPT

WORKING IN TEAMS WITH CASECOMPLETE AND SUBVERSION. Contents

IBM C Rational Functional Tester for Java. Download Full Version :

Data Structure Series

Visual Design Flows for Faster Debug and Time to Market FlowTracer White Paper

Server Manager User and Permissions Setup

CLIENT ONBOARDING PLAN & SCRIPT

Multiple Variable Drag and Drop Demonstration (v1) Steve Gannon, Principal Consultant GanTek Multimedia

CONFERENCE PROCEEDINGS QUALITY CONFERENCE. Conference Paper Excerpt from the 28TH ANNUAL SOFTWARE. October 18th 19th, 2010

Biocomputing II Coursework guidance

Digital Marketing Manager, Marketing Manager, Agency Owner. Bachelors in Marketing, Advertising, Communications, or equivalent experience

Question 1: What is a code walk-through, and how is it performed?

IBM EXAM QUESTIONS & ANSWERS

Step 1 - Learning & Discovery

Chapter01.fm Page 1 Monday, August 23, :52 PM. Part I of Change. The Mechanics. of Change

Payroll Made Easy: Developing a Web Based System for Student Employee Payroll

Microsoft Windows SharePoint Services

How to Build a Culture of Security

Acceptance Testing. Copyright 2012 Gary Mohan.

Arduino IDE Friday, 26 October 2018

Passit4Sure.C _54,QA. Good explanation provided and the references added most of the questions.

High Performance Computing Prof. Matthew Jacob Department of Computer Science and Automation Indian Institute of Science, Bangalore

Rational Functional Tester - Tips and Tricks

Web Evaluation Report Guidelines

Creating Pages with the CivicPlus System

CS 112 Project Assignment: Visual Password

Do this by creating on the m: drive (Accessed via start menu link Computer [The m: drive has your login id as name]) the subdirectory CI101.

Chapter. Relational Database Concepts COPYRIGHTED MATERIAL

Technology Note. ER/Studio: Upgrading from Repository (v ) to Team Server 17.x

STUDENT LESSON A5 Designing and Using Classes

Master Syndication Gateway V2. User's Manual. Copyright Bontrager Connection LLC

Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

XML and API Documentation

The Web Service Sample

TALENT Part 1 page 1 of 1

elton Group 3. Michael Spetås, Lars Brekke, Sondre Wiersdalen and Richard Wangsvik System Requirements & Design (SRD)

Login Brothers Bookmarks Its Place in B2B and B2C E-Commerce

Notes Discussed project needs and possible tool use Everything needs to be documented very well for future use Stretch goal discussed

EMPLOYEE DIRECTORY (SHAREPOINT ADD-IN)

A Thorough Introduction to 64-Bit Aggregates

The first program: Little Crab

INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY

15-415: Database Applications Project 2. CMUQFlix - CMUQ s Movie Recommendation System

Transcription:

sqamethods Approach to Building Testing Automation Systems By Leopoldo A. Gonzalez leopoldo@sqamethods.com

BUILDING A TESTING AUTOMATION SYSTEM...3 OVERVIEW...3 GOALS FOR AN AUTOMATION SYSTEM...3 BEGIN WITH THE END IN MIND...4 THE THREE TIER SYSTEM...5 APPLYING THE CONCEPT...6 BREAKING DOWN THE COMPLEXITY...8 CONCLUSION...10 2008 sqamethods Page 2 of 11

Building a Testing Automation System Overview While there may be many ways of building a testing automation system and most implementations can perform a certain level of automation, I believe that ultimately the automation system should give testers the capability of an easy transition from a manual test script to an automated one. It is up to the automation engineer to hide the complexities of code behind an elegant set of instructions that manual testers can understand. This paper is a collection of thoughts and approaches that describe my experience in building such a system. Goals for an Automation System Early in my testing automation career I realized that in order for an automation system to be successful, it had to provide five basic functions. Without these capabilities, the automation system would lack in flexibility and reliability. 1. The automated script must be able to be executed as a single entity. This simply means that the tester must be able to pick a script from a list of scripts and choose to run it alone. The script must know that it is not running as part of a suite and if needed, be able to gather its own information. 2. The automated script must be able to be executed as a suite. The same script must know that when running as part of a suite, it cannot stop and gather information from the user as it would defeat the purposed of running unattended. Also there are times when you don t want the script to exit the application under test only to be re-launched by the next script in the 2008 sqamethods Page 3 of 11

suite. This is a waste of time and only prolongs the execution time. The script must know not to exit but to return to a HOME state. 3. The script must be data driven. The data the script uses must reside somewhere other than in the script itself. There should never be hard coded data inside the script. Data driven scripts allow the tester to create multiple test case scenarios without having to modify the code itself. 4. All of the test scripts in a suite must execute. This means that the failure of one script should not affect the execution of the next one. If during the execution of a script, the application aborts, the script must be able to recover from that failure and attempt to continue with the next script in the suite. 5. The automated script should use the same logic flow as the manual script The transition between a manual script and an automated one will be a lot easier if when converting a script, the tester can follow the same logic flow and use some of the same language he used before. While each of the above goals is worthy of its own analysis, this paper will not cover all five goals, however I will talk a little on the last one. Begin with the End in mind Let s begin with a visualization of what a testing automation system should be for a QA shop. This system should be treated as a useful tool to be used during the QA test cycle. It should be the first line of tests to be executed when a new build is created (smoke test). It should be used as a regression test mechanism (regression test), it should be updated with new test cases for new functionality and finally, if performance test is included, it should be used to measure the system s performance under varying loads. 2008 sqamethods Page 4 of 11

sqamethods Approach to Building Testing Automation Systems But the question is, how do get from where you are to a system that is part of a well oiled QA testing machine? The Three Tier System The three tier system of software development is very well known and utilized for big projects. It is modular; it separates functions at their right domain area and is just about the right size to avoid too much complexity. By the same token, in my experience I found out that this model works fine for testing automation systems as well. The only difference is that rather that breaking the model down to SQL, Business Objects and GUI as in the traditional three tier approach, a testing automation system should be made out of Common Utilities, Business Objects and Test Cases. The methods in the Common Utilities would be inherited by the Business Objects, and these would be inherited by the Test Case scripts. As illustrated in Figure 1. Figure 1 This model allows us to grow capability at the right level of abstraction. If I need a method that would be useful to all of the automation system, I would write it at 2008 sqamethods Page 5 of 11

the Common Utilities tier. However, if the method falls inside one of the business domains, such as ordering, navigation, admin, etc., then I would write it at the Business Object tier. The last tier to build is the actual test script. The syntax used by the test script should follow closely the logic used in the manual test script. Be aware that you will not be able to completely remove the flavor of the language from your testing automation tool, but at least you will have a system on which a tester can venture out and try to develop an automated script by himself even though he may not be a programmer. Applying the Concept To see the benefit of this model, let s examine a manual test case and create the necessary components that will allow us to mirror the syntax of the manual test case. The typical format of a manual test is as follows: Test Step Expected Outcome Actual Outcome Result Launch the Internet Explorer The system should display the internet browser Pass / Fail Login to the system by The system should display accessing URL the login page www.mytest.com Pass / Fail Verify the layout of the login page Login as customer user Bob Etc The page should display elements according to the agreed style guide The system should display the order page Table 1 Pass / Fail Pass / Fail Interestingly enough, IBM Manual Tester implements a different format for manual testing that deserves a second look. The instructions above are flattened out and the tool provides the ability to either place it in the log via the Verification Point attribute or skip it by assuming it was a test step. This flat format allows the creation of multiple steps for a single verification point or vice versa; a single step with multiple verification points. In the case of step #3 Verify the layout of the page, the system 2008 sqamethods Page 6 of 11

would allow you to enter many verification points for the many objects displayed on the screen. Table 1 above table would read something like Figure 2:! Launch Internet Explorer! The system should display the internet browser! Login to the system by accessing URL www.mytest.com! The system should display the login page! Verify the layout of the page! The page should display the elements according to the agreed style guide.! Login as customer user Bob.! The system should display the order page. Figure 2 The goal I set for myself when building a testing automation system is to closely match the syntax of the flatten format. I understand that while I may never get to the point where it reads the same, I can certainly copy the flow of the manual test case by making calls to the methods that give me that functionality. Figure 3 demonstrates this idea. 2008 sqamethods Page 7 of 11

<java headers and declarations > public void testmain(object[] args) { TestResult tr = new TestResult(); // --------------------------------------------------------------------------------- // Launch the browser to the URL provided tr = launchbrowser("http://www.sqamethods.com"); // If the launchbrowser method fails for whatever reason, then we need to log it and exit if (tr.gettestverdict() == FAILED) { logmessage(failed, "Sorry, I could not launch the browser ); System.exit(0); } // Object tr needs to be cleared out tr = null; // --------------------------------------------------------------------------------- // Verify the components in the header cellwin().performtest(headerelementsvp()); // Verify the contents of the main page tabletable().performtest(mainpagevp()); // --------------------------------------------------------------------------------- // Login user type USER Bob tr = loginuser("bob", USER); } // If the loginuser method failed for whatever reason, then we need to log it and exit if (tr.gettestverdict() == FAILED) { logmessage(failed, "Sorry, I could not log user Bob, TRUE); System.exit(0); } tr = null; Figure 3 Don t be taken back by the amount of code necessary to produce the same result as the manual script; after all we are creating a testing automation system, and that requires some coding. What I do want to point out is that the steps from the manual test have been replicated by the sections bounded by the dashes. The code is readable because the methods are named after the words used by the manual tester. Breaking down the Complexity In spite of the Java flavor of the script shown in Figure 3, the script hides a lot of infrastructure work that allows the testing automation system to run smoothly. For 2008 sqamethods Page 8 of 11

example, the launchbrowser method hides that if the browser cannot be launched, it will return a verdict of FAILED. I can then instruct the script not to bother any more and exit gracefully. Notice that in the process of launching the browser, I created an object of type TestResult, this object contains the typical results gathered during a test or during the execution of a method. A test can result in a Pass/Fail state and with either result; it could generate data gathered during the process. Inside the object type TestResult, there is a field that will hold the value of the data gathered. In this example I do not show that capability but I bring it up to illustrate that the object is flexible enough to hold other data types if needed. The next sections are the verification points that check for the properties of the header and the main html document. I don t write custom code in these sections because I believe that the Verification Point feature from the automated tool does a better job in checking these properties than I could. Also I don t do anything with the results of the verification point tests, I let the tool log it and then continue. Let s look at the loginuser method, at first glance it appears that this method is not that complicated, after all, how hard is it to log Bob in? However, when you look at how this method has been implemented you will realize that the concept of inheritance is well at work. The loginuser was implemented at the Business Object layer and is part of the Login class. The Login class was inherited by the automated script and therefore all of the methods defined in that class are now part of the automated script. In turn, the loginuser method utilizes methods from the Common Utilities layer also via inheritance. These are the readdata and the loaddriver methods that take the name of Bob and perform a database read to the table Users ; where Bob and his password are stored. 2008 sqamethods Page 9 of 11

In this case, I don t consider that hard coding the name of Bob as breaking my own rules since using the name makes the script a lot more readable. Trying to abstract the name would only add more layers of unnecessary complexity. Notice that throughout the script I check for the state of my TestObject tr, and if it fails, then I write it to the log. The logmessage method is implemented at the Common Utilities layer and allows the tester to write items to the log. The log can even accept a parameter to take a snapshot of the screen to capture the moment the script failed. As you can see, trying to replicate the logic flow from the manual test case can be a bit challenging since at the same time, I m trying to stay true to my own goals. The code sample above provides just a glimpse of how this can be accomplished, and while it did not show the other features, it provides an idea as to how I go about architecting a testing automation system. Conclusion Developing a testing automation system should be approached with the same care and analysis as any other software development. However, the automation engineer must not lose sight that the system he/she is building needs to provide a solution to the QA team as quickly as possible. Building a system for the sake of creating something cool harms the company and the testing automation industry. Therefore, in choosing whom you trust to develop your testing automation system should be a top priority. Make sure that the person you hire has the ability to articulate his/her vision and approach to developing an automation system and that he/she has experience doing it. For more information on how to implement this type of automation system in your company, visit us at w w w. s q a m e t h o d s. c o m or contact me at leopoldo@sqamethods.com. 2008 sqamethods Page 10 of 11

About Leopoldo Gonzalez I started my career in the Software Development industry in 1984. During this time I have performed duties as a Developer, Tester, User Group Test Coordinator and Testing Automation Architect. I have compiled my experiences, best practices and practical tools in a workshop I call Software Testing 101 - What Every Tester Needs To Know About Software QA. This workshop is aimed at individuals who are new to the world of Software Testing and QA, but also has valuable information for seasoned Testers such as the subject discussed in this paper. For more information on my workshop, visit us at www.sqamethods.com 2008 sqamethods Page 11 of 11