Custom Agents

How to create custom AI agent personas in ContextQA to calibrate test execution behavior for specialized application domains such as Salesforce, accessibility testing, or localization.

circle-info

Who is this for? All roles — particularly SDETs and QA engineers who need domain-specific AI behavior for Salesforce, accessibility testing, financial applications, or other specialized domains.

A Custom Agent is a named AI persona with a domain-specific system prompt that shapes how the AI agent behaves during test execution. While the default ContextQA AI agent is calibrated for general web and mobile testing, custom agents let you tune the behavior for specialized application types, testing methodologies, or organizational conventions.


When to Use Custom Agents

Use a custom agent when the default AI agent's behavior is not optimal for your domain:

Scenario
What custom agent solves

Salesforce Lightning UI

Teaches the agent to recognize Lightning component naming patterns, handle record pages, and navigate App Launcher

Accessibility testing

Instructs the agent to flag missing ARIA labels, poor color contrast, and keyboard navigation issues on every page

Localization / RTL apps

Calibrates the agent for right-to-left layouts and non-ASCII character handling

Financial applications

Encodes domain knowledge about currency formatting, decimal precision, and financial calculation validation

Healthcare / EHR systems

Trains the agent on clinical workflow patterns (patient records, order entry, clinical notes)

Internal tools with unusual UX

Encodes institutional knowledge about non-standard UI patterns specific to your internal applications

Custom agents are applied per execution — you choose which agent to use when triggering a test case or test plan.


Accessing Custom Agents

  1. Open your ContextQA workspace.

  2. In the left navigation, go to Custom Agents (route: /td/:versionId/custom_agents).

  3. The Custom Agents list shows all personas for this workspace.

Access note: Custom Agents requires a plan with advanced AI features. Contact your workspace administrator if this option is not visible.


Creating a Custom Agent

  1. From the Custom Agents list, click + New Agent.

  2. Enter a Name — a descriptive label (e.g., "Salesforce Lightning Agent", "Accessibility Auditor").

  3. Enter the Description / System Prompt — plain-English behavioral instructions for this persona.

  4. Click Save.

The agent is now available for selection when executing test cases and test plans.


Writing Effective Agent Descriptions

The agent description (system prompt) tells the AI how to behave throughout the test execution. Think of it as a job description for a specialized QA engineer.

✅ Effective agent descriptions

Salesforce Lightning Agent:

Accessibility Auditor:

Financial Application Agent:

❌ Anti-patterns

  • Too short: "Test the application carefully." — provides no actionable guidance.

  • Contradictory: Including both "click Accept on all dialogs" and "dismiss unexpected dialogs" creates conflicting behavior.

  • Overly rigid selectors: "The submit button has ID btn-submit-9xa3" — these IDs change and will cause failures after the next deploy.


Using a Custom Agent in Test Executions

Via the portal

  1. Open a test case and click Run.

  2. In the execution settings panel, select a Custom Agent from the dropdown.

  3. Click Execute.

Via the MCP server


Combining Custom Agents with Knowledge Bases

Custom agents and knowledge bases serve complementary purposes:

Feature
Purpose
Scope

Custom Agent

How the AI behaves (domain expertise, testing methodology)

Applied per execution

Knowledge Base

What the AI should do when specific situations arise (close banners, use test cards)

Applied per workspace or per execution

Best practice: Use the custom agent for domain-wide behavioral calibration, and knowledge base entries for specific recurring UI situations.


MCP Tools for Custom Agents

Tool
Purpose

list_custom_agents

List all agents and get their IDs

create_custom_agent

Create a new agent programmatically

execute_test_case(persona_id=...)

Apply an agent to a test case run

execute_test_plan(persona_id=...)

Apply an agent to a test plan run

Create via MCP


Managing Custom Agents

Action
How

Edit an agent

Click the agent name → Edit description

Delete an agent

Click the three-dot menu → Delete

Test an agent

Run a representative test case with the agent selected; review the execution video for behavioral differences


circle-info

70% less human effort with AI test generation and self-healing. Book a Demo →arrow-up-right — See AI generate, execute, and maintain tests for your application.

Last updated

Was this helpful?