Top Banner
Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH
35

Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

May 31, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Automatisierung von Multi-Platform undDevice GUI Tests

Reginald Stadlbauerfroglogic GmbH

Page 2: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

About me

Name: Reginald Stadlbauer Company: froglogic GmbH Position: co-founder and CEO Worked as Software Engineer at Trolltech and the KDE project

Page 3: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

About froglogic

HQ: Hamburg Founded: 2003 US presence since 2008 Product focus on Squish- Squish GUI Tester (Cross-Platform/Cross-Technology GUI Test Automation)- Squish Coco (C, C++ and C# Code Coverage)

More than 3.000 customers world-wide

Page 4: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

The Requirement: One Application – Many Front-Ends

Page 5: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

The Requirement: One Test for All

One set of Tests

Page 6: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

What is functional GUI testing

Outside-In Assume user's point of view

Page 7: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Why Automate?

Faster- Get results quicker- Run more tests in the same time

Trivial to replay in different configurations Reliable, reproducible and repeatable Relieve testers from monotonous tasks Quickly spot regressions Combine with profiling, coverage and other analysis and monitoring tools ...

But...- Automating GUI tests is not trivial- Typical reason for test effort failures: wrong test approach

Page 8: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Platform Challenge

Application needs to run on a range of platforms:

Desktop Mobile Web Embedded

Page 9: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Toolkit Challenge

Different UI frameworks used for different platforms:

Desktop: JavaFx, RCP/SWT, Swing, Qt, QML, WinForms, WPF, MFC, Cocoa, ... Mobile: iOS, Android, PhoneGap, Xamarin, ... Web: Wide range of JS / HTML5 frameworks Embedded: Qt, QML, ...

And even combinations of the above.

Page 10: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Platform Solution for Testing

Provided Abstractions by Test Tool

Resolution independence via dedicated UI control support UI abstractions Synchronization methods Distributed environment

Page 11: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Capture and replay

Produces massive test scripts Not readable Not maintainable No code re-use possible Brittle against changes in the UI

Solution: Scripting, Refactoring and Abstractions

Page 12: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Proposed Solution

Abstraction layer to separate test logic and implementation Implementation: Specialized UI test driver per Front-End- Scriptable- Supports used UI controls- Supports remote testing

Allow switching between test implementations

==> Behavior Driven Development & Testing (BDD)

Page 13: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Overview

What is BDD and TDD? Automating a Behavior-Driven Test Live Demo

Page 14: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

What is BDD / 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-definedoutputs, resulting in the delivery of working, tested software that matters.” - Dan North

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

OR...

Page 15: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

What is BDD / BDT?

Test Driven Development (TDD)- Write (failing) test- Implement feature until test passes- Unit-Test level granularity (inside-out)

BDD:- Focus on application's behavior and specification- Description in a human-readable DSL (e.g. Gherkin)- Less focus on implementation details

Business goals Features

Executablespecifications

Low-levelspecifications

ExamplesExamples

Page 16: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Feature Partitioning

Product

Feature A Feature B

Feature C

Feature D Feature E

Page 17: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Components

Features ≠ Components

Feature A Feature B

Feature C

Feature D Feature E

Unit 1

Unit 2

Unit n

Page 18: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Scenarios

Feature A Feature B

Feature C

Feature D Feature E

Scenario D-1Scenario A-1 Scenario E-1

Scenario D-2

Page 19: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Versatile usage of Feature Files

User story / feature specification Communicate with customer / users Documentation of acceptance test Sequence to walk through for manual tests Storyboard for automation of tests

Feature: Aaaaa bbb Scenario: Bbbb ccc Given foo bar zzz And zilch zorro When I do something Then something should

Feature: Aaaaa bbb Scenario: Bbbb ccc Given foo bar zzz And zilch zorro When I do something Then something should

Feature: Aaaaa bbb Scenario: Bbbb ccc Given foo bar zzz And zilch zorro When I do something Then something should

Developer

Tester

Documentation

Customer,Business Owner

Analyst Developer,Tester

Page 20: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Why BDD/BDT?

“Test first” development on a higher level Clearly separate test logic from implementation Allow non-programmers to define features & tests Have a common, single language two communicate

Page 21: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Example: Multi-Platform Addressbook

Page 22: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Example: Fill an empty addressbook

Feature: Filling Empty Addressbook

Scenario: Adding a single person Given the addressbook application is running When I create a new addressbook And I add a new person … to the address book Then 1 entries should be displayed in the address book

Feature File(Gherkin)

Page 23: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Step Types

Scenario: Adding a single person Given the addressbook application is running When I create a new addressbook And I add a new person … to the address book Then 1 entries should be displayed in the address book

Precondition

Actions

Expectations

Page 24: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

What is BDD / BDT – The Process

Write a failingFeature Test

MakeFeature Test

pass

Implement/Refactor

Code

Test

Manually Automated

Page 25: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Automating a Behavior-Driven Test

Requirements- BDT framework- GUI Test Automation framework- Glue between both

Page 26: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

BDT Framework – Generate Skeletons

Parse feature files Generate step definition skeletons (functions and annotations) in preferred language

Test.feature

Feature: Fill Addressbook

Scenario: Add a person

Given the Addressbook is running

When I add a person

....

Test.py

@Step("Given the Addressbook is running")

def step(context):

test.warning("Implement me”)

@Step("When I add a person”)

def step(context):

test.warning("Implement me”)

Page 27: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Test Automation framework – Test Implementation

Support the specific (UI) technology of Application Support the scripting/programming language of the BDT framework Tooling for convenient test creation, maintenance and debugging

Test.py

@Step("Given the Addressbook is running")

def step(context):

startApplication("Addressbook”)

@Step("When I add a person")

def step(context):

click("FirstName”)

typeText("Max”)

Page 28: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

BDT Framework + TA Framework – Run Feature Files & Reports

Parse feature files Execute feature files by mapping to steps to step definitions (functions) Reporting

Test.feature

Feature: Fill Addressbook

Scenario: Add a person

Given the Addressbook is running

When I add a person

....

Test.py

@Step("Given the Addressbook is running")

def step(context):

[...]

@Step("When I add a person")

def step(context):

[...]

Page 29: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Integrating BDT and Test Automation frameworks

Need to “talk the same language” Reporting Debugging

Page 30: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

BDT Frameworks

Behave

Cucumber

JBehave

Lettuce

radish

RSpec

SpecFlow

Squish GUI Tester

...

Page 31: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Test Automation tools

CppUnit

GoogleTest

xUnit

NUnit

JUnit

Squish GUI Tester

HP QTP

Rational Functional Tester

Selenium

...

Page 32: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Live Demo

BDD GUI test for cross-platform/device Addressbook- Create test for one frontend- Re-implement for other frontends- Extend framework to allow switching between implementations to run the same test on different frontents

Page 33: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Books

BDD in Action: Behavior-driven development for the whole software lifecycle (JohnFerguson Smart)

The Cucumber Book: Behaviour-Driven Development for Testers and Developers(Matt Wynne)

Page 34: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

About Squish GUI Tester

Cross-Platform / Cross-GUI-Technology Test Automation- Windows, Linux, Mac OS X, Unix, QNX, VxWorks, iOS, Android, ...- Java (Swing/AWT, SWT/RCP, JavaFx), Qt/QML/QtQuick, Web, MFC, WinForms, WPF, iOS,

Cocoa, Carbon, Android, Tk, Flex, …

Object-based GUI object identification Record & replay Powerful scripting (JavaScript, Python, Ruby, Tcl, Perl) Eclipse-based IDE Built-in BDD framework and support

Batch-testing via command-line tools Remote/distributed testing architecture Integrations: Microsoft ALM, HP QC/ALM, Rational RQM, Seapine TCM, SpiraTest, MKS,

XStudio, Jenkins, Hudson, TeamCity, Bamboo, Robot Framework, JUnit, Maven, …

Page 35: Automatisierung von Multi-Platform und Device GUI Tests · 2017-10-05 · Automatisierung von Multi-Platform und Device GUI Tests Reginald Stadlbauer froglogic GmbH. About me ...

Q & A

Questions? Visit our booth or email [email protected]

Free and supported trial of Squish at http://www.froglogic.com/evaluate