How to store and read array to CSV with column names?

I have a couple variables that should be configured by each member of the team before running the actual test suite.

Thus I crated a separate macro that:

  • csvReadArray from mxCSV into csvVars (reads a CSV that we will share amongst the team and each member will have to edit its values (like “main url” or “admin url” etc, stores it in a var)
  • store the ${csvVars[1][0]} into myURL (stores the second row first column value into the var myURL)
  • store the ${csvVars[1][1} into myOtherURL (stores the second row first column value into the var myOtherURL)

The CSV itself consist of a first row (column names) and subsequent row is the values.

How could I read off “row 1, column name ‘the_column’” instead of passing the hardcoded numeric position?

Something like ${urls[1][columnName]}… but that does not work.

It seems you are using arrays here?

${urls[1][columnName]}

Arrays need a numerical index. But maybe if columnName is a variable, this could work.