Test Generation & Execution
Recording Salesforce test cases in ContextQA, managing test data with profiles and parameters, and running tests in parallel with execution logs.
Documentation owner: Deep Barot · Last updated: November 12, 2026
Quick answer
Create a Salesforce case by recording an authorized browser journey or generating steps from reviewed requirements. Add a reusable role-specific login prerequisite, parameterize synthetic data, run the case, and verify its execution evidence and saved record state. Group reviewed cases into plans for repeatable regression.
Key takeaways
Recording Salesforce test cases in ContextQA, managing test data with profiles and parameters, and running tests in parallel with execution logs.
The two course segments show how a reusable Salesforce test is authored and then run.
ContextQA creates test cases by recording your interactions with the Salesforce UI.
What this page covers
This page covers the full lifecycle of a Salesforce test case in ContextQA: recording, data management, execution, and reviewing logs.
Interactive course: create and run your first Salesforce test
The two course segments show how a reusable Salesforce test is authored and then run. They are ungated, so you can follow the captured workflow without a ContextQA or Salesforce login.
Part 1 — Create the test case
Part 2 — Run the Salesforce login test
What to notice
A reusable login case can become a prerequisite instead of being copied into every Salesforce scenario.
Captured steps retain human-readable intent and element context for review after Lightning changes.
The run result connects each action, validation, and evidence item to the same execution.

The existing editor screenshot above shows an opportunity case with a broad text-presence assertion. For release checks, assert the exact expected stage and persisted history; partial text presence alone is insufficient. The example illustrates authoring after reusing a dedicated Salesforce session prerequisite. This keeps authentication separate from the business assertion and makes the same logged-in setup available to multiple lead, opportunity, CPQ, and service scenarios. For lifecycle-level coverage and measurable business outcomes, see Salesforce and enterprise workflows.
Recording a Salesforce test session
ContextQA creates test cases by recording your interactions with the Salesforce UI. The recorder captures not just the element locator but also metadata — label, role, surrounding context — so the AI can re-locate elements even after Salesforce regenerates its DOM identifiers.
In ContextQA, click the plus (+) icon to start a new scenario.
Select Start recording (or choose an existing scenario to extend).
Perform the Salesforce workflow you want to automate: navigate to a record, fill in fields, click action buttons, submit forms.
Stop the recording when the workflow is complete.
Click the Edit icon (three dots) on any step to review the captured locator and metadata. ContextQA stores both to support review and element recovery when the UI changes.
Stored metadata can help resolve changed elements. Validate critical suites after Salesforce updates and review any locator recovery evidence. A changed field meaning, permission, or business rule still requires explicit review.
Executing a recorded test case
Open the test case in ContextQA.
Click Run.
Wait for a terminal result. Use appropriate readiness assertions and bounded waits for asynchronous Salesforce operations; investigate timeouts rather than hiding them with arbitrary delays.
Review the results in the execution view. A pass confirms only the assertions executed in that run. Verify saved records, role behavior, and relevant downstream outcomes before release sign-off.
Interactive demo: execute a Salesforce test with dynamic data
Use this walkthrough to see a saved Salesforce case execute with data resolved at runtime instead of relying on hard-coded record values.
What to notice
Environment and profile values are selected independently from the Salesforce test logic.
Dynamic values make repeated runs less likely to collide with existing sandbox records.
The execution report preserves the resolved outcome while protected values remain outside the test description.
Managing test data with profiles
Hardcoding values like usernames, passwords, or record field data into test steps makes tests brittle and difficult to maintain. ContextQA separates test data from test logic using test data profiles, parameters, and variables.
Parameters vs. variables
Parameter
An input value injected from a test data profile
Usernames, passwords, record field values provided before the test runs
Variable
A value captured during execution and reused in later steps
Order IDs, confirmation numbers, or any value generated by the application at runtime
Creating a test data profile
A test data profile is a table of input values — each row is one data set. Use synthetic business inputs and approved protected authentication configuration. Limit access to sensitive values and exclude them from screenshots and exported reports.
Navigate to the test data profiles section in ContextQA to view existing profiles or create a new one for your Salesforce module.
Connecting a test case to a test data profile
Open the Salesforce test case you want to parameterize.
Click Add step and hover over the menu icon.
Choose For loop. Select your test data profile, set the loop boundaries to Start Loop and End Loop, and click Create.
Click Reorder and drag all relevant test steps underneath the for-loop step so they execute within the loop.
Click Update to save the reordered test case.
Replacing hardcoded values with parameters
Find a step that contains a hardcoded value you want to replace (for example, a username or password field).
Click the Edit icon on that step.
Remove the hardcoded value from the field.
Click Parameter and select the parameter that corresponds to the column in your test data profile (for example,
user_emailorpassword).Click Update to save the step.
Repeat for every step that contains data you want to drive from the profile.
Running with a test data profile
Click Run on the test case.
Choose execution from the run options.
ContextQA fetches each row from the test data profile and executes the for-loop steps once per row. The execution history shows one result per data set, making it easy to see which inputs passed and which failed.
Parallel execution and test plans
For large Salesforce test suites, parallel execution reduces total run time and provides faster feedback.
Setting up a test plan for parallel execution
Navigate to Plans → Test Plans in ContextQA.
Open the test plan that contains your Salesforce test cases.
Click the Edit icon on the test plan.
Go to the Test Machine and Issue section. Add your test suite and select a browser (for example, Chrome).
Click Add to save the machine configuration.
Open Test Plan Settings and set the parallel execution count — choose a value supported by your runner capacity, Salesforce org limits, and data-isolation strategy.
Click Update to save, then click Run to execute the test plan.
ContextQA executes cases with the configured concurrency subject to available runner capacity. Each test case manages its own wait state independently, so a test that is waiting for a Salesforce record to save does not block other tests from proceeding.
Reading execution logs
After a test plan runs, open Run History to review results.
The run history shows the pass/fail status for every test case in the plan.
Click any test case entry to open the detailed execution log, which includes each step, its pass/fail status, and timestamps.
For failed steps, the log shows what was expected and what actually occurred. Common causes in Salesforce tests: a field was not found because of a UI change, a record was not saved before the next step attempted to read it, or test data was invalid for the target environment.
Use the timestamps to identify slow steps that might indicate Salesforce performance issues or timing problems in a specific environment. If a test is consistently failing in a particular sandbox but passing elsewhere, compare the environment configuration and data state rather than assuming a test logic error.
Generate cases from a module requirement
Choose a cloud or industry guide, supply the actual objects, roles, active rules, expected values, and rejection conditions, and generate proposed cases from that requirement. Review the steps before execution, add the appropriate login prerequisite, and parameterize run-owned data. Use hybrid UI and API assertions for saved outcomes and release readiness for sign-off.
Last updated
Was this helpful?
