Data-driven Virtualization unable to import CSV file in DevTest Portal
search cancel

Data-driven Virtualization unable to import CSV file in DevTest Portal

book

Article ID: 73092

calendar_today

Updated On:

Products

Service Virtualization

Issue/Introduction

Using JSON data as response which is saved in  CSV file.

Import a .CSV file into the DevTest Portal to use with the Data Driven feature, getting the following error:

Error while retrieving columns of a Data Set. (500 JSON Error Parsing Retrofit Error Original message:[[error:[type:TestRunException, message:"Error reading CSV file "]]])

The JSON response in csv file is as below:

{"Header":{"WSID":"12345","OfficeId":"123","TaxProId":"456","TaxYear":"2016"},"LeafNodes":[{"Key":"1.4","Code":"XYZ","Value":"TRUE"}]}
 

Environment

All supported DevTest releases.

Resolution

The single quotes used in CSV file is throwing the Retrofit Error when trying to import the json file.

By CSV spec (https://www.loc.gov/preservation/digital/formats/fdd/fdd000323.shtml): "Fields that contain a special character (comma, CR, LF, or double quote), must be "escaped" by enclosing them in double quotes (Hex 22)" 

Change the Response in the CSV file as shown below :

From 

{"Header":{"WSID":"12345","OfficeId":"123","TaxProId":"456","TaxYear":"2016"},"LeafNodes":[{"Key":"1.4","Code":"XYZ","Value":"TRUE"}]}

To   

"{""Header"":{""WSID"":""12345"",""OfficeId"":""123"",""TaxProId"":""456"",""TaxYear"":""2016""},""LeafNodes"":[{""Key"":""1.4"",""Code"":""XYZ"",""Value"":""TRUE""}]}"

Additional Information