Skip to main content

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.

Go to Setup page
  • CORS (Cross-Origin Resource Sharing): In the Setup page, go to SecurityCORS and add https://*.katalon.com to the Allowed Origins List. This will allow Katalon domains to communicate with your Salesforce page.

    Add Katalon to Allow Origins ListAllow Katalon origin
  • CSP (Content Security Policy): In the Setup page, go to SecurityTrusted URLs and add https://*.katalon.com as a Trusted URL.

    Add Katalon as trusted URLAdd Katalon as trusted URL

Create a JavaScript resource

Write a JavaScript file to trigger the Agent and upload it to Static Resources.

  1. Create a JavaScript file katalonAgent.js with the content below, ensure to add your client code at clientCode=<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);
  1. Go to SetupCustom CodeStatic Resources and create New.

    Go to Static Resources
  2. 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.

  1. Go to SetupDeveloper Console.
  2. Go to File > Open Lightning Resources and select TrueTest component.
  3. Add the following line to your component’s markup:
<ltng:require scripts="{!$Resource.TrueTest}" />
Add TrueTest script to the component

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.

Verify the integration works

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

View Console tab for errors
Was this page helpful?