Data Driver unable to read csv file in Robot Framework, returns empty dictionary

Installed version
Robot Framework 7.0.1
Python 3.12.4
robotframework-datadriver==1.11.1

Worked fine with below versions
Working version
Robot Framework 7.0.1
Python 3.12.4
robotframework-datadriver==1.6.1

Code Snippet:
Sanity.robot
******* Settings ***
Library SeleniumLibrary
Resource ${EXECDIR}${/}TestData/data_driven_keywords_Billing.robot
Library DataDriver ${EXECDIR}${/}TestData/TestData.csv dialect=Excel-EU reader_class=csv_reader encoding=utf_8
Library SSHLibrary
Library OperatingSystem
Library String
Library BuiltIn
Library RequestsLibrary
Library JSONLibrary
Library RequestsLibrary
Library CSVLibrary

*** Variables ***
${setupFilePath} Resources/Billing/SetupFiles/${configFile}

*** Keywords ***
Execute Billing Scenario
[Arguments] ${DataDriver_TEST_DATA}
log to console ${DataDriver_TEST_DATA}
${arguments}= Get Value From Dictionary ${DataDriver_TEST_DATA} arguments
${setupFileDetails}= load json from file ${setupFilePath}
Execute API scenario ${arguments} ${setupFileDetails}

*** Test Cases ***
Billing Account Regression Test
[Tags] Billing
[Documentation]
[Template] Execute Billing Scenario

TestData.csv
[Tags];${HttpRequestType};${AccID};${postPayload}
Sanity;POST;454545;postpayload.json
Sanity;POST;454546;postpayload.json
Sanity;POST;454547;postpayload.json

Could you please suggest how to make that work with latest data driver as well ? Every time I have to downgrade to make this work.

1 Like

I am not experienced user of DataDriver, but I tried to reproduce your case. The first problem reported, is that the Test Case does not have any content (missing a step).
See documentation at robotframework-datadriver · PyPI.

Anyway, I attach my best example (which is false positive, but runs for each data row):
Processing: Test_Billing.robot…
data_driven_keywords_Billing.resource (199 Bytes)
TestData.csv._rename_me.robot (162 Bytes)

1 Like

Hello @HelioGuilherme66 ,

Above code works fine with older version of data driver, but not working with latest.

And Test cases have template action " Execute Billing Scenario" which calls above keyword defined.

Flow is working only issue is not working with latest driver. Thanks though for putting your time.


What I can say, is that the documentation always considers the test data to start with the Test Name. Here we see the use of &{DataDriver_TEST_DATA}.
Maybe you don’t need to use DataDriver, if you don’t want to create test cases, but use Template (original way).
About the differences in versions of the library, you should consult the changelog.
Also, @René may want to say a word about this :slight_smile:

2 Likes

Earlier i was using in below format


then it stopped working with &{DataDriver_TEST_DATA} then i switched to ${DataDriver_TEST_DATA} and It started working. Now it is stick to older version , does work with latest driver version. I am okay as long as it works on my system ,but if someone have upgraded data driver in my team they won’t be able to execute test cases which i have automated. or may be they need to stick to same version of data driver what i am using.
Just wanted to make it compatible for all newer versions as well