Capture and Replay Often used for regression test development –Tool used to capture interactions with the system under test. –Inputs must be captured;

Slides:



Advertisements
Similar presentations
Chapter 18 Building the user interface. This chapter discusses n Javas graphical user interface. n Swing: an enhancement of a library called the Abstract.
Advertisements

GUI Testing By Norbert Haché. Contents b What is GUI testing b Elements of GUI testing b Old Approach (TRUMP Project) b Scripting b Capture / Replay b.
1 A Test Automation Tool For Java Applets Testing of Web Applications TATJA Program Demonstration Conclusions By Matthew Xuereb.
CIMCO Integration Software Products
Test Automation Framework Ashesh Jain 2007EE50403 Manager Amit Maheshwari.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Android: Hello World Frank Xu Gannon University. Steps Configuration ▫Android SDK ▫Android Development Tools (ADT)  Eclipse plug-in ▫Android SDK and.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
V0.01 © 2009 Research In Motion Limited Introduction to Java Application Development for the BlackBerry Smartphone Trainer name Date.
Google Android as a mobile development platform T Internet Technologies for Mobile Computing Olli Mäkinen.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins.
SiS Technical Training Development Track Technical Training(s) Day 1 – Day 2.
Cambodia-India Entrepreneurship Development Centre - : :.... :-:-
© 2008 IBM Corporation Behavioral Models for Software Development Andrei Kirshin, Dolev Dotan, Alan Hartman January 2008.
Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department.
Selenium – Testing Tool. What is Selenium? Selenium is a robust set of tools that supports rapid development of test automation for web-based applications.
1 Introduction to Human Computer Interaction  Livecode Overview  Based on Livecode User Guide from RunRev Ltd. (2010) 
How XSL Formatter works Operation System Requirements How to format GUI for operating on Windows screen Application Integration Interface.
DEMONSTRATION FOR SIGMA DATA ACQUISITION MODULES Tempatron Ltd Data Measurements Division Darwin Close Reading RG2 0TB UK T : +44 (0) F :
Introduction to Java Swing “We are the sultans of swing” – Mark Knopfler.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Sikuli Ivailo Dinkov QA Engineer PhoneX Team Telerik QA Academy.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 16: Java Applets & AWT Fundamentals of Web Programming.
Testing. What is Testing? Definition: exercising a program under controlled conditions and verifying the results Purpose is to detect program defects.
Glink: GCOS e-business in an application server architecture Summit 2000, Jim Gallagher.
What is Sure BDCs? BDC stands for Batch Data Communication and is also known as Batch Input. It is a technique for mass input of data into SAP by simulating.
© 2012 LogiGear Corporation. All Rights Reserved Robot framework.
© Ericsson Interception Management Systems, 2000 CELLNET Drop Administering IMS Module Objectives Manage the directory structure and files Manage.
David Streader Computer Science Victoria University of Wellington Copyright: David Streader, Victoria University of Wellington GUI and the UI API COMP.
Copyright© Jeffrey Jongko, Ateneo de Manila University Android.
Welcome to CIS 083 ! Events CIS 068.
Execution Environment for JavaScript " Java Script Window object represents the window in which the browser displays documents. " The Window object provides.
Chapter 8: Writing Graphical User Interfaces
DUE Hello World on the Android Platform.
© 2006 IBM Corporation IBM WebSphere Portlet Factory Architecture.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Automated GUI testing How to test an interactive application automatically?
Prepared by Fareeha Lecturer DCS IIUI 1 Windows API.
Lecture 5: Interaction 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
Developing the Game User Interface (UI) Lesson 5.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Exploring an Open Source Automation Framework Implementation.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Jan Hatje, DESY CSS ITER March 2009: Technology and Interfaces XFEL The European X-Ray Laser Project X-Ray Free-Electron Laser 1 CSS – Control.
Graphic User Interface. Graphic User Interface (GUI) Most of us interact with computers using GUIs. GUIs are visual representations of the actions you.
Graphics and Event-Driven Programming in Java John C. Ramirez Department of Computer Science University of Pittsburgh.
Automated GUI testing How to test an interactive application automatically?
I Power Higher Computing Software Development Development Languages and Environments.
SilkTest 2008 R2 SP1: Silk4J Introduction. ConfidentialCopyright © 2008 Borland Software Corporation. 2 What is Silk4J? Silk4J enables you to create functional.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
1 CEN 4072 Software Testing PPT3: Making the program fail.
GUIs Basic Concepts. GUI GUI : Graphical User Interface Window/Frame : a window on the screen Controls/Widgets : GUI components.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Jan Hatje, DESY CSS GSI Feb. 2009: Technology and Interfaces XFEL The European X-Ray Laser Project X-Ray Free-Electron Laser 1 CSS – Control.
Intoduction to Andriod studio Environment With a hello world program.
T EST T OOLS U NIT VI This unit contains the overview of the test tools. Also prerequisites for applying these tools, tools selection and implementation.
Glink for Java: applet, application and an API for integrating access to Bull, IBM, UNIX and Minitel systems with your Java based e-business applications.
Sep 181 Example Program DemoTranslateEnglishGUI.java.
12-Jun-16 Event loops. 2 Programming in prehistoric times Earliest programs were all “batch” processing There was no interaction with the user Input Output.
IV&VS Capabilities. 2 V IRTUAL USER GENERATOR 3 V IRTUAL U SER T ECHNOLOGY AND ADVANTAGES  Simulates a real user  Requires less resources – machines.
Accelerometer based motion gestures for mobile devices Presented by – Neel Parikh Advisor Committee members Dr. Chris Pollett Dr. Robert Chun Dr. Mark.
The Ingredients of Android Applications. A simple application in a process In a classical programming environment, the OS would load the program code.
Running a Forms Developer Application
Constructors, GUI’s(Using Swing) and ActionListner
Event loops.
Presentation transcript:

Capture and Replay Often used for regression test development –Tool used to capture interactions with the system under test. –Inputs must be captured; outputs may also be recorded and (possibly) checked. –Examples: –Telelogic Tau: save command history in simulator –GUI testing tools Capture requires a working system to be available already!

Testing on Replay During the replay of events, there are various output checking possibilities: –Manual: user has to watch the system for anomalies –Complete: all outputs were recorded during capture, and system must reproduce them “exactly”. –“Exactly”: to the level of detail of the recording. –Checkpoints: system output is only checked at certain points for specified values. –These could be inserted manually or automatically.

The capture record Inputs, outputs, and other information needed to reproduce a session with the system under test need to be recorded during the capture process. Examples: –General information: date/time of recording, etc. –System start-up information –Events from test tool to system –Point of control, event –Events from system to test tool –Checkpoints / expected outputs –Time stamps

Event-driven architecture Basis of GUI frameworks –Various controls create events when they are created, activated, modified, deactivated, or disposed. Input devices create events as per their functions: key pressed, key released, mouse moved, … Events are sent to an event dispatcher “Listeners” register with the event dispatcher to receive events –Listeners specify the type of events in which they are interested, and which method should be called when the event occurs When an event is received by the event dispatcher, notifications are sent to each registered listener for the type of event. –Each listener has their event notification method called in turn.

Event-driven architecture Event source 1 Event source 2 Event dispatcher Event listener 1 Event listener 2 event instances notifications registration

Integrating a Capture and Replay tool During the capture process, the tool will register as an event listener –Event notification method for the tool will record the details of all events that occurred. During the replay process, the tool will register as an event source (possibly also as a listener) –For mouse and keyboard events, the tool has to substitute for the actual devices as the event source. –Replay events should be initiated at the same relative time as during the capture. –Other controls issue events as usual (e.g. GUI button deactivated)

Capture Event source 1 Event source 2 Event dispatcher Event listener 1 Event listener 2 Capture and record

Replay Event source 1 Event dispatcher Event listener 1 Event listener 2 Replay tool input [mouse + keyboard replaced]

Integration Alternatives Create native system events –Example: The Robot class in Java will, for example, actually move the mouse cursor on the underlying platform, instead of just recreating the mouse event that would be generated. Analyze screen images –A screen capture of a tool’s GUI can be stored while the tool is running, analyzed for widgets, and then used for replay.

Tests Alternatives: –During the capture process, the tool may record events, and then compare the results during playback. –At test checkpoints, the tool can ask various controls for their state and record it. –Examples: –Contents of text fields –GUI radio button properties: –enabled / disabled –selected / not selected

Integration options Compile tool classes and application together –Similar to JUnit approach –User has to determine object instances that should be monitored, and then register instances of tool classes as event source and listeners –Connections are also set up to query controls as to their states. –Provides better integration, more stable replays –Tester has to learn how to use tool classes Use virtual machine registration (when there is a VM) –Tool has to “discover” objects of interest

Example: Jacareto Java-based open source GUI capture + replay tool –Authors: C. Spannagel et. al. –Web site: Tool sub-parts: –Jacareto: event record and playback –Picorder: command line interface –CleverPHL: graphical user interface (for Jacareto)

Jacareto Uses virtual machine registration Batch file and XML script used to start Java virtual machine, start the test tool, and load the application’s classes. –Main method of application called by test tool as required. Jacareto has to discover all instances of subclasses of Component (including JComponent for Swing)

Event records Stored as XML Information recorded: –Type of event: mouse move, key pressed, etc. –Includes event-specific information: X-Y location of mouse cursor, which key was pressed, … –Relative time from previous event –Needed to keep events synchronized –Example:

XML record displayed for user

Tests At various user-defined checkpoints, the state of a control can be tested. Example: Test if a text field contains the specified text –Also specify that we want to stop if there is an error (i.e. ignore error is false), and that we do not want to correct the state of the control if it does not conform to the record. Hello, Alan

UI for Test creation

Test reports

Example: Marathon Capture and playback tool for testing Java/Swing graphical user interfaces. – Uses the “Jython” (Python for Java) scripting language to store test cases. Test cases can be captured interactively, or written as Jython scripts. Assertions can be added to check the state of various components. Uses test runner that is a non-standard version of JUnit.

Sample Jython test script useFixture(default) def test(): java_recorded_version = '1.5.0_11' if window('GUI demo'): click('Click me') assert_p('TextField', 'Text', 'Hello, Alan') close()

Running a Marathon test

Test report

Eclipse TPTP Auto GUI recorder Capture and replay of GUI events and actions within the Eclipse IDE. Test suite is set up as an Eclipse plug-in project that integrates itself with the IDE. Any application that is also an Eclipse plug-in can be tested with the auto GUI recorder. –The plug-in mechanism exposes how Eclipse can interact with the plug-in, and the auto GUI recorder uses this information to send and receive events to/from the plug-in.

Pros and cons Advantages: –Requiring the test application to be an Eclipse plug-in allows for better knowledge of the environment for the record / replay tool. –Less difficulty and more reliability for locating user interface widgets. –Tool can call methods directly, instead of simulating mouse operations and keystrokes. Disadvantages: –Cannot be used for stand-alone applications –Requires the use of Eclipse’s Standard Widget Toolkit (SWT), instead of Java’s Abstract Widget Toolkit (AWT) or the Swing toolkit.

Additional features Verification hooks –Points at which tests can be inserted to check the state of various widgets. Variable substitution –Allows script to substitute variable values for variable names during run-time. –Example: specification of temporary directory, relative file names

TPTP Auto GUI recorder

Action script <shell descriptive="Test - AutomatedGUISuite - Eclipse SDK" referenceId="0" return-code="-1"> <command descriptive="Java Project“ type="item-select" referenceId="3"> <command descriptive="Next &gt;" type="select" referenceId="5"/> <command descriptive="Next &gt;" type="select" referenceId="5"/>

TPTP Auto GUI recorder – test setup

TPTP Auto GUI recorder – execution log

TPTP Auto GUI recorder – execution log details

TPTP API recorder Another tool being developed for Eclipse is an API recorder. Essentially, this performs capture and replay without having a user interface. –Uses the TPTP profiler. –As methods are called, the parameter values are stored on entry, and the values that are returned are stored as well. –After execution, the saved parameter values are used to create JUnit test cases. Still in the “technology preview” phase.