Canoo Inc. · OTC:GOEVQ

Canoo — Canoo Engineering — Technical Presentation (April 2007)

31 slides from Canoo's technical presentation, Apr 26, 2007

  1. Slide 1: Automatisiertes Testen von Web-Applikationen

    Slide 1: Automatisiertes Testen von Web-Applikationen

    Automatisiertes Testen von Web-Applikationen mit dem Open Source Tool WebTest Marc Guillemot Dierk König Independent Consultant Canoo Engineering AG Germany Switzerland mg@internetzky.de dierk.koenig@canoo.com WebTest & HtmlUnit lead developer WebTest founder

  2. Slide 2: What is WebTest?

    Slide 2: What is WebTest?

    What is WebTest? • automated Web functional testing tool • open source (Apache license) • founded in 2001 • currently 4 active committers (Switzerland, Germany, Australia) • used in banks, assurance, institutions, solution providers, ... • adapted to a wide range of projects: from small to huge Marc

  3. Slide 3: Testing Google

    Slide 3: Testing Google

    Testing Google Marc Guillemot & Dierk König JAX 07, 26.04.2007

  4. Slide 4: WebTest Starter

    Slide 4: WebTest Starter

    WebTest Starter google.xml <project name="example" default="test"> <target name="test"> <webtest name="check that WebTest is Google's top 'WebTest' result"> <steps> <invoke url="http://www.google.com"/> <verifyTitle text="Google"/> <setInputField name="q" value="WebTest"/> <clickButton label="I'm Fe

  5. Slide 5: WebTest Vorspeise

    Slide 5: WebTest Vorspeise

    WebTest Vorspeise Marc Guillemot & Dierk König JAX 07, 26.04.2007

  6. Slide 6: WebTest results (zoomed)

    Slide 6: WebTest results (zoomed)

    WebTest results (zoomed) Marc Guillemot & Dierk König JAX 07, 26.04.2007

  7. Slide 7: Marc Guillemot & Dierk König JAX 07, 26.04.2007

    Slide 7: Marc Guillemot & Dierk König JAX 07, 26.04.2007

    Marc Guillemot & Dierk König JAX 07, 26.04.2007

  8. Slide 8: Over 100 WebTest Steps

    Slide 8: Over 100 WebTest Steps

    Over 100 WebTest Steps • General: • PDF • <invoke .../> • <pdfDecryptDocument.../> • <clickLink.../> • <pdfVerifyField.../> • ... • <pdfVerifyText.../> • Forms • ... • <setInputField.../> • Excel Documents • <setRadioButton.../> • <setCheckBox.../> • <excelFindRow.../> • <clickButton.../> • <excelVe

  9. Slide 9: Building blocks

    Slide 9: Building blocks

    Building blocks WebTest HtmlUnit Mozilla Rhino Jaxen Ant nekoHtml Jakarta commons-httpclient Marc Guillemot & Dierk König JAX 07, 26.04.2007

  10. Slide 10: The 4 testing paradigms

    Slide 10: The 4 testing paradigms

    The 4 testing paradigms • Capture / replay • "the least cost-effective way of test automation" • Use capturing wisely • Model based testing • Specification: modelling expected behaviour • Fault model: modelling unexpected behaviour • Be tolerant to accidental behaviour • Data driven testing • Narrow

  11. Slide 11: A software engineering activity

    Slide 11: A software engineering activity

    A software engineering activity Marc Guillemot & Dierk König JAX 07, 26.04.2007

  12. Slide 12: Lessons learned

    Slide 12: Lessons learned

    Lessons learned • use recorder only to give you a jump start • specify expectations • distinguish guaranteed from accidental behaviour • apply rules of software engineering • remove duplications, extract modules • use source control • consider modifications and extensions • Ant, Java, Groovy • desig

  13. Slide 13: Determine what you want to test

    Slide 13: Determine what you want to test

    Determine what you want to test How to test addition into basket: • <clickLink label=”Einkaufskorb”/> ? • <clickLink label=”Ajax”/> ? • <clickLink xpath=”//*[text() = 'Top Angebot']//a”/> ? • <clickLink xpath=”//*[text() = '6.60']/following-sibling::a]”/> ? => it depends: these 4 examples don't test

  14. Slide 14: Sustainable Tests

    Slide 14: Sustainable Tests

    Sustainable Tests • exploit XPath wisely • good: //*[@id='total'] bad: /html/body/div[2]/table[3]/tbody/tr[6]/td[4] • testable HTML code • structured tests • property files • XML entities • Ant macros Marc Guillemot & Dierk König JAX 07, 26.04.2007

  15. Slide 15: Wisely use properties

    Slide 15: Wisely use properties

    Wisely use properties <project name="example" default="test"> de.properties <target name="test"> startUrl=http://www.google.de/de luckyButton=Auf gut Glück! <webtest name="check that WebTest is Google's top 'WebTest' result"> fr.properties <steps> startUrl=http://www.google.fr/fr <invoke url="${star

  16. Slide 16: Use entities for common blocks

    Slide 16: Use entities for common blocks

    Use entities for common blocks myTest.xml myDtd.dtd <!DOCTYPE project SYSTEM ”myDtd.dtd”> <!ENTITY goToLoginPage SYSTEM <project> "includes/goToLoginPage.xml"> .... <steps> &goToLoginPage; goToLoginPage.xml ... </steps> <group description=”go to login”> ... <invoke url=”http://mysite.com”/> <verifyT

  17. Slide 17: ... or macros

    Slide 17: ... or macros

    ... or macros ... <macrodef name="doLogin”/> <attribute name="login”/> <attribute name="password”/> <sequential> &goToLoginPage; <setInputField forLabel=”Login” value=”@{login}”/> <setInputField forLabel=”Password” value=”@{password}”/> <verifyText text=”Hello .*\. Welcome to the restricted area” re

  18. Slide 18: Fine control (1)

    Slide 18: Fine control (1)

    Fine control (1) ... <steps> <groovy description="configure HTTP 1.0 as default protocol version"> import org.apache.commons.httpclient.* import org.apache.commons.httpclient.params.* DefaultHttpParams.defaultParams.version = HttpVersion.HTTP_1_0 </groovy> <invoke url="http://myHost"/> ..... </steps

  19. Slide 19: Fine control (2)

    Slide 19: Fine control (2)

    Fine control (2) ... <steps> ..... <groovy description="test table sorted by last name"> import com.canoo.webtest.engine.StepFailedException as SFE def table = step.context.currentResponse.getHtmlElementById('theTable') def tds = table.getByXPath('tbody/tr/td[2]') def texts = tds*.asText() def sorte

  20. Slide 20: Simply extend WebTest

    Slide 20: Simply extend WebTest

    Simply extend WebTest <groovyScript> class MyExtension extends com.canoo.webtest.steps.Steps { String myProp void doExecute() { // do something } } project.taskDefinitions['myNewStep'] = MyExtension </groovyScript> .... <steps> ... <myNewStep myProp="whatever"/> ... </steps> Marc Guillemot & Dierk K

  21. Slide 21: AJAX

    Slide 21: AJAX

    AJAX ... <webtest name="Test DWR 2.0 RC3 demo App"> <steps> <invoke url="http://localhost:8080/dwr/simpletext"/> <verifyXPath xpath="//*[@id= 'demoReply']" text=""/> <clickButton label="Send"/> <sleep seconds="2" description="Wait for completion of async call"/> <verifyXPath xpath="//*[@id= 'demoRep

  22. Slide 22: Groovy WebTest

    Slide 22: Groovy WebTest

    Groovy WebTest ant.webtest(name: 'Test Google with Groovy, AntBuilder and WebTest') { steps() { invoke(url: 'http://www.google.com') verifyTitle(text: 'Google') setInputField(name: 'q', value: 'Groovy') clickButton(name: 'btnG') verifyXPath(xpath: "//a[@href='http://groovy.codehaus.org/']") } } Grai

  23. Slide 23: Key properties

    Slide 23: Key properties

    Key properties • simple • js support not as good as • fast “normal” browser • excellent reporting • doesn't accept (too) badly formed html • very low TCO • runs everywhere • no display needed • easy to extend • straightforward integration • doesn't accept (too) badly formed html Marc Guillemot & Die

  24. Slide 24: WebTest (possible) future(s)

    Slide 24: WebTest (possible) future(s)

    WebTest (possible) future(s) • dedicated AJAX support (coming) • WebTestClipse • (even) better reports • load testing • ... Marc Guillemot & Dierk König JAX 07, 26.04.2007

  25. Slide 25: Happy Testing!

    Slide 25: Happy Testing!

    Happy Testing! http://webtest.canoo.com/ Marc Guillemot & Dierk König JAX 07, 26.04.2007

  26. Slide 26: Bonus

    Slide 26: Bonus

    Bonus Marc Guillemot & Dierk König JAX 07, 26.04.2007

  27. Slide 27: User testimonials

    Slide 27: User testimonials

    User testimonials (from WebTest mailing list) • the ROI on WebTest is many orders of magnitude higher than any tool I've used • Support = good and $0 • It still Just Works. It has been remarkably robust, mature, and bug- free • It has scaled well • tests are much quicker to write and cheap to mainta

  28. Slide 28: Customize XPath

    Slide 28: Customize XPath

    Customize XPath <groovyScript> import org.jaxen.* import org.jaxen.function.* import com.canoo.webtest.engine.xpath.XPathHelper class ReverseFunction implements Function { Object call(Context context, List _args) { def input = StringFunction.evaluate(_args[0], context.navigator); return input.revers

  29. Slide 29: Customize WebTest

    Slide 29: Customize WebTest

    Customize WebTest ... <verifyXPath xpath="//*[@id='navPath1']” text="Home”/> <verifyXPath xpath="//*[@id='navPath2']” text="Functional testing”/> <verifyXPath xpath="//*[@id='navPath3']” text="WebTest”/> ... Works but: • too low level • not reusable Marc Guillemot & Dierk König JAX 07, 26.04.2007

  30. Slide 30: Customize WebTest

    Slide 30: Customize WebTest

    Customize WebTest ... <macrodef name="verifyNavPath”/> <attribute name="level1”/> <attribute name="level2”/> <attribute name="level3”/> <sequential> <verifyXPath xpath="//*[@id='navPath1']” text="@{level1}”/> <verifyXPath xpath="//*[@id='navPath2']” text="@{level2}”/> <verifyXPath xpath="//*[@id='na

  31. Slide 31: Customize WebTest

    Slide 31: Customize WebTest

    Customize WebTest <groovyScript name="verifyNavPath”><![CDATA[ class VerifyNavigationPath extends com.canoo.webtest.steps.Step { String level1, level2, level3, level4 void doExecute() { def ant = new AntBuilder(project) def levels = [0, level1, level2, level3, level4] for (i in 1..<levels.size()) {

Source: Internet Archive copy of webtest.canoo.com

More decks from Canoo Inc.

All 10 Canoo decks