Upload
maveryx
View
1.000
Download
3
Embed Size (px)
DESCRIPTION
This is a brief tutorial, with a practical use-case, on how to use Maveryx testing tool for automating Java(TM) applications. It is a step-by-step guide both for novice and expert testers.
Citation preview
© 2014 Maveryx srl.
All rights reserved.
Testing Java Applications with Maveryx
� Overview of Maveryx
� Why Maveryx is different
� Testing a Java Application Step-by-Step
Overview
© 2014 Maveryx srl.
All rights reserved.
Overview of Maveryx
Maveryx is a professional, award-winning test automation tool for
functional and regression testing of Java™ & Android™ applications.
Maveryx provides testers with automated testing capabilities for
functional, regression, GUI, data-driven and keyword-driven testing.
Maveryx
� No GUI Maps ⇒ Runtime GUI
Inspection tool
� Intelligent UI Objects Recognition
� Code-free Keyword-driven Testing
� Data-driven testing
� Assertion-based Verification
Points
� Extension plugin mechanism
� Suitable for Java™ and Android™
� Standard Test Logging
� Automated Testing in Java™
� Test Data Generation Tool
� Advanced Test API
� Available as Eclipse plugin
� For Windows, Linux & Mac
� …
Features
© 2014 Maveryx srl.
All rights reserved.
© 2014 Maveryx srl.
All rights reserved.
Why Maveryx is different?
No UI Maps. No Recording.
No recording. No capture. No UI Maps.
o NO UI MAPS or Object Repositories to ‘learn’ & maintain
o No pre-recording or UI capture
o Test scripts immediately executable!
o Automatic UI inspection directly at runtime
o Support for all standard and advanced Java™ GUI controls
o “Classical” to Fuzzy matching algorithms to unambiguously recognize and locate UI objects directly at runtime during test execution
o Automatically accommodate UI changes without modifying the tests
o “Geolocation” of objects in the User Interface (TOP, BOTTOM, LEFT, RIGHT …)
Unique object identification
© 2014 Maveryx srl.
All rights reserved.
o Code-free Keyword-driven Testing
o Keyword testing driven from Excel™ sheets and XML files
o No coding required ⇒ short time to implement
o Data-driven testing
o Dedicated scripting API for data-driven testing
o Varying set of data sources : Excel™ sheets , CSV & XML files
Testing Methodology
© 2014 Maveryx srl.
All rights reserved.
o Standard Test Logging and Reporting
o XML ⇒ HTML test reports
o ASCII test logs
o Automated capturing of screenshots on test failures
o Test Execution Metrics
Test Logging
© 2014 Maveryx srl.
All rights reserved.
© 2014 Maveryx srl.
All rights reserved.
Testing a Java ApplicationStep-by-step
The Eclipse PluginMaveryx
Perspective JUnit integration Action buttons Report / Metrics View
The Application-under-test
Enter Password
Invalid PasswordValid Password
Create a New Test Project
1. Select File→ New→Maveryx Test Project
In the Maveryx Test Project window
1. enter the Project name (e.g.
“PasswordDemoTest”)
2. in the JRE section make sure that Java/JRE
6 or higher is selected
Create a New Test Script
1. Select File→ New→Maveryx Test Class
In the Maveryx Test Class window
1. enter a name for the Package (e.g.
“com.maveryx.demo”)
2. enter a Name for the test class / script
(e.g. “PasswordDemoTest”)
Create the Launch file
To execute the application-under-test it is necessary to
create the related launch file.
The AUT Configurator tool is a GUI-based application
which enables testers to create, save and modify launch
files (⇒ XML files).
To start the Application Configuration tool on Windows:
1. select Start→ All Programs →Maveryx→ AUT
Configurator
The Test Script «Stub»
Set the full path (pathName) to the launch file.
e.g. private final String pathName =
"C:/Maveryx/demo/AUT/PasswordDemo.xml";
The static method startApplication(pathName)
in class Bootstrap launches the application-
under-test.
The static method stop(pathName) in class
Bootstrap closes the application-under-test.
The Test Cases
Test Case #001
1. Launch the application-under-
test
2. Check that the password text
field is editable
3. Enter a valid password
4. Check that the "OK" button is
enabled
5. Press the "OK" button to
confirm the password
6. Check that a successful
authentication message is
returned
7. Close the application-under-
test
Test Case #002
1. Launch the application-under-
test
2. Check that the password text
field is editable
3. Enter a invalid password
4. Check that the "OK" button is
enabled
5. Press the "OK" button to
confirm the password
6. Check that an authentication
error message is returned
7. Close the application-under-
test
Launch the application
Test Case #001
1. Launch the application-under-test
2. Check that the password text field
is editable
3. Enter a valid password
4. Check that the "OK" button is
enabled
5. Press the "OK" button to confirm
the password
6. Check that a successful
authentication message is
returned
7. Close the application-under-test
Launch the application
The static method startApplication(pathName)
in class Bootstrap launches the application-
under-test
Working with text fields
Test Case #001
1. Launch the application-under-test
2. Check that the password text
field is editable
3. Enter a valid password
4. Check that the "OK" button is
enabled
5. Press the "OK" button to confirm
the password
6. Check that a successful
authentication message is
returned
7. Close the application-under-test
Working with text fields
1. Create a new GuiPasswordText object
specifying the label
2. Verification Point : check that the
password text field is editable
3. Enter the password
Working with buttons
Test Case #001
1. Launch the application-under-test
2. Check that the password text field
is editable
3. Enter a valid password
4. Check that the "OK" button is
enabled
5. Press the "OK" button to confirm
the password
6. Check that a successful
authentication message is
returned
7. Close the application-under-test
Working with buttons
1. Create a new GuiButton object
specifying the caption
2. Verification Point : check that the
button is enabled
3. Click the button
Working with dialogs
Test Case #001
1. Launch the application-under-test
2. Check that the password text field
is editable
3. Enter a valid password
4. Check that the "OK" button is
enabled
5. Press the "OK" button to confirm
the password
6. Check that a successful
authentication message is
returned
7. Close the application-under-test
Working with dialogs
1. Create a new GuiDialog object specifying the title
2. Create a new GuiLabel object specifying the text
and the container
3. Verification Point : check that the label has the
expected text
4. Close the dialog
Working with frames
Test Case #001
1. Launch the application-under-test
2. Check that the password text field
is editable
3. Enter a valid password
4. Check that the "OK" button is
enabled
5. Press the "OK" button to confirm
the password
6. Check that a successful
authentication message is
returned
7. Close the application-under-test
Working with frames
1. Create a new GuiFrame object specifying the
title
2. Close the frame
3. Close the Java Virtual Machine
Test Case #001
Test Case #002
Run the Test Script
1. Select File→ Run As→ JUnit Test
View the Test Results
1. Test Results
2. Test Metrics
3. Test Console
Log
The Test Report
Lesson Learned
o NO UI MAPS needed to create and run the tests.
o No pre-recording or UI capture required.
o Test scripts can be created in parallel with software development.
o Test scripts immediately executable as soon as application is
available.
Useful Links
o Maveryx – http://www.maveryx.com
o User guide – http://www.maveryx.com/en/support/learn-
more/user-documentation.html
o Forum – http://www.maveryx.com/en/forum/index.html
o Training – http://www.maveryx.com/en/services/training.html