Hello there, I’m experiencing a problem with UI.vision macro runstatus !StatusOK when running multiple macro’s together as part of a testsuite. In a specific situation this status seems to be wrongfully set to false for all macro’s except the first one that is part of the suite.
For example the suite contains 2 macros. Both do not get any error(no verify ignored error or any other, nothing in log), the first macro gets !StatusOK true but everything after that gets an incorrect !StatusOK false.
To be more specific the !StatusOK is incorrect when:
- Running multiple macro’s in suite through ‘Play all in folder’
- Underlying macro’s in testsuite call a different module to do a xclick/xtype
- Underlying macro’s in testsuite call a different module to do a check on the !StatusOK
A bit of background:
I have a lage project with hundreds of macro’s. A lot of them contain 100+ commands. When I run complete suites sometimes I miss the verifyerrors since those are ignored and only visible in the log. When running 10 macro’s in a suite the logging easily gets bigger then the default max amount in UI.Vision and is therefore lost. The end summary in the log of when you run multiple tests also ignores the verify errors. So there is no way of knowing if those errors occured.
I also do not want to save the log for each macro and have to open dozens of .txt files to see if there were any ignored errors.
To circumvent this what I do is: at the end of each macro I Savetoscv if the testcase was succesfull or failed based on the !StatusOK variable. This creates a neat little overview of teststatus for all the macro’s.
The test suite with which this issue can be recreated:
- ‘Test Suite 1’ contains macro’s ‘Test1’ & ‘Test2’ which are identical and give no error when run alone.
- Both macro’s go to a website and then run 2 other macro’s(Module 1 & Results) which are outside of the testsuite:
- macro ‘Module 1’ uses xclick and xtype to type a text
- macro ‘Results’ checks the variabel !StatusOK and based on the value it echoes if the testcase was succesfull or failed.
I wanted to attach the project backup to this post but as a new user this is not possible.
So I’ll give the json’s of the testmacro in the suite and the 2 macro’s which are called from there:
{
"Name": "Test1",
"CreationDate": "2025-1-8",
"Commands": [
{
"Command": "open",
"Target": "https://www.google.nl/",
"Value": "",
"Description": ""
},
{
"Command": "run",
"Target": "/Module1",
"Value": "",
"Description": ""
},
{
"Command": "run",
"Target": "/RESULTS",
"Value": "",
"Description": ""
}
]
}
{
"Name": "Module1",
"CreationDate": "2025-1-8",
"Commands": [
{
"Command": "XClick",
"Target": "xpath=//textarea",
"Value": "",
"Description": ""
},
{
"Command": "XType",
"Target": "Lorem ipsum",
"Value": "",
"Description": ""
},
{
"Command": "comment",
"Target": "type // xpath=//textarea",
"Value": "Lorem ipsum",
"Description": ""
}
]
}
{
"Name": "RESULTS",
"CreationDate": "2025-1-8",
"Commands": [
{
"Command": "if",
"Target": "${!STATUSOK}==true",
"Value": "",
"Description": ""
},
{
"Command": "echo",
"Target": "${!MACRONAME} succes",
"Value": "",
"Description": ""
},
{
"Command": "else",
"Target": "",
"Value": "",
"Description": ""
},
{
"Command": "echo",
"Target": "${!MACRONAME} failed",
"Value": "",
"Description": ""
},
{
"Command": "end",
"Target": "",
"Value": "",
"Description": ""
}
]
}