Record a Script

Link to Record a Script copied to clipboard
warning

The axe Expert extension is officially retired. Read more about this on the axe Expert Replacement page. These pages will be taken down in July of 2024. Email helpdesk@deque.com with any questions or concerns.

Record scripts whenever you want to record yourself taking actions on the page under test in a sequential order so that they can be repeated automatically at a later time. Scripts can be particularly useful when applied to axe Monitor scans (for example, login scripts to establish secure sessions for page access, dynamic content scripts to expose hidden form menus and widgets, or for activating hidden steps in multi-step processes).

You can control which types of events are recorded by selecting options on the Script Recording Options panel, which is accessed via the Options link on the Scripts panel.

Before you begin: Ensure you first have the desired start page loaded in the browser.

  1. On the Scripts panel, select Start Recording.

    Clicking Start Recording button on Scripts panel

  2. Reload the web page in the browser after clicking the Record button. Start performing actions on the page under test as desired, in the desired order (for example, by clicking the Desktops page link on the main horizontal menu).

    Example of performing actions on the page under test such as clicking on the Desktops page link on the main menu in Gefalscht CompuTech site

    You will notice that as you interact with the site, a table appears in the main content pane of the Scripts panel and rows begin to appear with each column populated with values for each event (for example, in the Event column a 'loadURL' event with the URL column as 'http://abcdcomputech.dequecloud.com/desktops.php').

  3. When you have finished performing all desired actions, select Stop Recording (which has replaced the Start Recording button).

You must stop the recording at some point in order to have a recorded script. This enables the previously greyed-out Upload link above the event table. Additionally, this causes Stop Recording to change back to Start Recording again, and displays a Play button beneath.

Clicking Stop Recording button on Scripts panel

Recording stops immediately, and every action you recorded now displays as an event row in the Scripts panel table in the right content pane, with each column populated with values.

Not every event will record content values in every column cell, so some (for example, the Details column for the focus event type) may be blank. Additionally, stopping a recording enables the Edit and Delete options in the Actions column menus.

The Scripts panel table displays event rows with populated columns of information in the content pane, including Actions column menus with Edit and Delete options

Record and export CLI actions

Record and export CLI scripts using the Scripts panel.

Current supported CLI actions available for script recording and export include:

  • change — change the value of <input>, <select>, <textarea>
  • click — click an element in the DOM
  • navigate — navigate to a new page

In time, we plan to add more CLI actions. The current functionality does allow users to get started with CLI without writing a single line of code!

  1. Navigate to the web page you wish to analyze through scripting. For the purposes of this example, we've opened https://dequelabs.github.io/aget-demo-site/.

    A web browser window displaying 'https://dequelabs.github.io/aget-demo-site/' with a pesky 'Satisfaction Survey' modal dialog in the middle of the display.

note

The Satisfaction Survey dialog that displays in the middle of the browser page. We'll record a small script to dismiss the dialog.

  1. Open your browser's developer tools (Chrome for macOS is used in the examples here) and navigate to the axe Expert Extension DevTools tab. Select Scripts.

    A web browser window displaying Chrome's DevTools with the axe Expert tab active and displaying the Scripts option in the drop-down menu.

  2. Activate Start Recording.

    A web browser window displaying Chrome's DevTools displaying the pointer over the Start Recording button.

    When active, the Start Recording button turns red to indicate active recording and the text below the button changes to Stop Recording.

    A web browser window displaying Chrome's DevTools displaying the Stop Recording button.

  3. With script recording active, move the DevTools window out of the way to display the https://dequelabs.github.io/aget-demo-site/. Select X to dismiss the dialog window.

  4. Switch your focus to the axe Expert Extension and select Stop Recording. Notice that the Script panel is now populated with at least one action - where the modal dialog was dismissed.

    The DevTools window displaying the recorded script in the Script panel.

  5. Select Stop Recording button in the axe Expert left panel and review the content of the Script panel. The Start Recording button is now enabled. Note that the script contains a click event. Also note the location of the Export to AGet link as the second of four buttons on the upper right quadrant of the Script panel.

    The DevTools window displaying the recorded script in the script panel. Note the Start Recording button re-enabled and the location of the export button as the first of three buttons on the upper right quadrant of the Script panel.

  6. Select Export to CLI to start the CLI export process. axe Expert Extension displays the system file browser. Navigate to the folder where you wish to save the CLI script.

    Provide a meaningful file name, carefully preserving the .json extension and select Save.

    The system file browser window with the file name highlighted. The filename is now dismiss-modal.json. The file will be saved in the Export_AGet_Scripts folder, and the save button is highlighted

  7. The system file browser window is dismissed and a successful save message and the name of the saved file is displayed in the lower left corner of the DevTools window.

    The DevTools window with the successful file save and file name highlighted.

  8. Open the saved JSON file in your favorite text editor to review the CLI script contents:

    Visual Studio Code open and displaying the JSON contents of the exported AGet script.