[ ERROR ] [ DataDriver ] Error in robot file:
File “C:\Users\abc\PycharmProjects\pavan\xyz\ParamterizationTestViaCSVFIle.robot”, line 0
[ ERROR ] Calling method ‘_start_suite’ of listener ‘DataDriver’ failed: FileNotFoundError: File attribute was empty. Tried to find C:\Users\abc\Pych
armProjects\pavan\xyz\ParamterizationTestViaCSVFIle.csv but file does not exist. If no file validation is required, set file_search_strategy=None.
That’s the point. I am asking DataDriver to pick “data.csv” file from mentioned location.
ParamterizationTestViaCSVFIle.robot file which uses DataDriver Library to take data.csv inputs.
Si am surprised why it is looking for ParamterizationTestViaCSVFIle.CSV file instead for data.csv file?
I’ve seen python (and therefore robot framework) sometimes give weird intermittent file not found errors when combining paths with slashes going in different directions, which might be what you are getting here.
You gave the relative path of xyz/Resource/data.csv, but since it’s a relative path robot’s going to prefix the first part C:\Users\abc\PycharmProjects\pavan\? and you’ll end up with a path that looks like C:\Users\abc\PycharmProjects\pavan\xyz/Resource/data.csv which causes weird errors when python passes it to the windows system api.
A simple fix would be to use “windows” slashes (remember you need to escape them though:
Library DataDriver file=xyz\\Resource\\data.csv
but if you are hoping to run this test on a mixed environment that might break the tests on MacOS, Linux, etc, in which case using the path seperator from Operating-system variables might be a good idea:
The other option is just to use an absolute path with all the slashes going the same way (again this might be an issue if you need to run the test on multiple platforms)
Thanks a lot for detailed explanation and possible solution.
I tried with windows slashes (“\”) and now partially it works for me. Now robot framework/DataDriver looking for “data.csv” file at expected location.
However, now facing new issue as unable to fetch values from data.csv file and hence throwing error as “Variable ‘${username}’ not found.”.
In actual, there are 3 columns along with data in data.csv file as below, Test Cases,${username},${password}
invalid username,abc,DGTO12
invalid password,xyz,ABRE334
I recreated your robot file and data.csv file and I get the same error “Variable ‘${username}’ not found.”, I don’t know enough about DataDriver (I only just installed it to try and help you) I tried to follow the documentation to figure out what was wrong but I’m not sure
I’m getting Excel variable not found while reading data from Excel sheet. Can some one plz take a look at it pleaseeeee. It’s throwing the same error
[ ERROR ] Calling method ‘_start_suite’ of listener ‘DataDriver’ failed: FileNotFoundError: File attribute was not a full path. Tried to find C:\Use
rs\503363989\PycharmProjects\ViewIT\ViewIT..\TestData\Data.xlsx but file does not exist.
My Exact location of this Excel is : C:\Users\503363989\PycharmProjects\ViewIT\ViewIT\Testdata
can you help for accessing the data from excel: I am getting error
Calling method ‘_start_suite’ of listener ‘DataDriver’ failed: AttributeError: partially initialized module ‘pandas’ has no attribute ‘_pandas_datetime_CAPI’
Variable ‘${username_e2e}’ not found.
I am getting error Calling method ‘_start_suite’ of listener ‘DataDriver’ failed: AttributeError: partially initialized module ‘pandas’ has no attribute ‘_pandas_datetime_CAPI’
Variable ‘${username_e2e}’ not found. while using xlsx… but with same data i am able to access with csv file.
Any help would be appreciated
Library DataDriver file=${Excel_Path_e2e} sheet_name= test1