While loop giving me issues

in the below scenario:

{
  "Name": "Compliance Status",
  "CreationDate": "2022-3-22",
  "Commands": [
    {
      "Command": "label",
      "Target": "Repeat",
      "Value": "",
      "Description": "reconcile"
    },
    {
      "Command": "open",
      "Target": "https://secure.sarsefiling.co.za/app/login",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "true",
      "Value": "!errorignore",
      "Description": "reconcile"
    },
    {
      "Command": "type",
      "Target": "/html/body/app-root/app-login/div/div[2]/div[2]/mat-card/form/mat-card-content/mat-form-field/div/div[1]/div/input",
      "Value": "xxxxxxxx",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "/html/body/app-root/app-login/div/div[2]/div[2]/mat-card/form/mat-card-content/div[2]/div[4]/div/button",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "2000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "/html/body/app-root/app-password/div/div[2]/div[2]/mat-card/form/mat-card-content/mat-form-field/div/div[1]/div/input",
      "Value": "xxxxxxxx",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "/html/body/app-root/app-password/div/div[2]/div[2]/mat-card/form/mat-card-content/div[2]/div[4]/div/button",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "2000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "visualVerify",
      "Target": "tax_dpi_96.png",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "times",
      "Target": "199",
      "Value": "",
      "Description": "reconcile"
    },
    {
      "Command": "store",
      "Target": "1",
      "Value": "i",
      "Description": "reconcile"
    },
    {
      "Command": "while_v2",
      "Target": "${i} <6",
      "Value": "",
      "Description": "reconcile"
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return Number (${i}) +1;",
      "Value": "R",
      "Description": "reconcile"
    },
    {
      "Command": "storeText",
      "Target": "/html/body/app-root/app-sidenavbar/mat-sidenav-container/mat-sidenav-content/app-organization/div/app-tax-payer-table/div/mat-card/mat-card-content/form[2]/div/div[${R}]/div/div[1]/p",
      "Value": "name",
      "Description": "reconcile"
    },
    {
      "Command": "click",
      "Target": "/html/body/app-root/app-sidenavbar/mat-sidenav-container/mat-sidenav-content/app-organization/div/app-tax-payer-table/div/mat-card/mat-card-content/form[2]/div/div[${R}]/div/div[7]/button",
      "Value": "",
      "Description": "reconcile"
    },
    {
      "Command": "pause",
      "Target": "3000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "/html/body/app-root/app-sidenavbar/mat-sidenav-container/mat-sidenav-content/app-individual/div/div[1]/div/mat-card/div/div/button[2]/i/img",
      "Value": "",
      "Description": "reconcile"
    },
    {
      "Command": "pause",
      "Target": "2000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "1",
      "Value": "!timeout_wait",
      "Description": ""
    },
    {
      "Command": "visualSearch",
      "Target": "registration_dpi_96.png@1",
      "Value": "registration",
      "Description": ""
    },
    {
      "Command": "visualSearch",
      "Target": "submission_dpi_96.png@1",
      "Value": "submission",
      "Description": ""
    },
    {
      "Command": "visualSearch",
      "Target": "debt_dpi_96.png@1",
      "Value": "debt",
      "Description": ""
    },
    {
      "Command": "visualSearch",
      "Target": "documents_dpi_96.png@0.8",
      "Value": "documents",
      "Description": ""
    },
    {
      "Command": "if_v2",
      "Target": "${registration} == 0 || ${submission} == 0 || ${debt} == 0 || ${documents} == 0",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "captureEntirePageScreenshot",
      "Target": "Tax Status-${name}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "localStorageExport",
      "Target": "Tax Status-${name}.png",
      "Value": "#DeleteAfterExport",
      "Description": ""
    },
    {
      "Command": "open",
      "Target": "https://mail.google.com/mail/u/0/#inbox?compose=new",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "30",
      "Value": "!timeout_wait",
      "Description": ""
    },
    {
      "Command": "visualVerify",
      "Target": "email2_dpi_96.png",
      "Value": "emailavailable",
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "3000",
      "Value": "emailavailable",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "tax@cfo360.co.za${KEY_ENTER}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_TAB}Tax Status for ${name}${KEY_TAB}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "1000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "There is a issue with the tax status for  ${name}. see attached",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "1000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_TAB}${KEY_TAB}${KEY_TAB}${KEY_ENTER}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "2000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "\"Tax Status-${name}.png\" ${KEY_ENTER}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_TAB}${KEY_ENTER}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "20",
      "Value": "!timeout_wait",
      "Description": ""
    },
    {
      "Command": "visualVerify",
      "Target": "emailsent_dpi_96.png",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "5000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "gotoLabel",
      "Target": "Repeat",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "else",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "gotoLabel",
      "Target": "Repeat",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    }
  ]
}

it doesnt appear that it wants to loop through and increment by one everytime, it insteads remains as 1 when looping, any ideas?

{
“Command”: “while_v2”,
“Target”: “${i} <6”,
“Value”: “”,
“Description”: “reconcile”
},
{
“Command”: “executeScript_Sandbox”,
“Target”: “return Number (${i}) +1;”,
“Value”: “R”,
“Description”: “reconcile”
},

value should be “i”

did the same issue if that is an “i”, and just to clarify, is it actually required? I have a different scenario where it users the letter “r” instead of “i” due to there being two whiles in the scenario, and it runs without issue.

this appears to be a user not knowing what he is doing, I was under the impression a while command needed to be told when to return via a label command. seerms this is not the case.

1 Like