Webtests Reloaded - Webtest with Selenium, TestNG, Groovy and Maven

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Webtests Reloaded - Webtest with Selenium, TestNG, Groovy and Maven - Presentation Transcript

    1. Thorsten Kamann Software-Architekt, Coach 25.05.2009
    2. Webtest? Tools Setup & Run
    3. Pitfalls Automatic Tests
    4. Only manual Tests Click-Through Testing Different Browser? Only new/changed pages will be tested
    5. Execute Test „anywhere and anytime“ Repeatable Tests Avoid the factor „Forgotten“ Old Feature are always tested Non-breakable Features
    6. Usable for direct testing of Web-UIs Selenium RemoteControl starts the commands direct in the browser No Java-Implementation of a Browser-Engine Create tests with the Selenium-IDE Export the Testskripts with JavaScript in any target language
    7. Dynamic language for the Java-Platform Seamless Integration with jUnit and TestNG Powerful Syntax Easy Learning Toolsupport (Eclipse, Maven, Ant, …)
    8. Testframework for Integrationstesting Annotation-based Configuration Parameterized Tests Datasource-Support for creation of testdata Toolsupport (Eclipse, Maven, Ant, …)
    9. Buildtool Supports automatically testing Integration of Testframeworks Deklarative Toolsupport(Eclipse, Netbeans, IntelliJ, Konsole)
    10. Architecture Usecases Projectsetup Execution of Tests Extensions
    11. Tomcat petclinic.war HSQL DB Selenium
    12. Run Tests Start Selenium Deploy Webapp Start Tomcat Compile
    13. Usecase-driven Tests Definition of every User-Action Definition of Inputdata Definition of Return Values Recording with Selenium-IDE
    14. m2Eclipse GroovyIDE TestNG
    15. Java-Project Maven DM Groovy
    16. DM: Groovy DM: TestNG
    17. Groovy <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-all</artifactId> <version>1.5.6</version> </dependency> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>5.5</version> <classifier>jdk15</classifier> <optional>true</optional> <scope>test</scope> </dependency> TestNG with JDK5 Annotation-Support
    18. testsuite.xml Grouping of Tests • Packages • Groups • Include/Excludes Definition of Parameter
    19. Parameter <suite name=„webtest-reloaded\"> <test name=„firefox-tests\" annotations=\"JDK\"> <parameter name=\"browser\" value=\"firefox\"/> <groups> <run> <include name=\"it-test\"></include> </run> </groups> Groups <packages> <package name=\"selenium.groovy.testng\"/> </packages> </test> </suite> Packages
    20. Export of Testcases PHP, C#, Java JavaScript for Export Language Any Target Language is supported
    21. function assertTrue(expression) { return \"AssertJUnit.assertTrue(\" + expression.toString() + \")\"; } function assignToVariable(type, variable, expression) { return type + \" \" + variable + (expression)? \" = \" + expression.toString(): \"\"; }
    22. public class NewTest { Selenium selenium String baseUrl = \"ENTER_BASEURL_HERE\" @BeforeClass(groups=[\"it-test\"]) public void beforeClass(){…} @BeforeMethod(groups=[\"it-test\"]) public void startSelenium(){…} @AfterMethod(groups=[\"it-test\"]) public void stopSelenium(){…} @Test(groups=[\"it-test\"]) public void executeIntegrationTest { … } }
    23. Maven Surefire-Plugin • Deactivate Lifecycle test • Activate Lifecycle integration-test • Integrate TestNG‘s testsuite.xml
    24. Deactivate Lifecycle test <plugin> <artifactId>maven-surefire-plugin</artifactId> <configuration> <skip>true</skip> </configuration> Activate <executions> Lifecycle integration-test <execution> <phase>integration-test</phase> <configuration> <skip>false</skip> <suiteXmlFiles> <suiteXmlFile>src/test/config/it-suite.xm</suiteXmlFile> </suiteXmlFiles> </configuration> </execution> Integrate </executions> testsuite </plugin>
    25. pre-integration-test Deploy Start Tomcat Webapp post-integration-test Undeploy Stop Tomcat Webapp
    26. <<Sourcecode too long… please see the sample project>>
    27. pre-integration-test Optional: start-server Prepare Firexox profile post-integration-test stop-server
    28. Start Selenium-Server <plugin> <artifactId>selenium-maven-plugin</artifactId> <executions> <execution> <phase>pre-integration-test</phase> <goals> <goal>start-server</goal> </goals> <configuration> <background>true</background> <firefoxProfileTemplate> Prepared Firefox … Profile </firefoxProfileTemplate> </configuration> </execution> </executions> </plugin>
    29. mvn –e surefire-report:report-only mvn –e clean integration-test
    30. Run As -> TestNG Test Start Selenium Standalone
    31. Different Browser Different OS Virtualizing
    32. SpringAOP Performance of Methods Performance of Views Stresstests
    33. http://selenium.openqa.org/ http://testng.org/ http://groovy.codehaus.org/ http://maven.apache.org/ http:/www.thorsten- kamann.de/weblog/publications/webtests- reloaded-webtests-mit-selenium-testng- groovy-und-maven

    + thorquethorque, 5 months ago

    custom

    845 views, 0 favs, 6 embeds more stats

    The most difficult part to test is the WebUI. This more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 845
      • 620 on SlideShare
      • 225 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 7
    Most viewed embeds
    • 137 views on http://www.thorsten-kamann.de
    • 58 views on http://www.itemis.de
    • 25 views on http://www.itemis.com
    • 3 views on https://onion.net
    • 1 views on http://209.85.129.132

    more

    All embeds
    • 137 views on http://www.thorsten-kamann.de
    • 58 views on http://www.itemis.de
    • 25 views on http://www.itemis.com
    • 3 views on https://onion.net
    • 1 views on http://209.85.129.132
    • 1 views on http://209.85.135.132

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories