36
© 2014 Maveryx srl. All rights reserved. Testing Java Applications with Maveryx

Testing Java applications with Maveryx

  • 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

Page 1: Testing Java applications with Maveryx

© 2014 Maveryx srl.

All rights reserved.

Testing Java Applications with Maveryx

Page 2: Testing Java applications with Maveryx

� Overview of Maveryx

� Why Maveryx is different

� Testing a Java Application Step-by-Step

Overview

Page 3: Testing Java applications with Maveryx

© 2014 Maveryx srl.

All rights reserved.

Overview of Maveryx

Page 4: Testing Java applications with 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

Page 5: Testing Java applications with 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.

Page 6: Testing Java applications with Maveryx

© 2014 Maveryx srl.

All rights reserved.

Why Maveryx is different?

Page 7: Testing Java applications with Maveryx

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

Page 8: Testing Java applications with Maveryx

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.

Page 9: Testing Java applications with Maveryx

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.

Page 10: Testing Java applications with Maveryx

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.

Page 11: Testing Java applications with Maveryx

© 2014 Maveryx srl.

All rights reserved.

Testing a Java ApplicationStep-by-step

Page 12: Testing Java applications with Maveryx

The Eclipse PluginMaveryx

Perspective JUnit integration Action buttons Report / Metrics View

Page 13: Testing Java applications with Maveryx

The Application-under-test

Enter Password

Invalid PasswordValid Password

Page 14: Testing Java applications with Maveryx

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

Page 15: Testing Java applications with Maveryx

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”)

Page 16: Testing Java applications with Maveryx

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

Page 17: Testing Java applications with Maveryx

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.

Page 18: Testing Java applications with Maveryx

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

Page 19: Testing Java applications with Maveryx

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

Page 20: Testing Java applications with Maveryx

Launch the application

The static method startApplication(pathName)

in class Bootstrap launches the application-

under-test

Page 21: Testing Java applications with Maveryx

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

Page 22: Testing Java applications with Maveryx

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

Page 23: Testing Java applications with Maveryx

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

Page 24: Testing Java applications with Maveryx

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

Page 25: Testing Java applications with Maveryx

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

Page 26: Testing Java applications with Maveryx

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

Page 27: Testing Java applications with Maveryx

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

Page 28: Testing Java applications with Maveryx

Working with frames

1. Create a new GuiFrame object specifying the

title

2. Close the frame

3. Close the Java Virtual Machine

Page 29: Testing Java applications with Maveryx

Test Case #001

Page 30: Testing Java applications with Maveryx

Test Case #002

Page 31: Testing Java applications with Maveryx

Run the Test Script

1. Select File→ Run As→ JUnit Test

Page 32: Testing Java applications with Maveryx

View the Test Results

1. Test Results

2. Test Metrics

3. Test Console

Log

Page 33: Testing Java applications with Maveryx

The Test Report

Page 34: Testing Java applications with Maveryx

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.

Page 35: Testing Java applications with Maveryx

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

Page 36: Testing Java applications with Maveryx

Thank You!

• www.maveryx.com

[email protected]

[email protected]