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

data-driven-testing
xmodules
csv

#1

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.


#2

Exactly! You can check

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