Can't understand !IfError in click

I created 2 macros:

  1. The first one looks for the text ‘Connect’
  2. The second looks for the text ‘Send message’

Both of the work well independently one from the other.

Now I’d like to merge both of them using [if_error] and let the macro continue even in case that it fails at some point of the macro.

How should I deal with this issue? I read the documentation but couldn’t make it work.

    {
          "Command": "click",
          "Target": "//*[text()[contains(.,'Connect')]]",
          "Value": ""
        },


. >>>>>>>>>    if it fails to find the button "Connect" then jump to CONDITION-2 and… <<<<<<<<< 


{
          "Command": "type",
          "Target": "id=custom-message",
          "Value": "my-message-1"
        },


**CONDITION-2**


    {
              "Command": "click",
              "Target": "//*[text()[contains(.,'Send message')]]",
              "Value": ""
            },
                    {
              "Command": "type",
              "Target": "id=custom-message",
              "Value": "my-message-2"
            },

The solution is more simple use a better xpath, you used a generic xpath.

Some button can change text or are dynamic in these case you must study the best xpath to bypass the variation.

Every macro need to choice best xpath, ui vision record 10% of available xpath only, sometimes need to search a good xpath to create a best macro code.

Store | true | !errorignore

1 Like

Good suggestion but a good macro code can not fails in never case, when a macro code fails there is a bad macro code/xpath

A good macro code must work and never show errors.