This action finds and selects a matching element given a selector and a text to search for. The following arguments must be given:
- Selector: A selector that selects the elements in which to run the search. Only the matching element, if any, will be selected. A gatherer can also be given, so that it searches on the gathered value instead of on the element's text.
- Search Text: The text to search for. Other than the letter case and leading/trailing spaces, the search text must be an exact match.
It is recommended to import this premade from the Wizard menu, but it can be manually imported by following these instructions, and then replacing the selector placeholder with a selector, and a gatherer if needed:
As an example, suppose I entered FindCategory as the global name, and as the selector/gatherer combination I chose a selector called Categories and the Gather.Text gatherer. Finally, for the Search Text parameter I entered Appliances, such that the resulting code looks like this:
Code: Select all
invoke function (selector) function (searchText) Sequence.First · selector as value Browser.EvalScript · "return argument.trim().toUpperCase() == argument.trim().toUpperCase() ? [argument] : ;" · list · value · searchText · [selector]
This would find the particular category whose text is Appliances and select it, and if I add an action below, such as a Browser.Navigate action, this action would run on this particular element, which would cause it to navigate through the Appliaces category.
Code: Select all
FindCategory · "Appliances"
Then, I could reuse it elsewhere from the Wizard menu with a different search text, in order to select any specific category and perhaps navigate through it.