coded ui - test automation practices from the field

43
CODED UI test automation practices from the field

Upload: clemens-reijnen

Post on 20-Nov-2014

15.212 views

Category:

Technology


1 download

DESCRIPTION

CodedUI tests within Visual Studio makes it easy for developers together with tester to create, fully-automated, functional user interface tests. These tests alert the team in an, easy to execute, automated way about regressions. CodedUI tests are easy to create for different UI technologies. But, all kinds of test automation needs an investment. To get a good return on this test automation investment you need to create CodedUI tests in a robust manner which can sustain changes to your application over time. In this session you will see how maintainable CodedUI tests can be created and how the test infrastructure needs to be configured for efficient execution.

TRANSCRIPT

Page 1: Coded UI - Test automation Practices from the Field

CODED UItest automation practices from the field

Page 2: Coded UI - Test automation Practices from the Field

[email protected]

www.clemensreijnen.nl

@clemensreijnen

Clemens Reijnen

www.youtube.com/clemensreijnen

www.slideshare.net/clemensreijnen

Page 3: Coded UI - Test automation Practices from the Field

the field

complex user interfacesbig project structures

multiple environments

Page 4: Coded UI - Test automation Practices from the Field

complex user interfacechallenges:

many controlschanging controls

complex flowmultiple screenschanging screens

Page 5: Coded UI - Test automation Practices from the Field

practices:

edit the UIMapsearch and filter

reusable ’test’methods reusable test assertions

shared stepsloose coupling

low dependencies

complex user interface

Page 6: Coded UI - Test automation Practices from the Field

UIM

apmultiple UIMap’s

a map per- screen

- scenario- part- team- …

Page 7: Coded UI - Test automation Practices from the Field

UIM

apmultiple UIMap’spage object pattern

Page 8: Coded UI - Test automation Practices from the Field

sear

chfilter, search and the tree

Page 9: Coded UI - Test automation Practices from the Field

reus

eUIMap Helper Class

Page 10: Coded UI - Test automation Practices from the Field

reus

etest all controls

Page 11: Coded UI - Test automation Practices from the Field

shar

edreuse shared steps in Coded UI

Page 12: Coded UI - Test automation Practices from the Field

UIM

ap m

ix different test projects for

tune your manual testsfor automation or remove them

Page 13: Coded UI - Test automation Practices from the Field

cuite

Object Repository: Keeps UI Object definitions separate from automation code (no more UIMaps)

Page 14: Coded UI - Test automation Practices from the Field

take aways:

• reuse steps and assertions• create helper classes• well defined uimap structure• use codeui builder• start from scratch or tune your manual tests• make clear test method names• separate the test intent from the test steps • no related tests• all test must leave the application in the same

state

complex user interface

Page 15: Coded UI - Test automation Practices from the Field

big project structures challenges:

multiple teamschain of distributed projects

big teamsshort test timeframe

Page 16: Coded UI - Test automation Practices from the Field

practices:

team collaborationbranch strategy code and test

versioning test caseno double tests

big project structures

Page 17: Coded UI - Test automation Practices from the Field

colla

bora

te

work together__with work packages__on alm artifacts

Page 18: Coded UI - Test automation Practices from the Field

bran

ch test same heartbeat as development

Page 19: Coded UI - Test automation Practices from the Field

bran

chbuild

build

build

build

test

test

s

test

ste

sts

test

s

test

s

test

s

test

ste

sts

test

s

test

s

Page 20: Coded UI - Test automation Practices from the Field

bran

chVisual Studio test projectswith Coded UI test case

Page 21: Coded UI - Test automation Practices from the Field

bran

chUIMap per branch

UIMap’s don’t merge well

Page 22: Coded UI - Test automation Practices from the Field

bran

chspecific test automation branch

Page 23: Coded UI - Test automation Practices from the Field

bran

ch! well maintained regression set

Page 24: Coded UI - Test automation Practices from the Field

bran

chMTM test plans with or without associated automation

Page 25: Coded UI - Test automation Practices from the Field

bran

chMTM test plans with or without associated automation

test cases

test casestest cases

test cases

test cases

Page 26: Coded UI - Test automation Practices from the Field

proj

ects

`

Team Project

Team Project

Team Project

Team Project

Team Project

Team Project

Page 27: Coded UI - Test automation Practices from the Field

doub

le

Page 28: Coded UI - Test automation Practices from the Field

doub

le

Page 29: Coded UI - Test automation Practices from the Field

take a ways:

branch structure /multiple team projectsuse areas well

don’t make it too complex, some things can’t be done

test and developers have the same rhythm

big project structures

Page 30: Coded UI - Test automation Practices from the Field

multiple environments challenges:

test for different environmentsno virtualized environments

short test cyclesless time for execution

Page 31: Coded UI - Test automation Practices from the Field

practices:

execute with out SCVVMtest execution responsibility

execute from build on environments

multiple environments

Page 32: Coded UI - Test automation Practices from the Field

infr

a

Page 33: Coded UI - Test automation Practices from the Field

infr

a

Page 34: Coded UI - Test automation Practices from the Field

infr

aconfigure for load or environments

Page 35: Coded UI - Test automation Practices from the Field

exec

ute

Page 36: Coded UI - Test automation Practices from the Field

build

Page 37: Coded UI - Test automation Practices from the Field

take a ways:

multiple environments is possible without SCVVM

how are the environments usedwho executes the tests

multiple environments

Page 38: Coded UI - Test automation Practices from the Field

1 Clean up of the Action log maybe re-execute, for more smooth Fast Forward.

2 Basic Coded UI. Only use the default generation, add your own assertion.

3 Advanced Coded UI. Customize the Coded UI and UIMap for optimization.

No investment in any kind of automation. Just click and test.

0

Test Automation Investment Levels

Page 39: Coded UI - Test automation Practices from the Field

5 Execute them on multiple environments.

6 Execute them on virtualized environments.

7 …

Execute them on a single environment.4

Test Execution Investment Levels

Page 40: Coded UI - Test automation Practices from the Field

keep it simpleDRY

start automating from the beginningdeveloper and test engineer in same room

don’t automate everythingknow what already have been verified

run them alwaysfail fast fail oftenlearn as a team

tools will help youcode rules for better testability

test automation in the same sprintstart from scratch or tune your manual

testsmake clear testmethode names

separate the test intent from the test steps no related tests

all test must leave the application in the same state before the test started

………

final notes

Page 41: Coded UI - Test automation Practices from the Field

interesting read / watch

http://www.ie.sogeti.com/Product--Services/Software-Testing--QA-Services/Test-Automation/

http://www.thoughtworks.com/events/maintaining-automated-acceptance-tests

Page 42: Coded UI - Test automation Practices from the Field

soon available

Page 43: Coded UI - Test automation Practices from the Field

43