Set up TrueTest in Salesforce CRM
In Salesforce CRM Lightning, you cannot directly call TrueTest via the code snippet. Instead, you need to call TrueTest through a JavaScript file stored in Static Resources. The Lightning page acts as the AUT, where the code snippet tracks user actions for TrueTest to generate corresponding test artifacts.
This guide shows you how to configure TrueTest in Salesforce CRM and verify that it works.
Security configurations
You need to configure security settings to allow the code snippet to run on the Lightning page. Go to the Setup Menu and select Setup.

CORS (Cross-Origin Resource Sharing): In the Setup page, go to Security → CORS and add
https://*.katalon.com
to the Allowed Origins List. This will allow Katalon domains to communicate with your Salesforce page.CSP (Content Security Policy): In the Setup page, go to Security → Trusted URLs and add
https://*.katalon.com
as a Trusted URL.
Create a JavaScript resource
Write a JavaScript file to trigger the Agent and upload it to Static Resources.
- Create a JavaScript file
katalonAgent.js
with the content below, ensure to add your client code atclientCode=<your client code>
:
console.log('[Katalon] Append Traffic Agent scripts, AI');
const katalonTrafficAgent = document.createElement('script');
katalonTrafficAgent.async = true;
katalonTrafficAgent.defer = true;
katalonTrafficAgent.src = 'https://static.katalon.com/libs/traffic-agent/v1/traffic-agent.min.js?clientCode=<your client code>';
katalonTrafficAgent.id = 'katalonTrafficAgent'
document.head.appendChild(katalonTrafficAgent);
Go to Setup → Custom Code → Static Resources and create New.
Upload your
katalonAgent.js
file as a new static resource.
Execute the JavaScript resource from Lightning components
Call the uploaded JavaScript resource within your Lightning components.
- Go to Setup → Developer Console.
- Go to File > Open Lightning Resources and select TrueTest component.
- Add the following line to your component’s markup:
<ltng:require scripts="{!$Resource.TrueTest}" />

Verify the integration
Go to the Lightning page and open the Network tab of the developer tool to ensure the data is sent to Katalon server.

If no data is captured, check the Console tab for errors.
