Download the Java Demo Project

This page is not available in the language you requested. You have been redirected to the English version of the page.
Link to this page copied to clipboard

Download and run a complete sample Java project that shows how to use Axe DevTools for Web

Not for use with personal data

These demos serve to familiarize users with Axe DevTools for Java, and produce results without needing an existing Java web project to integrate with. For information on how to install Axe DevTools into an existing project, read the guide on installing from a bundle, from your own artifact repository, or from Deque's Agora.

Prerequisites

These projects require a Java Development environment, including a JDK, and Maven or Gradle. They also require a Selenium WebDriver of your choice.

Examples Catalog

The Examples Catalog on GitHub provides complete Java sample projects that you can clone and run to generate accessibility reports without needing an existing web project to integrate with:

  1. Maven Selenium
  2. Gradle JUnit
  3. Gradle TestNG
  4. Gradle Cucumber

Each example includes a README with setup and usage instructions.

Use

  1. Clone the Deque Examples Catalog repository on GitHub:

    git clone git@github.com:dequelabs/axe-devtools-html-api-examples.git
    note

    You might need to use a different clone command depending on how you have set up access to GitHub. The above command uses SSH. See Connecting to GitHub with SSH for more information.

  2. Navigate to the example of your choice, for example the Maven Selenium project:

    cd axe-devtools-html-api-examples/Java/java-selenium
  3. Run mvn test.

Once the tests have finished running, the results are compiled into an HTML report. They will be located in the $project-root/target/attest-reports directory. These reports allow you to easily consume the results of the accessibility scans.

If desired, you can configure the project to scan any web addressable page by changing the test case URLs in the test file(s) within $project-root/src/test/*.java and re-running the tests.

Configuration

Initially, one or more of the components within this project may be incompatible with your environment. You may need to modify the compiler version or testing framework version. These can be modified within the pom.xml or build.gradle files. Additionally, these projects are configured to use Selenium ChromeDriver. If you use a different browser for automated testing, you can modify the browser driver configuration within the test files located at $project-root/src/test/*.java.

If you're still having trouble, contact your Deque representative directly, ask us via our support desk, or send us an email. We'll be happy to help you out.