Multi-step Form

Working with Multi-step Forms

Multi-step forms present unique challenges for automation because:

This example demonstrates how to use TesterUtilities to automate a multi-step form by:

Account Registration Wizard

Complete the following steps to create your account.

1
2
3
4

Step 1: Account Details

Step 2: Personal Information

Step 3: Contact Information

Step 4: Review & Submit

Multi-step Form JSON Configuration

Copy this JSON configuration to test the multi-step form with TesterUtilities extension. It uses a sequence of selectors and actions to navigate through each step of the form.

{
  "registrationForm": {
    "type": "multiStep",
    "timeout": 500,
    "steps": [
      {
        "selector": "Email Address",
        "queryType": "label",
        "type": "input",
        "data": "test.user@example.com",
        "dataType": "static"
      },
      {
        "selector": "Password",
        "queryType": "label",
        "type": "input",
        "data": "SecurePassword123!",
        "dataType": "static"
      },
      {
        "selector": "Confirm Password",
        "queryType": "label",
        "type": "input",
        "data": "SecurePassword123!",
        "dataType": "static"
      },
      {
        "selector": "to-step-2",
        "queryType": "testId",
        "type": "simpleClick"
      },
      {
        "selector": "First Name",
        "queryType": "label",
        "type": "input",
        "data": "John",
        "dataType": "static"
      },
      {
        "selector": "Last Name",
        "queryType": "label",
        "type": "input",
        "data": "Doe",
        "dataType": "static"
      },
      {
        "selector": "Date of Birth",
        "queryType": "label",
        "type": "input",
        "data": "1990-01-15",
        "dataType": "static"
      },
      {
        "selector": "Male",
        "queryType": "label",
        "type": "checkCheckbox"
      },
      {
        "selector": "to-step-3",
        "queryType": "testId",
        "type": "simpleClick"
      },
      {
        "selector": "Phone Number",
        "queryType": "label",
        "type": "input",
        "data": "+1 (555) 123-4567",
        "dataType": "static"
      },
      {
        "selector": "Address",
        "queryType": "label",
        "type": "input",
        "data": "123 Main Street",
        "dataType": "static"
      },
      {
        "selector": "City",
        "queryType": "label",
        "type": "input",
        "data": "New York",
        "dataType": "static"
      },
      {
        "selector": "Country",
        "queryType": "label",
        "type": "input", 
        "data": "us",
        "dataType": "static"
      },
      {
        "selector": "to-step-4",
        "queryType": "testId",
        "type": "simpleClick"
      },
      {
        "selector": "terms",
        "queryType": "testId",
        "type": "checkCheckbox"
      },
      {
        "selector": "newsletter",
        "queryType": "testId", 
        "type": "checkCheckbox"
      },
      {
        "selector": "submit-form",
        "queryType": "testId",
        "type": "simpleClick"
      }
    ]
  }
}

Multi-step Form Automation Challenges

Automating multi-step forms comes with several challenges:

Strategy for Multi-step Forms

TesterUtilities handles multi-step forms by using a sequential approach with explicit navigation actions. The recommended strategy is:

  1. Fill out fields in the current visible step
  2. Use a click action on the navigation button to move to the next step
  3. Wait for the next step to become visible
  4. Continue with the next set of fields
  5. Repeat until the final submission