lundi 12 avril 2021

Karate : In my CSV file, columns are not having same row count. While reading data empty values are added for columns having less rows

My csv file data : 1 column is HeaderText(6 rows) and other is accountBtn(4 rows)

accountBtn,HeaderText
New Case,Type
New Note,Phone
New Contact,Website
,Account Owner
,Account Site
,Industry

When I'm reading file with below code

* def csvData = read('../TestData/Button.csv')
* def expectedButton = karate.jsonPath(csvData,"$..accountBtn")
* def eHeaderTest = karate.jsonPath(csvData,"$..HeaderText")

data set generated as per code is : ["New Case","New Note","New Contact","","",""]

My expected data set is : ["New Case","New Note","New Contact"]

Any idea how can this be handled?

Aucun commentaire:

Enregistrer un commentaire