Documentation

Looking for something in particular?

Extract and Assert Salesforce Layout

Extracting a page layout

This test step extracts all fields and the master Page Layout details of a target Salesforce object into an Excel sheet.

This test step is helpful when you want to extract or check over an entire Salesforce page layout. It is typically used with the Assert Salesforce Layout test step, which compares an extracted page layout from one Salesforce org to a current page layout. This is useful for comparing page layouts between sandboxes (for example) or checking that no changes have occurred in an existing org.

The API can also be used to test field permissions of the logged-in user of a given Salesforce connection.

To use this API, locate the Extract Salesforce Layout test step in the Test Palette and click and drag it into your test case.

Update the parameters as follows.

  • Connection Name: The Salesforce Connection relating to the Salesforce org from which you want to use to extract the layout information and the user details you want to use to do it
  • Object Name: The Salesforce object whose fields and page layout need to be extracted. Refer to the Org Browser for the exact name of the object.
  • Result File: The file format in which to save the information (default is Excel Workbook)
  • Workbook: Choose the destination Excel Workbook on your local machine.  An Excel named ‘Workbook’ will be created in your Test Project Folder by default.
  • Worksheet: Leave this info blank. A new sheet named the Object will be added with the field information.  Additionally, a sheet named Master will be added containing the page layout information for that object.
  • Include Field Permissions: If checked, add a list of access permissions to each and every field on that object for all profiles in that SF org.
  • Then save the test case

Example

The screenshot above shows the use of an Extract Salesforce Layout API to extract the Page Layout and field details of the Contact object from a connected Salesforce Org identified as SFConnection.

Page layout details

Field details    

Asserting a page layout

Once you have extracted a page layout using the Extract Salesforce Layout API, you may want to check some of its information using the Assert Salesforce Layout API. This will compare a local Excel Workbook, created using the Salesforce Extract Layout API, with a live page layout in a Salesforce org. Like the Extract Layout API, the Assert Layout API will use a Connection to extract layout and field information based on the Connection user’s permissions.

Note that the format of the spreadsheets must be an exact match for the API to work effectively. This is why generating the local Excel Workbook is sensible using an Extract Salesforce Layout API test step.

To use this API, locate the Assert Salesforce Layout API in the API palette and click and drag it into your Test Case.

Complete the parameters as follows:

  • Connection Name: The Salesforce Connection relating to the Salesforce org from which you want to use to extract the live page layout information and the user details you want to use to do it
  • Object Name: The Salesforce object whose fields and page layout need to be extracted. Refer to the Org Browser for the exact name of the object.
  • Expected Layout File: The file format used by your local Layout file (default is Excel Workbook)
  • Workbook: The local destination of the Excel Workbook created by an earlier Extract Salesforce Layout API step
  • Include Field Permissions: Tick this if your local Workbook file was extracted using ‘Include Field Permissions’ ticked on the Extract Salesforce Layout API test step.
  • Then save the test case

Example

Results

The Test Step will pass if the contents of the local Workbook match with the live page layout information relating to the Connection and Object selected. If there are discrepancies, these will appear in the Test Runner and Test Run Report. Note that all discrepancies will be included along with expected and actual values.

In Test Runner

In the Test Run Report


Feedback

Was this article helpful for you?
Documentation library

Trying to raise a case with our support team?

We use cookies to better understand how our website is used so we can tailor content for you. For more information about the different cookies we use please take a look at our Privacy Policy.

Scroll to Top