Hello All,
I have a simple K6 js script that reads through a CSV file and tries to identify the individual values. When i try to extract the values it renders unidentified for username while it is able to recognize password, What am i doing wrong here?
CSV file data:
username,password
kiru,kiru123
vasu,vasu123
Code snippet:
export default function() {
// Get the current iteration index
const index = __ITER % csvData.length;
// Get the data for the current iteration
const data = csvData[index];
// Log the data to the console
console.log('Data for current iteration:', JSON.stringify(data));
console.log('username:' , `${data.username}`);
console.log('password:' , `${data.password}`);
Output:
INFO[0000] Data for current iteration: {“username”:“kiru”,“password”:“kiru123”} source=console
INFO[0000] username: undefined source=console
INFO[0000] password: kiru123 source=console