CST Autocomplete searches, dynamic dropdowns, and as-you-type filters

Updated 3 months ago by CST

Javascript autocomplete/search-as-you-type text fields is sometimes tricky, due to lack of standards. The type command "writes" the whole text at once, not typing each key as a human would, and unpredictable delays between the typing and the results "showing up" are challenging as well.

To help overcome this, the typeKeys command is handy... it is like type, but it actually simulates typing each character of the value, and waiting a few moments in between.

Also, a judicious wait of a few seconds (pause 2000) right after typeKeys would help with a slower search before clicking an item (we do retry several times in case a locator is not found, with copadoSetRetries but sometimes that is not enough).

commandparameter 1parameter 2result
typeKeyscopado=field:SearchSan Fran[success]
clickcopado=link:San Francisco[success]

How did we do?