Skip to content
VirtualLP Virtual Learning Platform
Testing Tools P15 intermediate

JUnit tests for a web application’s search

Explore the VLP Demo Store, add Selenium and JUnit to an Eclipse project, run four search tests that drive Chrome, then break and fix an expectation using the failure trace.

What you'll do

  • Combine JUnit 4 with Selenium WebDriver
  • Use @BeforeClass / @Before / @AfterClass correctly
  • Synchronise with explicit waits
  • Analyse failures in the JUnit view

Lab tasks

  1. 1 Explore the application under test
  2. 2 Add JUnit 4 and the Selenium JARs
  3. 3 Run SearchTest – 4/4 green
  4. 4 Introduce a defect and read the trace
  5. 5 Fix it and get a green bar again