Rescan Salesforce Modules

If you modify your Salesforce instance during or after the scanning process, you can update your Salesforce Scan-generated Modules by rescanning them.

Prerequisites

You have to meet the following prerequisites to use the Salesforce rescan function:

  • You have created your Modules with the Salesforce Scan. The Salesforce rescan doesn't work on Modules that you created with Tosca XScan.

  • You haven't manually modified the Modules. The Salesforce rescan doesn't work on Modules that you modified in Tosca Commander after scanning.

  • You have valid Salesforce credentials.

  • You have the necessary permissions for your Salesforce instance.

    You need the following profile and permission to read and access metadata API calls from the Salesforce SOAP API: API Enabled and Modify All Data.

  • The computer on which you run Tricentis Tosca is within the trusted IP range. If it isn't, you need a valid Salesforce security token.

Tricentis recommends to use an administrator profile for the rescan. This provides the following advantages:

  • Gives you the access to a superset of Modules that you need to start building your tests.

  • Allows you to verify data security across Profile and Permission set subsets, for example, you can validate that a user cannot see a field.

  • Ensures a high level of Module re-usability across the Org.

If you use a non-Administrator profile, you can only retrieve Modules that you have access to. This can result in missing fields and tabs needed to complete the TestCases.

Don't modify the SalesforceScannerId or the name of the Salesforce Scan Modules and ModuleAttributes. The Salesforce Scan identifies objects based on their name and SalesforceScannerId during a rescan. If you modify them, the rescan won't work on those objects.

Rescan Modules with Salesforce Scan

To rescan Modules created with the Salesforce Scan, follow the steps below:

  1. In Tosca Commander, go to the Modules ribbon menu and select Scan->More->Salesforce Scan.

    Alternatively, right-click on any of the Modules that you want to rescan and select Scan->More->Salesforce Scan from the context menu.

  1. In the Salesforce Credentials window, enter the following information:

Field

Description

User

Enter your Salesforce username.

Password

Enter your Salesforce password.

Security token (optional)

Enter your Salesforce security token.

This parameter is optional if your computer is within the trusted IP range.

Environment

Select Production or Test depending on which environment you want to scan.

Enter Salesforce credentials

  1. Click OK.

  2. In the Select Modules window, select the Salesforce objects that you want to include in your rescan. If you want to rescan all Modules, select Select All.

Select Modules to rescan

  1. Click Scan to rescan the Modules you selected.

The Salesforce Engine 3.0 performs the following actions:

See the results of a rescan

Use TQL queries to see the changes after a rescan.

Updated ModuleAttributes

To search for all ModuleAttributes that were updated during the rescan, use the following TQL query:

=>SUBPARTS:XModule->SUBPARTS:XModuleAttribute->XParams[(Name=?"SalesforceScannerLastChangeType") AND (Value=?"Updated")]=>SUPERPART:XModuleAttribute

Newly created ModuleAttributes

If an object didn't exist in your Salesforce application prior to the rescan, the Salesforce Scan creates it as a new ModuleAttribute during the rescan.

To search for all ModuleAttributes that were created during the rescan, use the following TQL query:

=>SUBPARTS:XModule->SUBPARTS:XModuleAttribute->XParams[(Name=?"SalesforceScannerLastChangeType") AND (Value=?"Created")]=>SUPERPART:XModuleAttribute

Deprecated ModuleAttributes

If the Module you rescan contains a control that you have removed from your Salesforce application, the rescan marks the ModuleAttributes as Deprecated.

To search for Deprecated ModuleAttributes, use the following TQL query:

=>SUBPARTS:XModule->SUBPARTS:XModuleAttribute->XParams[(Name=?"SalesforceScannerLastChangeType") AND (Value=?"Deprecated")]=>SUPERPART:XModuleAttribute

If you reintroduce a control that you previously removed with the same properties to the same Salesforce application and you didn't remove the deprecated ModuleAttribute from your Module, the rescan marks the previously Deprecated ModuleAttribute as Unchanged.

Modules and ModuleAttributes

To search for all Modules, use the following TQL query:

=>SUBPARTS:XModule

To search for all ModuleAttributes, i.e, the Tosca objects that represent your controls, use the following TQL query:

=>SUBPARTS:XModule->SUBPARTS:XModuleAttribute

Manage ModuleAttributes with irregular names

Your old Modules might contain ModuleAttributes with _1 added to the end of the name, for example, View_1. When you rescan these ModuleAttributes, the Salesforce Scan marks them as Deprecated and creates a new ModuleAttribute for the same Salesforce object. During later rescans, the Salesforce Scan will update this new ModuleAttribute.

To use your original ModuleAttributes, you have to rename them and delete the _1 from their name before you first rescan them. To do so, follow the steps below:

  1. Use the following TQL query to find the affected ModuleAttributes: =>SUBPARTS:XModuleAttribute[Name=?"_1"]

  2. Select all results and right-click them, then select Modify->Name from the context menu.

  3. In the Module attribute: Name dialog, select the Use Regular Expression check-box.

  4. Enter _1 into the Search for field.

  5. Leave the Replace with field empty.

Modify ModuleAttributes

  1. Click Modify All.

Alternatively, you can rename the ModuleAttributes manually.

Manage manually modified Salesforce Modules

You can't rescan Salesforce Modules if you manually modified them. For example, if you edited a control.

To prevent problems during a rescan, move the modified Modules out of the root folder or the folder from which you want to initiate the rescan.

Manage extended Modules

If you extend a Salesforce Module with XScan items but don't make any other changes to the Module, you can rescan it. In this case, your manual additions have Deprecated as the value of the SalesforceScannerLastChangeType property.