# Directives Library

Directives enable you to take control of how exploration works (read more on Directives).

How to use a directive

Once you've added a directive from the library, you just need to update your goal's directive under the Advanced Settings option like shown below.

add-title-assertions-directive-01

# Accessibility testing

Virtuoso enables you to make validations at scale, and one common use case for these validations is accessibility testing. In this example, we look at how you can in a few minutes, validate accessibility violations across your application, with the help of the Axe library.

First, . Add the extension either to the project you want to use for testing or make it available to your organization.

Then, create a new goal against your target application URL, or fork an existing goal.

Warning: we recommend that you always explore in a dedicated goal, rather than inside an existing test automation goal, since this gives you the option to simply discard the exploration results.

Now, review the base journey(s) in your goal, so that they cover the base of the pages you wish to start exploring from first. Here are a few common examples:

  • A journey with a first checkpoint of simply navigating to the target application;
  • A journey with a first checkpoint that navigates to a login screen, enters login credentials, attempt the login and waits for the page to load;
  • Multiple journeys which span across different parts of the application.

You can try out the extension you just added by adding a step getAxeViolations returning $violations.

Once you are happy with your base journeys, launch an execution with capture of checkpoints enabled.

While that is executing, .

Once you have that added, open your goal's advanced settings and set the directive to accessibility, and save the settings.

Next, wait until the execution you launched earlier is finished, and then open your goal view, and explore further from all (or some) of the checkpoints you wish to start testing from.

Once the exploration completes, you should see tests automatically generated with embedded steps to capture the accessibility violations.

Now execute all journeys and check the execution report, to review the violation side effects in each journey execution. If you face any issues or challenges, please feel free to contact our customer success team who will be more than happy to help.

# Automatically add title assertions

This directive automates asserting that the page's rendered HTML includes the tag <title>.

# Skip interactions with common elements

This directive uses KV storage to remember the interactions sent so far during exploration, allowing it to skip the same interactions on elements that appear on multiple pages. On some applications this can substantially reduce the time taken to complete an exploration, at a cost of missing some interactions with stateful parts of the application (for example buy buttons).

Last Updated: 3/25/2021, 3:37:34 PM