Add Pre-Audit Actions to an Audit
Overview
Pre-Audit Actions allow an Audit to be configured with a username and password to access protected content. Pre-Audit Actions force the Audit to log into the website before visiting any pages, including the starting page(s) of the Audit. Configuring Pre-Audit Actions is similar to configuring Actions in Audits or Journeys.
Most likely you will want to take these steps and create an Action Set so that you can reuse this login process across other Audits. You can save your current steps to a new action set or use an existing action set by adding a step and selecting Action Type - Action Set.
Simulating the Login Process
Follow these instructions to add Pre-Audit Actions for an audit. Since there are many ways to implement logins (basic authentication, two-factor authentication, VPN, and more), these instructions are very general (see Create or Edit Journey for more details on setting up Actions):
- Create a new audit and fill out the URL and necessary information, click on the Pre-Audit Actions tab.
- After you click on Pre-Audit Actions, it allows you to add action steps.
- Configure the steps to perform the login (see the Creating Journeys article).
The steps to perform a login are called Actions and they are configured just the same as any other Actions in audits or Journeys.
The first Action for setting up login is always NavTo. Enter the URL of the page where the login functionality is.
Example Configurations
Example 1: Username and Password
A common login process involves a form with username and password fields and a submit button. A typical Pre-Audit Action configuration would look like the following, based on the page found at http://jpstyle.us/user/login:
- Step 1, access the login page
- Type: Navigate To
URL = http://jpstyle.us/user/login
- Type: Navigate To
- Step 2, type in the username
- Type: Input
Value = student
Identifier = edit-name
- Type: Input
- Step 3, type in the password
- Type: Masked Input
Value = trainme
Identifier = edit-pass
- Type: Masked Input
- Step 4, Click the submit button
- Type: Click
Identifier = edit-submit
- Type: Click
Example 2: Accept Cookie Opt-in
- Step 1, access the opt-out page
- Type: Navigate To
URL = http://jpstyle.us/user/login
- Type: Navigate To
- Step 2
- Type: Click
Identifier: show_settings
- Type: Click
- Step 3
- Type: Click/Check
Identifier: opt_out
- Type: Click/Check
- Step 4
- Type: Click
Identifier: save_preference_btn_handler
- Type: Click
- Step 5
- Type: Navigate To
URL = http://jpstyle.us/user/login
- Type: Navigate To
Example 3: Returning User
Depending on your test you may want to simulate a first-time visitor or a returning user experience. To simulate a returning user, you'll want to visit at least one page and allow cookies to be set before crawling the website.
- Type: Navigate To
URL = http://jpstyle.us/user/login
(note, this URL will be the starting URL for your Audit/Journey)
- Type: Navigate To
URL = http://jpstyle.us/user/login
(note, this URL will be the same URL listed in step 1)