0

I am new to API testing and am using Katalon to develop the tests. I've Googled any question I could think of and couldn't find anything to answer my question.

We have an API with the following Body

[
    "${idValue1}",
    "${idValue2}",
    "${idValue3}",
    "${idValue4}",
    "${idValue5}",
]

I believe the purpose of this one is to delete multiple records at once by id. The script that we have in the step definition is

response = WS.sendRequest(findTestObject('EquipmentAPI/data-objects/DELETE Equipment By Ids', [('host') : GlobalVariable.host, ('idValues') : GlobalVariable.equipId]))

GlobalVariable.equipId = WS.getElementPropertyValue(response, 'data[0].id')

There are other step definitions that run before this one to set the Global Variables for use. I was able to generate the string array without issue.

Is this something that's possible? Please help!

Please let me know if further information is needed. Thanks.

Mate Mrše
  • 7,997
  • 10
  • 40
  • 77
  • I can't understand your question. – daggett Mar 04 '21 at 12:41
  • That's ok. I finally found a way to do what I needed to do without using an array yesterday. I would love to use an array though. Basically what I'm trying to do is pass in a list of ids into an API call that will delete records using that list of ids. I'm using the findTestObject function in Katalon. But again, it's alright. I found a way to do it. – sestester407 Mar 05 '21 at 13:24

0 Answers0