How to skip the step if the value in the csv file are empty/null(no value in the cell)

Hi Team,

for the testing process, some cells in the csv file are null, if without extra handling, the Open File window will just hang out there(as attached the screenshot), which cause the whole process failed, so it’s expected to skip the steps(with empty value) and move on to next steps.
quite new for this, how to handle this?
maybe the If - else - endIf(gotoif), or something else?
the
demo macro is:
{
“Name”: “file-upload-with-xtype”,
“CreationDate”: “2019-4-15”,
“Commands”: [
{
“Command”: “open”,
“Target”: “https://ocr.space/”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “id=imageFile”,
“Value”: “”
},
{
“Command”: “csvRead”,
“Target”: “test.csv”,
“Value”: “”
},
{
“Command”: “XType”,
“Target”: “${!COL1}”,
“Value”: “”
},
{
“Command”: “XType”,
“Target”: “${KEY_ENTER}”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “link=Start OCR!”,
“Value”: “”
}
]
}

thank you.

Exactly! You can check

  • if | "${!col1}" != "" |
  • do upload…
  • else
  • echo | field empty
  • endif
1 Like

HI I tried this

{
“Command”: “if_v2”,
“Target”: “”{!COL16}" != “” ", “Value”: “” }, { “Command”: “select”, “Target”: “xpath=//select[contains(@id,‘abc’)]”, “Value”: “label={!COL16}”
},
{
“Command”: “else”,
“Target”: “”,
“Value”: “”
},
{
“Command”: “echo”,
“Target”: “Value not changed”,
“Value”: “”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”
}

But it throws the error Internal variable “!COL16” not supported

could you please help, Thanks

Please help. Thank you so much