Please help on Katalon Recorder Data-Driven using CSV

Hi folks,

refer to : https://forum.katalon.com/discussion/7566/data-driven-test-case

I’ve tried the same way to upload CSV file (correct format) but unable to get value from the CSV file

my command is like

loadVars | COJData.csv |

open| http://website.com/admin

type|name=username|$Username

type|name=password|$Password

Please help me out how to get value from CSV file in order to use in test case

Hello J,
welcome in the Katalon community.

Try this

loadVars  | COJData.csv |
open| http://website.com/admin
type|name=username|${Username}
type|name=password|${Password}

Best regards
Stefan

Hi,

Stefan is right, you have to use your variables like ${var} not $var, but there is also command named “endLoadVars” so i assume that you have to use it as well after typing everything from this file to the page.

I personally never used loadVars/endLoadVars instead i use storeCsv command so it looks like:

open|https://www.site.com|
storeCsv|yourFile.csv,0,login|login
storeCsv|yourFile.csv,0,password|password
type|name=username|${login}
type|name=userpassword|${password}

In storeCsv command you first type name of the file than line number (in that case 0) BUT be aware that it’s count from 0 but the 0 line for him is the second line in your file because Katalon don’t count first line of file which contains names of the columns, than after another “,” you type name of the column. So for the above example your “yourFile.csv” file should look like this:

login,password
YourLoginHere,YourPasswordHere

Hope that helps you :slight_smile:.

3 Likes

Thanks Piotr. It helped me!

1 Like

Open Katalon Recorder, click on Open test suite > navigate to the location of the unzipped project and select the project to open. Katalon Recorder will open the Sample Project as shown below. Click on Test Data and add data files “data. csv” (for CSV) and "data.

1 Like