A GUI MAP - Docenti.unina

Download Report

Transcript A GUI MAP - Docenti.unina

Towards an Open and
Dynamic Test Automation
Mauro Garofalo
Overview
Challenges in GUI Test Automation
Maveryx: beyond GUI Maps
A look at the future
Demo
PART 1
Challenges in GUI Test
Automation
GUI Testing
• GUIs make software easy to use, understand and learn
• GUIs can constitute as much as 60% of an application’s
total code
• Difficult to develop and to test!
GUI Maps
•
A GUI MAP describes the test objects in
the application-under-test
•
It is used by the test automation tool to
recognize the GUI objects to test
•
Each script is associated with a test
object map
GUI Maps
Known limitations:
• Static
• A priori
• Need to be updated in case of GUI changes
(…and GUIs change very often!)
• Unable to develop the automated tests before
the availability of the application-under-test
test automation will always start later in
the software lifecycle
Maveryx
Maveryx is an automated testing framework powered by an
innovative engine that eliminates dependency on GUI Maps
providing a dynamic test objects handling
Maveryx
Maveryx at runtime during test execution:
• takes “snapshots” of the current user interface
• …and turn them into a XML documents
• searches within snapshots for the GUI objects to test
• executes the test actions on the test objects
Viewer
• Gets the GUI objects hierarchy by the JVM where the
application-under-test is running
• Builds a snapshot using an XML syntax and semantics
Java Accessibility API
Application Under
Test
snapshots
Viewer
Repository
Java Virtual Machine
Finder
Design and develop a test objects Finder that:
• can effectively retrieve the test objects which are relevant
• while retrieving as few non-relevant objects
• without compromising in speed or performance
• by supporting partial or incomplete matching
Finder – Supported Algorithms
Exact Match
Allows searching for test object exactly as it is entered
Query: “PasswordDemo”
Case Insensitive Match
Allows finding an exact match, but the match is not casesensitive
Query: “passworddemo”
Partial Match
Allows finding a match on partial data
Query: “Demo”
Wildcard
Allows finding a match by using regular expressions
Query: “P?w?dDemo”, “*Demo”
Levenshtein Distance
Allows matching approximate strings with fuzzy logic,
using the Levenshtein distance
Query: “PWDDemo”
Thesaurus Searching
Search for broader or narrower or related terms or
concepts in a vocabulary
Query: “O.K.”
Google Translation
Allows finding an exact match translation
Query: “Aiuto” (Help)
String matching
Because a GUI state is an XML document, searching for a test
object is a “string matching” problem
GuiObject b = new GUIObject (“OK", PUSH_BUTTON, “PasswordDemo", FRAME);
b.click();
The search engine returns a List of possible items matching the given criteria
The system selects the candidate with the best fit as the test object to execute
Finding GUI Objects at runtime
Output
Viewer
Application
Under Testing
Finder
Snapshot
Maveryx
The advantage of this technology
• cutting effort and costs in managing GUI Maps
• starting automation early in the software lifecycle
approximate matching allows to design and
implement the automated tests just after the
specification phase
• avoiding continuous reworking in case of changes in
the user interface
PART 3
A Look at the Future
PART 4
Demo
Any Question ?
Istruzioni per l’installazione
https://sourceforge.net/projects/maveryx/files/1.3.0/
Prerequisiti:
•
Installare la JVM http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
•
installare eclipse
Per Windows:
•
Eseguire Maveryx Maveryx_1_3_0_Setup.exe
Durante l'installazione selezionare la cartella in cui è installato eclipse (ovvero quella con la cartella plugin)
Per Linux e Mac
•
Scompattare Maveryx Maveryx_1_3_0.zip
•
Copiare i 3 file jar https://sourceforge.net/projects/maveryx/files/1.3.0/eclipse_plugin/ nella cartella plugin di eclipse
Per eseguire i demo
1.
2.
3.
Alla prima esecuzione di eclipse
1.
andare in Window->Preferences
2.
andare su Maveryx
3.
cliccando il tasto [Browse...] inserire la cartella di installazione di Maveryx
Cambiare la perspective
1.
Window -> Perspective -> Open Perspective -> Other...
2.
Selezionare Maveryx
Ctrl+N
1.
Maveryx -> Maveryx Demo
Esempio file xml di configurazione
Per configurare un caso di test va sempre modificato il file xml che configura l'applicazione .
Questo file è referenziato all’inizio del caso di test generato automaticamente:
private static final String pathName = "D:\\Maveryx\\demo\\AUTconfiguration.xml";
<?xml version="1.0" encoding="UTF-8"?>
<AUT_DATA>
<SERVER_URL></SERVER_URL>
<WORKING_DIR>./src/resources/AUT</WORKING_DIR> <!-- change this path to your working directory -->
<APPLICATION_NAME>ButtonDemo</APPLICATION_NAME>
<AUT_ARGUMENTS></AUT_ARGUMENTS>
<VM_ARGUMENTS></VM_ARGUMENTS>
<DESCRIPTION>
Push-Button testing
</DESCRIPTION>
<JRE_PATH>C:\Program Files (x86)\Java\jre1.8.0_111</JRE_PATH> <!-- change this path to your JRE home -->
<MAIN_CLASS>com.sun.demo.ButtonDemo</MAIN_CLASS>
<!-- on UNIX-like and MAC OS X systems change the path separator ';' to ':' -->
<CLASSPATH>
<LIB>
<PATH>examples.jar</PATH> <!-- change this path to your Maveryx installation directory /demo -->
</LIB>
<!-- do not change the data below! (except for path separator on UNIX-like and MAC OS X systems) -->
</CLASSPATH>
</AUT_DATA>
That’s all folks!
Thank you.
[email protected]