TestCase cant find variable present in testdata.csv/xls file

I’m not able to read csv testdata file. Please correct me where I’m wrong.

robot file:
Settings
Resource resource.robot
Library OperatingSystem
Library String
Library DataDriver testSheet/TestData.csv
Test Template testingCSVTestData

Suite Setup Initialize
Suite Teardown Disable

Keywords

testingCSVTestData
[Arguments] ${cl1} ${cl2}
Log To Console ${c1} → ${cl2}

Test Cases
testcase1 ${cl1} ${cl2}

#########CSV file################
${cl1};${cl2};
abc;123;
xyz; 234;

It always gives below error:

         "Variable '${c1}' not found."

I also trried same using xls >
"Library DataDriver testSheet/TestData.xls sheet=Sheet1 "

Still results are same.

Sample csv testdata file looks like:
${cl1};${cl2};
abc;123;
xyz; 234;

I also tried changing my testdatafile as below:
Test Cases;${cl1};${cl2};
;abc;123;
;xyz; 234;

I would suggest setting up one of the LSPs (RobotCode or Robot Framework Language Server) in VS Code and putting a breakpoint at the testcase, so you can check what (global) variables are available after imports. This allows you to check whether or not loading from the CSV works and yields the variables as expected.

Hi Robin,
I guess I figured out the issue. Datadriver library is missing in my installation but since line: “Library Datadriver” was not giving any error , I got confused. That’s why my xls/csv variables ${cl1} are not know to my robot testcases.
Is there easy way to copy paste to get Datadriver Library dependency resolve, as I can’t easily install (run pip ) on my office system?

Hi,

Have you solved this problem and if so, how? I believe, I’m experiencing something similar, if not the same issue.
https://forum.robotframework.org/t/datadriver-powered-test-returns-test-cannot-be-empty-error/
But in my case, pip says that robotframework-datadriver is installed. So I’m really curious about your solution of the problem.