Steer the Salesforce global search field

This chapter describes how to steer the global search field in your Salesforce application.

The global search consists of the following elements based on the Salesforce interface you use:

  • A search field. This is available in both Salesforce Classic and Salesforce Lightning Experience.

  • A drop-down menu which lets you limit the search to a specific area. This is only available in Salesforce Lightning Experience.

Steer the search drop-down menu

This drop-down is only available in Salesforce Lightning Experience. It allows you to limit your search to a specific area. For example, if you select Contacts, Salesforce Lightning Experience searches only your contacts for the search term that you specified.

Global search drop-down menu in Salesforce Lightning Experience

Salesforce Lightning Experience identifies this drop-down menu as a ComboBox. You can scan and steer this control as a standard ComboBox control.

Steer the search field

In both Salesforce Lightning Experience and Salesforce Classic, Tosca XScan identifies the global search field as a special text box control.

Unlike a standard text box control, this special text box control automatically initiates the search for the input text. Therefore, you don't have to specify a separate action in your TestCase for pressing ENTER or clicking the search icon to trigger the search.

In this example, you search for Smith. Since you use Salesforce Lightning Experience, you have access to the drop-down menu. You want to limit the search to your contacts.

  1. You select Contacts in the Value field for Search by object type ComboBox and set the ActionMode to Input.

  2. You enter Smith into the Search text box Value field and set the ActionMode to Input.

Search for keyword Smith in Contacts

Uniquely identify the global search field in Salesforce Classic

In Salesforce Classic, the global search field is a unique control on the application header on the Home page. However, if you trigger a search, Salesforce Classic lists your search results on a separate Search Results page.

The Search Results page also contains a global search field. Consequently, Tosca XScan generates two Search text box controls for the Search Results page:

  • One for the search field in the header.

  • One for the search field on the Search Results page.

Double search field in Salesforce Classic

As both controls have the same value for the property AssociatedLabel, they are not unique.

To make both controls unique, identify them by index.

Identify Search textbox controls by index to make them unique