Behavior Driven GUI Test Automation · 2017-12-06 · - Python, Perl, JavaScript, Tcl & Ruby Full...

13
Behavior Driven GUI Test Automation for Java Desktop, Embedded & Mobile Applications

Transcript of Behavior Driven GUI Test Automation · 2017-12-06 · - Python, Perl, JavaScript, Tcl & Ruby Full...

Page 1: Behavior Driven GUI Test Automation · 2017-12-06 · - Python, Perl, JavaScript, Tcl & Ruby Full IDE support - Editor with code completion, recording of steps, etc. Produce clearer

Behavior Driven GUI Test Automationfor Java Desktop, Embedded & Mobile Applications

Page 2: Behavior Driven GUI Test Automation · 2017-12-06 · - Python, Perl, JavaScript, Tcl & Ruby Full IDE support - Editor with code completion, recording of steps, etc. Produce clearer

About meAmanda Burma

Background | Automated QA Test Engineering

Company | froglogic

Focus areas | Software quality tools & Cross-platform testing

Page 3: Behavior Driven GUI Test Automation · 2017-12-06 · - Python, Perl, JavaScript, Tcl & Ruby Full IDE support - Editor with code completion, recording of steps, etc. Produce clearer

Agenda

What is BDD? Why BDD and BDT? Automating a Behavior Driven GUI Test Integrating BDT and Test Automation

Page 4: Behavior Driven GUI Test Automation · 2017-12-06 · - Python, Perl, JavaScript, Tcl & Ruby Full IDE support - Editor with code completion, recording of steps, etc. Produce clearer

What is Behavior Driven Development (BDD)?What is Behavior Driven Testing (BDT)?

“BDD is a second-generation, outside-in, pull-based, multiple-stakeholder, multiple-scale, high-automation, agile methodology. It describes a cycle of interactions with well-defined outputs, resulting in the delivery of working, tested software that matters.” - Dan North

http://en.wikipedia.org/wiki/Behavior-driven_development

OR...

Page 5: Behavior Driven GUI Test Automation · 2017-12-06 · - Python, Perl, JavaScript, Tcl & Ruby Full IDE support - Editor with code completion, recording of steps, etc. Produce clearer

What is Behavior Driven Development (BDD)?What is Behavior Driven Testing (BDT)?

Test frst development on a higher level Clear separation of test logic and implementation Features & tests - defned in a common human readable language- implemented in a common human readable language

Page 6: Behavior Driven GUI Test Automation · 2017-12-06 · - Python, Perl, JavaScript, Tcl & Ruby Full IDE support - Editor with code completion, recording of steps, etc. Produce clearer

Why BDD & BDT?

Describe (Test) in a human-readable DSL

Focus on application behavior

Clear logic vs. implementation separation

Enable non-engineer test creation

Why BDD?Clear Feature Requirements & Results

Production

RefactorCode

MakeFeature Test

Pass

Write a FailingFeature Test

Implement

Release Bug

Repeat

Page 7: Behavior Driven GUI Test Automation · 2017-12-06 · - Python, Perl, JavaScript, Tcl & Ruby Full IDE support - Editor with code completion, recording of steps, etc. Produce clearer

MakeFeature Test

Pass

MakeFeature Test

Pass

Production

RefactorCode

Given » When » Then

Feature: Create new address books

Scenario: Create a new blank address book

Given the app is running

When user creates a new address book

Then the address book is blank

Writing a Feature File

Write a FailingFeature Test

Implement

Release Bug

Repeat

Page 8: Behavior Driven GUI Test Automation · 2017-12-06 · - Python, Perl, JavaScript, Tcl & Ruby Full IDE support - Editor with code completion, recording of steps, etc. Produce clearer

Write a FailingFeature Test

Production

RefactorCode

Test Step Implementation

Given("the app is running", function(context) {

startApplication("AddressBookSwing.jar");

});

When("user creates a new address book", function(context) {

activateItem(waitForObjectItem(":AddressBook_javax.swing.JMenuBar", "File"));

activateItem(waitForObjectItem(":File_javax.swing.JMenu", "New..."));

});

Then("the address book is blank", function(context) {

waitFor("object.exists(':AddressBook_javax.swing.JTable')", 20000);

test.compare(findObject(":AddressBook_javax.swing.JTable").rowcount, 1);

});

Generate using Guided-Recording (optional)

MakeFeature Test

Pass

Implement

Release Bug

Repeat

MakeFeature Test

Pass

Page 9: Behavior Driven GUI Test Automation · 2017-12-06 · - Python, Perl, JavaScript, Tcl & Ruby Full IDE support - Editor with code completion, recording of steps, etc. Produce clearer

Write a FailingFeature Test

MakeFeature Test

Pass

Production

Test Step Implementation

Given("the app is running", function(context) {

startApplication("AddressBookSwing.jar");

});

When("user creates a new address book", function(context) {

common.invokeMenuItem("File","New");

});

Then("the address book is blank", function(context) {

common.verifyRowCount(":AddressBook_javax.swing.Jtable", 1);

});

Refactoring

Implement

Release Bug

Repeat

RefactorCode

MakeFeature Test

Pass

Production

Page 10: Behavior Driven GUI Test Automation · 2017-12-06 · - Python, Perl, JavaScript, Tcl & Ruby Full IDE support - Editor with code completion, recording of steps, etc. Produce clearer

BDD GUI Test Automation Demo

Page 11: Behavior Driven GUI Test Automation · 2017-12-06 · - Python, Perl, JavaScript, Tcl & Ruby Full IDE support - Editor with code completion, recording of steps, etc. Produce clearer

Complete support for Feature Files written in Gherkin- 100% compatible with Cucumber, Behave, etc.

Test steps can be implemented in any of Squish's supported scripting languages- Python, Perl, JavaScript, Tcl & Ruby

Full IDE support- Editor with code completion, recording of steps, etc.

Produce clearer test results- Color-coded results directly in Features fle

Built-in Behavior Driven Development & Testing Support

BDD in Squish

Page 12: Behavior Driven GUI Test Automation · 2017-12-06 · - Python, Perl, JavaScript, Tcl & Ruby Full IDE support - Editor with code completion, recording of steps, etc. Produce clearer

Platforms

Object-based GUI Test Automation

Technologies

Why Squish?

Page 13: Behavior Driven GUI Test Automation · 2017-12-06 · - Python, Perl, JavaScript, Tcl & Ruby Full IDE support - Editor with code completion, recording of steps, etc. Produce clearer

Contact [email protected]

amandaburma