Using Type for VisualSearch

There’s been plenty of discussions about how to work with dynamic element/button/field names, and the recommendations are either to use “contains” for a partial match or use VisualSearch. I am down to using VisualSearch at this point because contains isn’t helping (the names are too uniform on Azure management portal).

I am trying to find a form field and type an entry into it, but I am not sure how to do that. There’s documentation on how to use ClickAt after VisualSearch, but not Type command. And it’s not working for me, since Type command requeres element name, not an X/Y location… How do I do this?

The solution is to use the #efp command after the image search. It gets the element name from the x/y coordinates. And this element locator works with all commands that take a locator as input (click, type, storetext,…)

In the screenshot below you see a basic example that works with our contact form:

When you create the image make sure the center of the image is on the input box, because the x/y of the image center is used to get the element locator - and you want the locator of the input box, not of the text next to the box.