Browser Extension

When you write a test for a Salesforce application page, it's often confusing to know which page objects (POs) to use. To make this page object selection process easier, use UTAM's browser extension for Google Chrome. It presents you with the appropriate set of POs for the page that you're currently browsing, and identifies which page elements are affected by the methods in a selected PO.

For a quick introduction to the browser extension, watch this video.

Workflow for Browser Extension

This section shows you how to use the browser extension.

Step 1: Install Browser Extension

Install the UTAM browser extension from the Chrome Web Store.

Note: Currently, we have a browser extension for Chrome only. We're considering support for other browsers in the future.

After installation, you can see the extension in your browser's toolbar.

UTAM browser extension in the toolbar

Step 2: Download Page Object Artifact

The browser extension reads UTAM POs contained in an artifact downloaded from an artifact repository. An artifact is either a zip file (.zip, .jar) or a gzipped tar file (.tar.gz, .tgz).

Prerequisite: The browser extension doesn't automatically download these artifacts. Before you can use the browser extension, you must obtain an artifact as a prerequisite step.

Get UTAM POs from an artifact published to Maven Central Repository or NPM.

To get the artifact for JavaScript page objects, run this command from the command line:

npm pack salesforce-pageobjects

This command downloads a gzipped tar file of the artifact to the current directory.

For more information about the PO artifacts for Java and JavaScript, see Downloads.

Step 3: Load Page Objects into the Browser Extension

After you install the browser extension, load the page objects that you previously downloaded in the artifact.

  1. In your browser's toolbar, open the browser extension.
  2. To import the POs from the downloaded artifact, click the Import button.

Import POs from the artifact

  1. Navigate to the folder where you downloaded the PO artifact and click Open. A confirmation message indicates how many POs were loaded from the artifact.

POs loaded message

  1. Click OK.

Step 4: Identify Page Objects for a Web Page

To use the browser extension on a page to be tested:

  1. Open your browser's developer tools and select the UTAM tab.

Select UTAM tab in developer tools

  1. To search for POs that you can use to test the current page, click the Find Root Page Object button. The Available Page Objects section shows the list of POs.

  2. Hover over a PO in the list to see an outline in the browser window for the element represented by the PO.

Hover over a PO

  1. Hover over a method on the PO to see an outline in the browser window for the elements represented by those methods. Click the method to add it to the Selected methods list.

Hover over a method

  1. After you've selected all the methods of interest, select a radio button for Java or JavaScript and click the Copy Selected Code button. The code to access the selected PO methods is copied to the clipboard.

Copy the selected code

  1. Paste the code into a UTAM test in your IDE of choice. In this example, the copied JavaScript code is:
await utam.load(RecordHomeWithSubheaderTemplateDesktop).getHighlights();