# API Testing FAQs

### I've got a JSON response where I want to extract all book titles from the array by using JSON Path expression - $.store.book\[\*].title but I'm getting only the first title. WHY?

Loadmill uses a framework where only the first value gets retrieved in case you are using the \* sign. Use the [`__jsonpath_all`](https://docs.loadmill.com/api-testing/test-suite-editor/functions#__jsonpath_all-target-jsonpath-default) function instead so your extractions will look this way:

![](https://684333474-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LHDbUNdi3wPd9vSolzU%2Fuploads%2Fgit-blob-8c7d024647dec54ee1dc0e96c7b581e7d9edf2f0%2FScreenshot%20-%202021-10-03T154715.913.png?alt=media\&token=1c422c92-2057-477c-b783-76cd8fb24afb)

### **I'm testing entity creation where entity Name should be unique. Can I assign a set of random letters to it?**

Sure, create a parameter with using the `__random_letters([length=10])` function for that:

![](https://684333474-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LHDbUNdi3wPd9vSolzU%2Fuploads%2Fgit-blob-b3e9c7ed9627b39c10725d38b7057c280269e139%2FScreenshot%20-%202021-04-01T155426.154.png?alt=media\&token=86ae08ce-c36d-45e5-b929-ad18de8974b0)

Find more great functions on [this page](https://docs.loadmill.com/api-testing/test-suite-editor/functions#randomization-functions) and more information about default parameters [here](https://docs.loadmill.com/api-testing/test-suite-editor/test-suite-parameters).

### **I'm getting ID of my resource and I want to make sure it is in the format of UUID. How can I do that?**

You can easily achieve that:

1. Extract the ID into a parameter by using JSONPath.
2. Create another parameter by using the extracted ID and [function `__random_uuid()`](https://docs.loadmill.com/api-testing/test-suite-editor/functions#__random_uuid). The output would be "true" if the ID is in the format of UUID. Else, it would be "false".

![](https://684333474-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LHDbUNdi3wPd9vSolzU%2Fuploads%2Fgit-blob-55b7b54c4ae46e00d003774f601e7d62a19ecb88%2FScreenshot%20-%202021-10-03T155017.448.png?alt=media\&token=23e50f00-5966-4034-8764-49e9b2eacb1f)

3\. Now, assert the second parameter you've created earlier.

![](https://684333474-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LHDbUNdi3wPd9vSolzU%2Fuploads%2Fgit-blob-d77b31c0b64ecee2c9af4b965e92f498a9d49d94%2FScreenshot%20-%202021-10-03T155243.087.png?alt=media\&token=0710b38b-137f-4215-9f8d-26da88f69182)

### Is there a way to run an API test with a combination of values? In my case, I want to create tickets where each ticket has a specific type, there are 10 ticket types available.

There is a feature in Loadmill that allows to do that. First, create a CSV file containing all ticket types, like below:

![CSV file](https://684333474-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LHDbUNdi3wPd9vSolzU%2Fuploads%2Fgit-blob-a11ba02cf64df6b3ac5508e259a96b3c0137ef59%2FScreen%20Shot%202021-04-06%20at%2017.36.38.png?alt=media\&token=25b27c19-31ee-45d9-9295-e2314e16fb1d)

Then, go to Loadmill, upload the file by using the "Import CSV" button within a test flow and use the "ticket\_type" parameter in your request body:

![](https://684333474-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LHDbUNdi3wPd9vSolzU%2Fuploads%2Fgit-blob-a9b2d5bcb54b7044c187344e23620c628ea2f3a0%2FScreenshot%20-%202021-10-03T155529.122.png?alt=media\&token=18b3e27e-acfb-454d-a61b-a0c0a304488b)

Thus, when running the Test Suite, each test iteration will get a relevant ticket type from the CSV file. Find more information about using CSV files in API tests [here](https://docs.loadmill.com/api-testing/test-suite-editor/api-tests-data-from-csv-files).

###
