How to set ${!statusOK} to TRUE

Hi, I’d like to know how to deal with this command:

            {
              "Command": "store",
              "Target": "${!statusOK}",
              "Value": "true"
            }

The following macro opens a page and clicks on the button Connect. If it fails I want to set ${!statusOK} to true and then the macro to look for the Connect button again in another page.

  • If the macro clicks on Connect either the first or the second time – it should echo OK
  • If the macro fails both times, then the macro should echo ERROR

However, the macro is performing as follows:

  1. If it finds the button Connect --> it echoes OK
  2. If if finds the button Connect on the second page --> it echoes ERROR but it should say OK
  3. If it doesn’t find the button --> is echoes ERROR

My issue is related to (2.). The macro echoes an error when it finds the Connect button the second time. I don’t know how I should use the previous command
{ "Command": "store", "Target": "${!statusOK}", "Value": "true" },

Macro below:

        {
          "Command": "store",
          "Target": "true",
          "Value": "!errorignore"
        },
        {
          "Command": "csvRead",
          "Target": "plantilla.csv",
          "Value": ""
        },
        {
          "Command": "open",
          "Target": "${!col10}",
          "Value": ""
        },
        {
          "Command": "click",
          "Target": "//*[text()[contains(.,'Conectar')]]",
          "Value": ""
        },
        {
          "Command": "if_v2",
          "Target": "${!statusOK} == false",
          "Value": ""
        },
        {
          "Command": "store",
          "Target": "${!statusOK}",
          "Value": "true"
        },
        {
          "Command": "open",
          "Target": "${!col5}",
          "Value": ""
        },
        {
          "Command": "click",
          "Target": "//*[text()[contains(.,'Conectar')]]",
          "Value": ""
        },
        {
          "Command": "end",
          "Target": "",
          "Value": ""
        },
        {
          "Command": "if_v2",
          "Target": "${!statusOK} == false",
          "Value": ""
        },
        {
          "Command": "echo",
          "Target": "ERROR",
          "Value": "#shownotification"
        },
        {
          "Command": "else",
          "Target": "",
          "Value": ""
        },
        {
          "Command": "echo",
          "Target": "OK",
          "Value": ""
        },
        {
          "Command": "end",
          "Target": "",
          "Value": ""
        }

Any help will be grately appreciated.

1 Like

It should be this order (RPA uses Selenium IDE syntax):

store | true | !statusOK

@ulrich thanks for your quick reply! :smiley:

I edited the command as you said store | true | !statusOK but it still echoes ERROR.

Quick additional question: Does [TRUE] in ${!statusOK} mean that it found an error?

I think I should set it to FALSE meaning that it’s not an error. It seems counter intuitive

${!statusOK} == false means it found an error.

Do you have a test macro without CSV reading for me? Then I can run it here.

Or attach the CSV file I need to run it (You can export the macro as ZIP, then it includes the CSV file!)

@ulrich just found the solution.

I was using ${!statusOK} instead of !statusOK

image

1 Like

Thanks a lot for this sample. your explanation easy to understand.

See also