While loop only works one time


#1

When trying to do a while loop it seems to work great the first time, but if the macro plays more then one time in a row the second time it runs it fails and never runs the while loop.

</ {

“Name”: “aatr_company”,
“CreationDate”: “2018-12-7”,
“Commands”: [
{
“Command”: “type”,
“Target”: “//[@id=“object-table-__multiple”]/table[2]/thead/tr/th[1]/input",
“Value”: “on”
},
{
“Command”: “click”,
“Target”: "//
[@id=“object-table-__multiple”]/table[2]/thead/tr/th[1]/input”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “id=edit-object-list-mass-update-update-field”,
“Value”: “”
},
{
“Command”: “select”,
“Target”: “id=edit-object-list-mass-update-update-field”,
“Value”: “label=Company”
},
{
“Command”: “click”,
“Target”: “id=edit-object-list-mass-update-update”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “id=edit-company-und-0-value-text”,
“Value”: “”
},
{
“Command”: “select”,
“Target”: “id=edit-company-und-0-value-text”,
“Value”: “label=AATR ORLANDO”
},
{
“Command”: “click”,
“Target”: “id=edit-submit”,
“Value”: “”
},
{
“Command”: “pause”,
“Target”: “3000”,
“Value”: “”
},
{
“Command”: “store”,
“Target”: “true”,
“Value”: “!errorignore”
},
{
“Command”: “while”,
“Target”: “${!statusOK}”,
“Value”: “”
},
{
“Command”: “waitForVisible”,
“Target”: “id=updateprogress”,
“Value”: “”
},
{
“Command”: “endWhile”,
“Target”: “”,
“Value”: “”
}
]
} >


#2

“Command”: “while”,
“Target”: “${!statusOK}”

What is the value of {!statusOK}? Maybe it is false and that is why the loops stops?

You don’t need a while loop for “waitForVisible” - it kind of has its own build-in while loop and waits for the element to appear. If needed, you can increase the wait time with !timeout_wait.