Doc Bug? Use store or executeScript to set value of !ErrorIgnore

URL: UI Automation Open-Source Selenium IDE plus additional features, iMacros alternative

Find: !ErrorIgnore

Says, 'You can change back to the normal behavior at any point in the macro with

“store | false | !errorIgnore” ’
.

I would think this would not work because a string (“false”) would be understood in UI Vision RPA as boolean value true. For the same reason (a string being a boolean value true), you could use

store | true | !errorIgnore

to store “true” (a string) in !errorIgnore and see desired results.

Maybe I am incorrect. But if I am correct, then the documentation should not say to use store to set truth values. Instead, it should say to use executeScript_Sandbox, i.e.

executeScript_Sandbox | true | !errorIgnore

and

executeScript_Sandbox | true | !errorIgnore

I am interested if I misunderstood anything.

You are correct, but store | false/true | !errorignore still works, because if store is used with

  • “true”
  • “false”

and the internal variable is

  • !errorIgnore
  • !statusOK
  • !waitForVisible

then UI Vision converts the string “false” and “true” to the boolean value internally with acceptStringTrueFalse. This is the relevant source code:

switch (upperKey) {
    case '!ERRORIGNORE':
    case '!STATUSOK':
    case '!WAITFORVISIBLE':
      return acceptStringTrueFalse(val)

The snippet of Javascript indeed clarified for me what is supposed to be happening. Seems this approach makes UI Vision RPA more forgiving. Using store seems more intuitive for setting variable values than using executeScript_Sandbox.

I think this macro might prove that “false” is treated the same as false for !STATUSOK:

{
“Name”: “Try out commands”,
“CreationDate”: “2019-12-26”,
“Commands”: [
{
“Command”: “store”,
“Target”: “false”,
“Value”: “!statusok”
},
{
“Command”: “gotoIf_v2”,
“Target”: “! ${!statusok}”,
“Value”: “value true”
},
{
“Command”: “echo”,
“Target”: “Value was false”,
“Value”: “red”
},
{
“Command”: “gotoLabel”,
“Target”: “the end”,
“Value”: “”
},
{
“Command”: “label”,
“Target”: “value true”,
“Value”: “”
},
{
“Command”: “echo”,
“Target”: “Value was true”,
“Value”: “lime”
},
{
“Command”: “label”,
“Target”: “the end”,
“Value”: “”
}
]
}

When I look in the Variables tab, I see !STATUSOK == “false”, which is a string, not a boolean. When I execute the code I get “Value was false” in the Log. If !STATUSOK was really being treated as a string, I would have had “Value was true” in the Log.

I tend to be surprised when storing true and false gives me different results for different variables. Maybe good practice is to use executeScript_Sandbox instead of store?

When I look in the Variables tab, I see !STATUSOK == “false”, which is a string, not a boolean

Yeah, you are right. In 3.5.7 the conversion from string to boolean does not work for !statusOK. But the issue is already fixed in 3.5.10.

OK. I think I understand. I was not able to use Firefox because the Xmodules did not allow me to create a new macro with Storage Mode = File System.

I checked what you said about this. I’m using the Chrome extension in the Opera browser because the target website is not working with the Chrome browser. The Opera browser shows UI.Vision RPA 5.3.8. So, the variables tab shows “false” (a string) when I do
store | false | !STATUSOK

I went back to Firefox to see what you were saying. Firefox shows UI.Vision RPA 5.3.10. I did the same thing with store. But now the variables tab show false (a boolean).

So, I must say this is cool. It is just as you said, fixed in 3.5.10.

But then I realized that in Firefox I was in Storage Mode = File System. And I had just created a macro. You guys must have fixed something because creating a macro did not work before in Firefox. I tried creating a few more macros and switching back and forth in Storage Modes. I was not able to reproduce the Create macro problem. I’m using FileAccess XModule v1.0.12. I think that’s the latest version.

Thank you very much. I thought fixing the macro problem would take longer. I like when things just get better and better.

Switch to xmodules 201905 working better and ui vision 5.1.9 i use it and solved all my problems.

All other version do not work well and give more bugs (some random).