In Karate Framework, Is there a way to extract individual string (separated by comma) of a particular column in CSV file?

Viewed 1054

Following is the CSV file which I am using:

enter image description here

I want to extract individual string from "Cast" column e.g. "Zareen Khan".

My Requirement:

  1. Extract comma separated string from "Cast" column.
  2. Get its "id" from mysql DB. (select id from table_name where name = "Zareen Khan")
  3. Pass "id" in next api's Url param.

Note: Above steps will be iterative for each row in CSV file i.e. After "Zareen Khan", follow above steps for "Karan Kundra", "Tobby Hinston", "Sonia Armstrong" etc.

1 Answers

Any string is a Java string behind the scenes.

* def raw = 'foo,bar,baz'
* def array = raw.split(',')
* match array == ['foo', 'bar', 'baz']
Related