O'Reilly logo

Jenkins Continuous Integration Cookbook by Alan Berg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Triggering Failsafe integration tests with Selenium Webdriver

Unit tests are a natural way for programmers to defend their code against regressions. Unit tests are lightweight and easy to run. Writing unit tests should be as easy as writing print statements. JUnit (http://www.junit.org/) is a popular unit test framework for Java; TestNG (http://testng.org/doc/index.html) is another.

This recipe uses Webdriver and HtmlUnit in combination with TestNG to write simple and automated functional tests. Using HtmlUnit instead of a real browser makes for stable OS agnostic tests, which, although does not test browser compatibility, can spot the majority of functional failures.

Getting ready

Create a project directory.

How to do it...

  1. Create pom.xml with the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required