Core Concepts
Understanding the fundamental concepts of TrueAssert will help you use the platform effectively.
Architecture Overview
TrueAssert consists of three main components:
Django Web Platform (
qa_platform/) - User interface and test managementAgent Controller (
controller/) - Test orchestration and agent managementBrowser Agent (
agent/) - Selenium-based browser automation
Key Concepts
Tests
A Test represents an automated test case that can be executed against a web application.
Test Properties:
Name: Descriptive name for the test
Target URL: The website URL to test
Status: Current state (DRAFTING, REVIEW, READY, ARCHIVED)
Project: Belongs to a project (which belongs to an organization)
Version: Increments when test steps are modified
Login Required: Whether the test needs authentication
Use Predefined Session: Whether to reuse existing session data
Test Status Flow:
DRAFTING → REVIEW → READY
↓
ARCHIVEDTest Steps
A Test Step is a single action in a test (e.g., click a button, fill a form, wait for an element).
Step Properties:
Action Type: CLICK, FILL, GOTO, WAIT, etc.
Selector: XPath or CSS selector to locate the element
Selector Type: XPATH or CSS
Value: Input value (for FILL actions)
Description: Human-readable description
Order: Sequence number in the test
Organizations
An Organization is the top-level container for grouping related work.
Organization Properties:
Name: Organization name
Owner: User who created the organization
Members: Users with access to the organization
API Keys: Belong to organizations
Default Setup: When you create an account, a "Default organization" is automatically created.
Projects
A Project belongs to an organization and groups related tests.
Project Properties:
Name: Project name
Organization: Parent organization
Base URL: Default URL for tests in this project
Login Settings: Optional login configuration (URL, username, password)
Session Data: Stored browser sessions (cookies, localStorage, sessionStorage)
Default Setup: A "Default project" is created automatically with your account.
API Keys
API Keys authenticate agents and browser plugins with TrueAssert.
Key Properties:
Name: User-friendly identifier
Organization: Belongs to an organization
Key Format:
tp_[random_string]Active Status: Can be revoked
Shared: One key can be used by multiple agents/plugins
Security: Keys are hashed (SHA-256) in the database. The plain text key is shown only once after creation.
Agents
Agents are browser automation workers that execute tests.
Agent Properties:
Name: Identifier for the agent
API Key: Authentication key
Status: Current state (IDLE, BUSY, etc.)
Organization: Belongs to an organization
How They Work:
Agents connect via gRPC
They poll for commands from the controller
Execute browser automation using Selenium
Report results back to the controller
Test Executions
A Test Execution represents a single run of a test.
Execution Properties:
Test: The test being executed
Status: IN_QUEUE, RUNNING, SUCCESS, FAIL
Triggered By: User who started the execution
Test Version: Version of the test when executed
Step Results: Individual step execution results
Execution Status Flow:
IN_QUEUE → RUNNING → SUCCESS/FAILTest Step Executions
A Test Step Execution represents the execution of a single test step.
Step Execution Properties:
Test Execution: Parent execution
Test Step: The step being executed
Status: PENDING, RUNNING, SUCCESS, FAIL, SKIPPED
Screenshot: Optional screenshot after execution
Error Message: Error details if failed
How Test Creation Works
Browser Plugin Recording
User clicks "Record" in browser plugin
Content script captures DOM events (clicks, keypresses)
Actions are sent to service worker
Service worker sends data to TrueAssert backend via Connect-ES
Test is created with recorded steps
XPath selectors are generated automatically
AI Test Generation
User submits test creation form with prompt
Test is created with status DRAFTING
Background processor picks up the test
TestGenerator uses LLM to analyze prompt
LLM generates test steps based on prompt
Steps are created and test status updates to REVIEW
If login_required=True, login flow executes automatically
Test status becomes READY when complete
Manual Test Creation
User creates test via web interface
User manually adds test steps
User configures each step (action, selector, value)
Test is ready when user marks it as READY
How Test Execution Works
User Triggers Execution: Clicks "Run Test" in web interface
Test Execution Created: TestExecution object created with IN_QUEUE status
Step Executions Created: TestStepExecution objects created for each step
Controller Picks Up Test: Background processor finds tests in queue
Agent Assignment: Controller assigns test to available agent
Status Updates: TestExecution status changes to RUNNING
Commands Queued: Commands are added to command queue for each step
Agent Executes: Agent polls for commands and executes them
Results Reported: Agent reports results back via gRPC
Status Updates: Step executions and test execution status updated
Completion: Test execution marked as SUCCESS or FAIL
Session Management
Login Flow
When login_required=True:
Session Validation: First tries to validate existing session
Executes LOAD_SESSION command
Runs validation steps (GOTO + WAIT from login test)
If successful, reuses session
Full Login: If validation fails or no session exists
Executes CLEAR_BROWSER command
Runs all login test steps
Executes SAVE_SESSION command
Saves session data to database
Session Data
SessionData model stores browser state:
Cookies: All browser cookies
localStorage: Browser localStorage data
sessionStorage: Browser sessionStorage data
Domain: Per-domain session storage
Project: OneToOne relationship with Project
Selectors
XPath Selectors
TrueAssert generates intelligent XPath selectors that are more robust than CSS selectors.
Selector Priority (lower penalty = better):
ID (penalty: 0)
data-testid (penalty: 1)
ARIA attributes (penalty: 5)
Form attributes (penalty: 10)
Text content (penalty: 20)
CSS classes (penalty: 50)
Structural positioning (penalty: 1000+)
Benefits:
More stable than CSS selectors
Resists UI changes better
Algorithmic generation ensures uniqueness
Selector Types
XPATH: XPath expression (e.g.,
//button[@id='submit'])CSS: CSS selector (e.g.,
button#submit)
Communication Protocols
Connect-ES
Browser plugin uses Connect-ES (modern RPC framework) to communicate with the backend:
Endpoint:
/connect/agent.AgentService/[method]Protocol: HTTP-based RPC
No proxy needed (unlike old gRPC-Web/Envoy setup)
gRPC
Agents use gRPC for communication:
Protocol: gRPC over HTTP/2
Port: 50051 (default)
Methods: Register, Heartbeat, GetCommand, ReportResult
Background Processing
Test Generation
The BackgroundProcessor runs continuously:
Checks for tests with DRAFTING status
Processes tests one at a time
Uses TestGenerator to create steps
Updates test status as it progresses
Test Execution
The Controller manages test execution:
Polls for tests in IN_QUEUE status
Assigns tests to available agents
Manages command queue
Processes execution results
Related Topics
Account Setup - Understanding organizations and projects
Installation - API keys and authentication
Your First Test - Putting concepts into practice
Browser Plugin Recording - How recording works
AI Test Generation - How AI generation works
Last updated