You're viewing help content for version:

Automate the execution of UI tests in web browsers and provide a test result. AEM provides a framework for automating tests for your AEM UI. Using the framework, you write and run UI tests directly in a web browser. The framework provides the following tools:

  • A javascript API for creating tests.
  • A Test panel in the the touch-optimized UI for running tests.
The AEM test framework uses Hobbes.js, a testing library written in Javascript. The Hobbes.js framework was developed for testing AEM as part of the development process. The framework is now available for public use for testing your AEM applications. 


Have a look at the Hobbes.js API documentation.

Executing Tests

Viewing test suites and test cases

Open the Testing Console to see the registered test suites. The Tests panel contains a list of test suites and their test cases.


To reach the Testing Console:

  1. Navigate to Tools by selecting the Adobe Experience Manager link (top left) and then the hammer icon.

  2. Tap/click Operations.

  3. Tap/click Testing. The Testing Console opens.

Running a Single Test Case

Run a single test case from a test suite. When you run a test, the page changes as the test actions are executed. The test results appear after the actions have executed.
Icons indicate test results. Checkmark icons indicate a passed test:


"X" icons indicate a failed test:


To run a test:

  1. In the Tests panel, click the name of the test case that you want to run.

  2. Click the Run Test Case button.

  3. Review the results of each action of the test case by clicking the name of your test in the Result panel.


Running Multiple Tests

Test cases execute sequentially in the order that they appear in the test suite. You can drill down into a test case to see the results of each action.

  1. On the Tests panel, click either the Run all tests button or the Run tests button below the title of the test suite that you want to run.

  2. When the test is complete, to view the results of each action in a test case, click the title of the test case.


Example: Creating and Using a Simple Test Suite

The following procedure steps you through the creation and execution of a test suite. The test uses the Geometrixx Outdoors sample web site. If you do not have the sample installed, you can easily modify the test to use a different web page.

  1. Open CRXDE Lite in your web browser. (http://localhost:4502/crx/de)

  2. Right-click the /etc/clientlibs folder and click Create > Create Folder. Type myTests for the name and click OK.

  3. Right-click the /etc/clientlibs/myTests folder and click Create > Create Node. Use the following property values and then click OK:

    • Name: myFirstTest
    • Type: cq:ClientLibraryFolder
  4. Add the following properties to the myFirstTest node:

    Name Type Value
    categories String[] granite.testing.hobbes.tests
    dependencies String[] granite.testing.hobbes.testrunner


    AEM Forms only

    To test adaptive forms, add the following values to the categories and dependencies. For example:

    categories: granite.testing.hobbes.tests,

    dependencies: granite.testing.hobbes.testrunner,

  5. Click Save All.

  6. Right-click the myFirstTest node and click Create > Create File. Name the file js.txt and click OK.

  7. In the js.txt file, type the following text:

  8. Click Save All and then close the js.txt file.

  9. Right-click the myFirstTest node and click Create > Create File. Name the file myTestSuite.js and click OK.

  10. Copy the following code to the myTestSuite.js file then save the file:

    new hobs.TestSuite("Home Page Test Suite", {path:"/etc/clientlibs/myTests/myFirstTest/myTestSuite.js"})
    .addTestCase(new hobs.TestCase("Navigate to home page")
    .addTestCase(new hobs.TestCase("Hover Over Topnav")
    .addTestCase(new hobs.TestCase("Click Topnav Link")
                 .click("li.topnav-item-1 a"));
  11. Navigate to the Testing console to try your Test Suite.