Forum Discussion

merxyboy's avatar
merxyboy
New Contributor
7 years ago
Solved

Parameterizing string to Payload Request (Data Driven Test)

Hi Smartbear community,

 

I am stumped by this fairly newbie issue I'm sure most of you will be able to solve:

 

Prerequisites:

- JSON payload request has an attribute reason i.e. {"reason": "<reasonValue>"} as a String datatype

- Reason has been added as a parameter on a Properties step inside a test case as ${#TestCase#reason} > this will be one of the parameters for input on the CSV data.

- CSV data has been updated with the <reasonValue> for the above property.

- Finally payload has been updated by {"reason": ${Properties#reason}} which references from the Properties step.

 

Issue:

- When I put   Because   on the CSV data source, it becomes {"reason": Because} on the sent payload request where it's not a string which causes json error

- When I put   "Because"   on the CSV data source, it becomes {"reason": """Because"""} on the sent payload request  where it's not a string as well causing another json error.

 

Goal:

- Make reason parameterized to check if it has the right data type and if it is mandatory.

 

Kindly advise.

  • Hi Rao,

     

    I'm using SoapUI Free edition and I figured out what's wrong. Turns out I'm using excel as an editor for CSV file which should never be done.

     

    Editing the parameters on text editor such as notepad++ can solve the problem.

     

    Again, thanks for the reply Rao.

2 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Are you using open source edition or Pro edition?
    • merxyboy's avatar
      merxyboy
      New Contributor

      Hi Rao,

       

      I'm using SoapUI Free edition and I figured out what's wrong. Turns out I'm using excel as an editor for CSV file which should never be done.

       

      Editing the parameters on text editor such as notepad++ can solve the problem.

       

      Again, thanks for the reply Rao.