Creating a Salesforce test
Salesforce tests connect to your connected Salesforce environment and carry out the user journey that you would like to test. The test includes a series of Steps, each representing another interaction with the Salesforce application.
Types of Steps
There are two ways to add steps to tests:
- Manually adding steps - you can add steps manually. The steps are organized in the following categories:
- Salesforce steps - steps that are specific to the Salesforce application usage. Salesforce steps are deeply integrated into the Salesforce application, enabling the performance of multiple actions within a single step and/or the ability to display and configure Salesforce objects, such as forms, within Testim for Salesforce application. For more information, see Salesforce Steps
- Predefined steps - general steps that are related to the testing of a web application. For more information, see Manual Steps
- Shared steps - steps that are shared between multiple tests within a certain Project. For more information, see Shared Steps.
- Recording steps - after clicking the Record button, a browser opens displaying the Salesforce application (which is the base URL). Every interaction, such as every input, click, etc., is automatically turned into a step in the test. Recording of steps is useful also in cases when the Salesforce steps cannot be used due to extensive customizations done in the Salesforce environment.
It is possible to combine the two methods - adding some of the steps manually and then recording additional steps, and vice versa.
Setup Step
The first step of the test is the Setup Step. This step defines the Base URL of the test. By default, this URL will be one of the generic URLs of the Salesforce homepage (https://login.salesforce.com or https://test.salesforce.com), depending on the first environment you connect. You should not need to modify this as the Log in step will take you directly to the environment you have configured for the branch you are on.
Selecting a Persona
In the Personas screen (see example below), you can configure for each persona (rows), different login credentials for each environment (columns). When you create a Salesforce test, you can select any persona defined by you in the Salesforce Login step. This persona has a login credentials configured for the environment in which the test was first created. However, if at some point you want to change the environment of this test (see Changing the Salesforce Environment of a branch) you will not need to select different login credentials in the Login step, because the system automatically allocates the relevant credentials for the newly selected environment based on the Personas screen configuration. So there is no need to re-write the test when you want to use a different environment.
Prerequisites:
- Download and install the Testim Extension - Why do you need Testim extension?
- Connect your Salesforce test environment to Testim/TTA for Salesforce.
- Create a persona.
Creating a Salesforce test
To create a new test:
- In your Testim for Salesforce account, go to Settings > Salesforce and click New test in the top right corner of the screen.
A new test is displayed with the default Setup Step. - You can modify the step's properties by clicking the Show Properties icon and then editing the desired setting in the Properties Panel.
The Setup Step includes the following properties:
Parameter | Description | |
---|---|---|
Base URL | By default, this URL will be one of the generic URLs of the Salesforce homepage (https://login.salesforce.com or https://test.salesforce.com), depending on the first environment you connect. You should not need to modify this as the Log in step will take you directly to the environment you have configured for the branch you are on. | |
Test name | Enter a name for the test. By default, the test is saved as 'untitled test'. | |
Test description | Enter an optional description for the test. | |
Test owner | By default the test owner is the user that created the test. Click to optionally select a different user from the list. | |
Mock network | Testim offers the ability to mock network traffic of the Application Under Test (AUT) as part of a test. During the test run, instead of performing real calls, the system will intercept the call and will return a mocked response. For more information, see Mock Network Responses. | |
Salesforce options | Enable the Log screenshots option if you want to include screenshots of steps in the Salesforce Log. This is only available for Salesforce steps, which perform multiple actions in a single step. The screenshots of Salesforce Steps include all the various actions of the step. To view the Salesforce Log, after running the test, click on the step's View Screenshot button and then click the Salesforce Log tab. For performance reasons it is not recommended to enable this feature unless needed. | |
Configuration | A test’s configuration determines the system specifications used to run the test. If you want to change the test configuration, click Choose Other to select an existing test configuration or click the Edit button to create a new one. For more information, see Test Configuration | |
Test in TTM for Jira | Tricentis Test Management (TTM) for Jira is an end-to-end test management inside Jira that keeps QA and development aligned, which allows you to collaborate and build quality into your software from idea to production. For more information, see TTM for Jira Integration | |
Test Data | The Test Data is used for data-driven testing. For more information, see Configuring a Data-driven Test From The Visual Editor. |
Adding Manual Steps
Manual steps can be either Salesforce steps, Predefined steps, or shared steps.
To add a step manually:
- After the Setup step, hover your mouse on the + button.
- Click the Add Steps button.
- Click the desired tab - Salesforce steps, Predefined steps, or Shared steps.
- To search for a step, start typing its name in the search box to narrow the list.
- Click the desired step from the list.
If it is a Salesforce step, the Properties pane is displayed on the right. The pane includes two tabs:
Object - displays the Salesforce object properties for the step. These properties may include mandatory properties that require configuration.
Properties - displays additional optional properties related to the behavior of the step.
Best Practice - Variable Naming Convention
To automate the deletion of Records created during the execution of a testcase or suite, when creating variables in the test, follow the instructions in Best Practice - Variable Naming Convention for Easy Cleanup.
Recording Steps
The Recorder can be used to add steps automatically, while interacting with the AUT (Application Under Test). This method is especially useful when adding specific steps that are not included in the Salesforce steps and/or a case where the environment is highly customized, so that the Salesforce steps are not supported. The recorder offers two modes of operation:
-
Salesforce mode - in this mode, which is indicated by a cloud icon on the recorder (see below), the recorder performs Salesforce steps, which enable the performance of multiple actions within a single step. This mode may not work if your Salesforce environment has been widely customized. In such cases, it is possible to fall back to the Web mode and record all the individual actions/steps. The steps created using this mode are marked with a cloud icon (see below). To revert to Web mode, click the cloud icon on the recorder.
-
Web mode - this is the regular mode of the recorder, which is indicated by a crossed out cloud icon on the recorder (see below). In this mode every interaction (e.g., click, scroll, add text, etc.) is represented by a separate step. To revert to Salesforce mode, click the cloud icon on the recorder.
When you should turn off Salesforce mode
If you notice that the recorded steps are not appearing in the editor, you should turn off Salesforce mode by clicking on the cloud icon.
To record steps using the Recorder:
-
Before you begin, make sure your Salesforce environment is connected. For more information, see Connecting your Salesforce environment.
-
Add a Log in step to your test.
-
Run the test so you are logged-in to the environment to be able to record additional steps.
-
In the test, hover your mouse on the + button next to the desired step and click the Record button. The recorder is automatically enabled in Salesforce Mode, which is indicated by the blue cloud icon. This means that the interactions with the application generate Salesforce steps, wherever relevant.
-
Interact with the Salesforce application to generate steps. The Salesforce steps are indicated with the cloud icon.
-
When done creating the test, click Save.
Updated about 1 month ago