rookievmc
rookievmc

Reputation: 183

DataDriver not reading csv file

Not sure why its not finding my csv header variables Im using this Library I installed it https://github.com/Snooz82/robotframework-datadriver However, I keep getting error

Variable '${username}' not found.

Below is my robot file

*** Setting ***
Resource  ../../../Resources/Common.robot
Library  DataDriver  ../../../DataFiles/LoginMultipleTimes2.csv
Suite Setup  Open Browser and navigate
Suite Teardown  Close All Browsers
Test Template  CSVList

*** Variables ***
${URL} =  https://myapplogin.com

*** Test Cases ***
Login Successfully  ${username}  ${password}


*** Keywords ***

Open Browser and navigate
    I open a browser and nagivate to MyApp Login page


CSVList
    [Arguments]  ${username}  ${password}
    Input Text  id=username  ${username}
    Input Text  id=password  ${password}
    Click Button  xpath=//*[@id="signin-button"]/input

My csv file looks like this

${username},${password}
jack2,T3sT123
jack3,T3sT123

Any suggestions? I have tried putting double and single quotes around the variables. If I type in the wrong name in the Library section it gives an error so I know the file path is correct.

Upvotes: 0

Views: 416

Answers (1)

rookievmc
rookievmc

Reputation: 183

Solved the issue by adding

Library DataDriver     ../../../DataFiles/AddClients_002.csv     reader_class=csv_reader    encoding=utf_8 

and making sure I saved the file as MS DOS Comma Seperated (im using a mac).

Upvotes: 1

Related Questions