Configure optional settings
To tailor Salesforce Engine 3.0 to your needs, you can configure the following optional settings:
Disable performance optimization
By default, Tricentis Tosca uses the test configuration parameter OptimizeForSalesforce which decreases execution time by about 40% on average. This parameter is automatically set to True.
If this performance optimization causes issues, you can disable it.
To do so, create the TCP OptimizeForSalesforce on the Tosca object that you want to configure and set its value to False.
Disable Salesforce Classic objects
By default, the Salesforce Engine 3.0 displays the objects defined in Salesforce Classic as tabs in the Salesforce Module.
If you do not want to view the objects defined in Salesforce Classic, you can disable the setting Scanner include classic objects.
To do so, go to Project > Settings > TBox > Engines > XBrowser > Salesforce and change the value of the setting Scanner include classic objects to False.
Enable Salesforce Lightning objects
By default, the Salesforce Engine 3.0 hides the objects defined in Salesforce Lightning as tabs in the Salesforce Module if they're not defined in Salesforce Classic.
If you want to view the objects defined exclusively in Salesforce Lightning, you can enable the setting Scanner include lightning objects.
To do so, go to Project > Settings > TBox > Engines > XBrowser > Salesforce and change the value of the setting Scanner include lightning objects to True.
Exclude frames
To improve the performance of your Salesforce test, the Salesforce Engine 3.0 includes the frame HTML tag elements when loading the HTML DOM structure. Frame is a HTML tag element that loads another HTML page within the document. It puts another web page within the parent page.
If you want to skip the HTML tag elements in the HTML DOM structure, use the setting Exclude frames.
To do so, go to Project > Settings > TBox > Engines > XBrowser > Salesforce and change the value of the setting Exclude frames to True.
Exclude Shadow DOM
By default, the Salesforce Engine 3.0 includes the shadow-root HTML tag elements when loading the HTML DOM structure. Shadow DOM is used to encapsulate the internal DOM structure of a web component.
If you want to skip the shadow-root HTML tag elements in the HTML DOM structure, use the settings Exclude ShadowDoms and Exclude frames.
To do so, go to Project > Settings > TBox > Engines > XBrowser > Salesforce and change the value of the settings Exclude ShadowDoms and Exclude frames to True.
Disable URL-based identification
By default, the Salesforce Engine 3.0 identifies the Salesforce interface (Classic or Lightning Experience) based on the URL of the Salesforce application you scanned.
If you encounter issues due to this UI identification, you can disable it.
To do so, go to Project > Settings > TBox > Engines > XBrowser > Salesforce and change the value of the setting URL based UI type identification to False.
Ignore invisible HTML elements
To improve the performance of your Salesforce tests, you can use the Ignore invisible HTML elements setting or TCP. When you do this, XScan adds the IgnoreInvisibleHtmlElements steering parameter to your Modules and ignores invisible controls. Don't use this setting or TCP if you want to steer invisible elements in your Salesforce application.
To ignore invisible HTML elements, do one of the following:
-
If you haven't scanned your Salesforce application yet, go to Project > Settings > TBox > Engines > XBrowser and change the value of the Ignore invisible HTML elements setting to True.
-
If you've already scanned your Salesforce application, add the IgnoreInvisibleHtmlElements setting or TCP to your Salesforce TestCase or ExecutionList and set the value to True.
Access the Salesforce API if cookies are blocked
To use the ApiKey property to steer controls on Salesforce applications, you need to have access to the Salesforce API and therefore you need an API access token. Until January 2024, the API access token was downloaded from the browser of the active session of the logged in user using cookies. However, Google Chrome has restricted third-party cookies by default. Consequently, Tosca doesn't retrieve the Salesforce API token from the cookies. Note that this feature is only available if you have installed Tricentis Tosca 2023.2 Patch 3 or newer.
In Tosca, you can still access your Salesforce application and fetch the ApiKey property. You need this property to uniquely identify Salesforce controls during the scan or test execution.
To access the Salesforce API in XScan, choose one of the following options:
-
If you haven't scanned your Salesforce application yet, go to Project > Settings > TBox > Engines > XBrowser > Salesforce > Api and configure the settings Consumer Key, Consumer Secret, Password, and Username.
To retrieve Consumer Key and Consumer Secret from your Salesforce account, access the Manage Consumer Details as described in the Salesforce documentation (opens in a new tab).
-
If you've already scanned your Salesforce application or you have a TestCase with multiple different users and different credentials, add the following test configuration parameters (TCPs) to your Salesforce TestCase or ExecutionList:
TCP
Description
Mandatory
SFDCConsumerKey
Client ID of the application trying to connect to Salesforce APIs.
Yes
SFDCConsumerSecret
Client secret for authentication.
Yes
SFDCPassword
Password to sign in to Salesforce.
Yes
SFDCUsername
Username to sign in to Salesforce.
Yes
KeyVaultPath
Path to the key vault executable. You can use this TCP if you, for example, store secrets.
No
When it comes to configuring settings or adding TCPs, keep these things in mind:
-
If you have configured the settings Consumer Key, Consumer Secret, Password, and Username and later on use the TCPs SFDCConsumerKey, SFDCConsumerSecret, SFDCPassword, and SFDCUsername, the TCPs override the settings.
-
If you have incorrect values for the credentials, Tosca might either still try to fetch the ApiKey property directly from the cookies, or the TestCase might fail.