Service Cloud Console Testing
Salesforce Consoles can be difficult applications to test because of their particular behavior. Provar has developed various features to overcome these complexities in Service Cloud Console testing without using code.
One characteristic of Consoles is that their behavior is ‘sticky’, that is, when you start a session in the Console, it will re-open any tabs you had open in your previous session. Provar will automatically close any existing console tabs when running a new Test Case, so that they do not interfere with the new run. You will see this in action when you run a Test Case.
Another complexity is that Console applications contain multiple layers of Tabs, each with their own iFrame. Provar handles tab switching automatically so that you only need to define the Primary Tab and Secondary Tab where the Test Steps are being performed.
If you are new to Service Cloud Console testing, this video provides a brief overview:
To start testing a console application, first ensure that your Salesforce Console App is defined in the Salesforce Connect step in the Test Case. This will ensure the Test Case is run in the Console App and not a standard Salesforce App, e.g. Sales or Call Center.
Any UI Test Step which is based on this connection will now have three new fields in its Parameters:
Console Tab Type
Primary Tab Name
Secondary Tab Name
These together define the tab in which a Test Step should be performed. They are explained below.
Console Tab Types
In testing Console Applications, the ‘Active Tab’ concept is important because Console Applications can have multiple Tabs open. Provar will generally assume that the Test Step should be executed on whatever tab is currently active, but this behavior can be changed if the test requires navigating to a different tab. This is defined in each Test Step so that Provar can execute the Test Step on the correct tab.
The Console Tab Type controls whether a Test Step should be performed on the Current Tab (i.e. the active tab on which the preceding Test Step ended), or if the Tab needs to be changed.
The Tab might need to be changed if, for example, the user needs to move from a Case tab to the parent Account to update some information. In this case, the Console Tab Type would define this as ‘Existing Tab’ and also require a Primary Tab name (and a Secondary Tab name where applicable). Other options are included for opening a new tab, or moving back to a home tab.
Console Tab Type has the following options:
- Home Tab: A home screen such as Case, Account, etc.
- Existing Tab: An existing primary or secondary tab which is already open
- New Tab: Selects the + Tab option and opens a new tab by passing a URL into the field
- Current Tab: The currently active tab
Primary Tabs and Secondary Tabs
Primary Tab and Secondary tab fields need to match the names which Salesforce has allocated to the Tabs.
These names are defaulted where possible (e.g. when Console Tab Type is ‘Current Tab’), but they will need to be defined manually when, for example, the user is navigating back to an existing tab.
Provar will use this name to navigate to the correct Tab.
This is how the fields appear in Provar:
Note that, if there is no secondary tab, ‘Secondary Tab Name’ can be left blank.
It is also possible to pass a variable into the Tab Name (for example a record ID) instead of entering a static value.
These options can also be entered into Test Builder as you map fields:
They will be defaulted where possible.
Closing Console Tabs
Console applications have a cached history which means when you log in, certain tabs and objects may already be open. To allow your tests to be reliable it is important that your tests start at a known state. In order to achieve this you can close down all existing tabs using a flag in the Salesforce connection step.
Testing Custom Console Components
Salesforce’s Custom Console Components are a useful feature of the Consoles because they help to display maximum information on a single console page while saving clicks.
Custom Console Components can be created and added to the console page layout in various locations:
Mapping these console screen components in Provar is no different from the normal procedure of mapping other elements either on a Standard Salesforce page or VF Page.
The following steps show the mapping of one such Console Component as an example:
Step 1: Right click on the element that you wish to map on the console Custom Component:
Step 2: Provide the information on the Test Builder and click ‘Add & Do’.
Once mapped, you should see the following in the Test Step in Provar Desktop:
Parameters should be defined as follows:
- Page Type: This should be ‘Console Component’ followed by the Object Name to which the Component belongs, e.g. ‘Account’
- Page Mode: This should be the section on which the action should be performed, e.g. ‘Open Cases’
- Page Object: This should be the name of the Page Object created in the Test Builder which stores the fields mapped from the Custom Component
- Tab Type: This should be defined according to the rules explained in the ‘Console Tab Types’ section above
Then save the Test Case.