recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open...

75
recheck recheck und der Stein der Weisen und der Stein der Weisen Aus Selenium wird Adamantium Aus Selenium wird Adamantium Martin Vietz Martin Vietz https https:// :// retest.de/ retest.de/

Transcript of recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open...

Page 1: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

recheckrecheck und der Stein der Weisen und der Stein der Weisen

Aus Selenium wird AdamantiumAus Selenium wird Adamantium

Martin VietzMartin Vietz

httpshttps://://retest.de/retest.de/

Page 2: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Martin VietzMartin Vietz

Software Developer since 2005

Focus on software development infrastructure

CTO & CoFounder of ReTest GmbH

Page 3: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in
Page 4: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

reretesttest GmbH GmbH

founded 2017

~ 15 employee

Karlsruhe

Open Source & AI supporter

Page 5: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Some questionsSome questions

to the audience

Page 6: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Who is testing the GUI in general?

Page 7: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Who is testing the GUI automatically?

Page 8: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Who is testing more than a few (happy path) cases?

Page 9: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Who is happy with the current state?

Page 10: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Let's fix this!Let's fix this!

Page 11: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

DemoDemo

MySeleniumTest.java

Page 12: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

How does it work?How does it work?

Page 13: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Let's start at the basicsLet's start at the basics

Page 14: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

automated tests

=

tests

Page 15: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

automated tests

≠tests

Page 16: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

testentesten

... Ziel des Prozesses ist sicherzustellen, dass diese allen

festgelegten Anforderungen genügen, dass sie ihren Zweck

erfüllen, und etwaige Fehlerzustände zu finden.

Q: http://glossar.german-testing-board.info

Page 17: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

automated tests

≠tests

Page 18: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

In which case we find changes withIn which case we find changes with

tests?tests?

Page 19: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

In which case we find changes withIn which case we find changes with

tests?tests?

Only if something changes!Only if something changes!

Page 20: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

In other words we track changes!

Page 21: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

We have a name for it...

Page 22: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

automated testsautomated tests

==

version controlversion control

Page 23: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

The question that version control typically answers is:

Page 24: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

The question that version control typically answers is:

Where has the Where has the CodeCode changed? changed?

Page 25: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

⇒⇒

Page 26: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Where has the     Code      changed?

Page 27: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Where has the Software changed?

Page 28: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Closing the gap withClosing the gap with

automated tests

Page 29: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

automated testsautomated tests

==

version controlversion control

Page 30: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Example

class ElementRemover

Page 31: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

<?xml version="1.0" encoding="UTF-8" ?><root> <parent> <remove>should be removed</remove> <keep>should not be removed</keep> </parent></root>

<?xml version="1.0" encoding="UTF-8" ?><root> <parent> <keep>should not be removed</keep> </parent></root>

Page 32: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

@Testpublic void extended_xml_should_be_removed_correctly() { // Prepare state String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" // + "<root>\n" // + "\t<parent>\n" // + "\t\t<remove>should be removed</remove>\n" // + "\t\t<keep>should not be removed</keep>\n" // + "\t</parent>\n" // + "</root>"; ElementRemover remover = new ElementRemover( "parent", "remove" ); // Execute feature under test InputStream transformed = remover.transform( new ByteArrayInputStream( xml.g // Assert result final String result = IOUtils.toString( transformed, "UTF-8" ); Assert.assertFalse( result.contains( "remove" ) ); Assert.assertTrue( result.contains( "keep" ) ); }

Page 33: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

<?xml version="1.0" encoding="UTF-8" ?><root> <parent> <remove>should be removed</remove> <keep>should not be removed</keep> </parent></root>

<?xml keep</keep> </parent> </root>

Page 34: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

=> pass

<?xml version="1.0" encoding="UTF-8" ?><root> <parent> <remove>should be removed</remove> <keep>should not be removed</keep> </parent></root>

<?xml keep</keep> </parent> </root>

Page 35: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

<?xml version="1.0" encoding="UTF-8" ?><root> <parent> <remove>should be removed</remove> <keep>should not be removed</keep> </parent></root>

<?xml version="1.0" encoding="UTF-8" ?><root> <parent> <keep>should not be removed</keep> </parent></root>

Page 36: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Golden MasterGolden Master

Page 37: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Golden Master TestingGolden Master Testing

Page 38: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Golden Master Unit TestingGolden Master Unit Testing

Page 39: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Golden Master Unit TestingGolden Master Unit Testing

Page 40: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

@Testpublic void extended_xml_should_be_removed_correctly_Using_Approvals() { // Prepare state final String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" // + "<root>\n" // + "\t<parent>\n" // + "\t\t<remove>should be removed</remove>\n" // + "\t\t<keep>should not be removed</keep>\n" // + "\t</parent>\n" // + "</root>"; ElementRemover remover = new ElementRemover( "parent", "remove" ); // Execute feature under test InputStream transformed = remover.transform( new ByteArrayInputStream( xml.g // Assert result ApprovalsUtil.verifyXml( IOUtils.toString( transformed, "UTF-8" ) ); }

Page 41: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

<?xml version="1.0" encoding="UTF-8" ?><root> <parent> <remove>should be removed</remove> <keep>should not be removed</keep> </parent></root>

<?xml version="1.0" encoding="UTF-8" ?><root> <parent> <keep>should not be removed</keep> </parent></root>

Page 42: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

complete check?!complete check?!

Page 43: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Ideal amount of checks?

Page 44: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Ideal amount of checks

Page 45: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Ideal amount of checks

Page 46: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

DemoDemo

GoogleTest.java

Page 47: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

# Ignore file for recheck. # Ignore elements by attribute: matcher: id=banner # Ignore attributes globally: attribute=class # Ignore attributes with regex: attribute-regex=.* # combined: matcher: id=div-b4f23, attribute-regex: font.* ...

Page 48: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

DemoDemo

recheck.ignore

Page 49: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

ignore ≈ filter

Page 50: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

DemoDemo

BudgetTest.java

Page 51: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

But why Adamantium Version?But why Adamantium Version?

Page 52: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":".btn\-pri

Page 53: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Back to login demoBack to login demo

Page 54: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

How it works?How it works?

Page 55: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Lookup in golden masterLookup in golden master

Page 56: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in
Page 57: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

MultilocatorsMultilocators

Page 58: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

1 on 1 assignments1 on 1 assignments

Page 59: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

DemoDemo

MyUnbreakableSeleniumTest.java

Page 60: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

What happens when the goldenWhat happens when the golden

master is updated?master is updated?

Page 61: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

What happens when the goldenWhat happens when the golden

master is updated?master is updated?

It is not possible to find the old id anymore!

Page 62: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Stable IdsStable Ids

Page 63: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

retestIdretestId

reference to identity

Page 64: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Auto healingAuto healing

Page 65: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

DemoDemo

MyUnbreakableSeleniumTest.java

Page 66: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

recaprecap

Page 67: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

recheck benefitsrecheck benefits

whitelist testing

Page 68: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

recheck benefitsrecheck benefits

whitelist testing

rule-based deterministic ignoring

Page 69: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

recheck benefitsrecheck benefits

whitelist testing

rule-based deterministic ignoring

unbreakable selenium / test healing

Page 70: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

recheck benefitsrecheck benefits

whitelist testing

rule-based deterministic ignoring

unbreakable selenium / test healing

usable open source version

Page 71: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

recheck benefitsrecheck benefits

whitelist testing

rule-based deterministic ignoring

unbreakable selenium / test healing

usable open source version

offline usage possible

Page 72: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

recheck benefitsrecheck benefits

whitelist testing

rule-based deterministic ignoring

unbreakable selenium / test healing

usable open source version

offline usage possible

works conceptional for any technical interface

Page 73: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Thank you for your attention!Thank you for your attention!

Page 74: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

Questions?Questions?

Page 75: recheck und der Stein der Weisen - entwicklertag.de · founded 2017 ~ 15 employee Karlsruhe Open Source & AI suppor ter. Some que stions to the audience. Who is testing the GUI in

More Infos: More Infos:

We love Feedback:

https://retest.de/https://retest.de/

http://feedback.retest.de/