Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How to pass array of inputs where array limit is Dynamic and unknown while setting up

Options
Parasofttoudaya
Parasofttoudaya Posts: 232 ✭✭
edited August 2017 in SOAtest

Hi Team,

Here i encountered a situation where i need to send the data in an array of elements, where i don't know the size of the element.

{
"cars":{
"Nissan":[
{
"model":"Sentra",
"doors":4
},
{
"model":"Maxima",
"doors":4
}
],
"Ford":[
{
"model":"Taurus",
"doors":4
},
{
"model":"Escort",
"doors":4
}
]
}
}

Also would like to know how it can parameterized?

Nissan can be considered as one array, and ford.
Would be better if we have any options to generate it.

Thank
Udaya

Comments

  • OmarR
    OmarR Posts: 234 admin
    edited August 2017
    Options

    Is the goal to pass the array or the content of the array?

    If you wish to extract all models from Nissan array, you would right-click the model element in a JSON databank and select "Add Xpath for all Occurrences..". This option would extract all models of Nissan Array. You would do the same for the Ford array.

    If you wish to extract the entire array, you would extract Nissan instead.

  • Parasofttoudaya
    Parasofttoudaya Posts: 232 ✭✭
    Options

    I would like to add array like Nissan and Ford. Let say i want add Honda and Toyota Additionally. I will be having the data in a sheet or in XMLDataBank
    CAR|MODEL|DOORS -- All these inputs will be response from previous test results.

  • benken_parasoft
    benken_parasoft Posts: 1,230 ✭✭✭
    Options

    You can also use Excel. Docs have detail. See "Parasoft SOAtest User's Guide > Functional/Integration Testing > End-to-End Test Scenarios > Performing Functional Tests Using Data Sources > Parameterizing Arrays of Varying Size"