The documentation for WHILE_V2 (while, endWhile - FlowControl - Selenium IDE Commands Tutorial) doesn’t demonstrate how to increment a variable. That is, it demonstrates an incremented loop only with the deprecated WHILE command.
As near as I can tell, the only way to increment a variable is to make an external call to Javascript with “executeScript_Sandbox” (such as I did in the loop below). Is that correct, there’s no way to increment natively?
{
"Name": "example",
"CreationDate": "2020-2-28",
"Commands": [
{
"Command": "store",
"Target": "1",
"Value": "k"
},
{
"Command": "while_v2",
"Target": "${k} <= 5",
"Value": ""
},
{
"Command": "echo",
"Target": "${k}",
"Value": "green"
},
{
"Command": "executeScript_Sandbox",
"Target": "return Number (${k}) + 1",
"Value": "k"
},
{
"Command": "end",
"Target": "",
"Value": ""
}
]
}