Please help on Katalon Recorder Data-Driven using CSV


#1

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


#2

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


#3

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:.


How to run same test cases in different URL?