In this blog series, I will help you become an accomplished API automation engineer. Last post we learned about Requests Rest API Project in the SoapUI application. Part 4 is about adding more Resources and Requests to your SoapUI project.
If you don’t have SoapUI you can download it here.
View all posts from the series here.
Add More Resources
Take a look at the API documentation here. There are plenty of resources to play around with. Let’s create new resources for Items and Pokemon.
To add the resources to our project we need to do the following:
- Right-click on the “PokeApi.co” service. Choose the option to “Add Resource”
- Paste “api/v2/item/” into the “Resource Path” field
- Rename the Resource, Method, and Request so that it looks like this.
Now you try to make the Pokemon resource. The end result should look like this.
Great job! Let’s move on and add the parameters to the resources we just created.
Add Parameters
To the Items resource, we need to add “{id or name}” with a Template Style.
- Double click the Resource to open the Request Editor.
- Click the green + button.
- Enter “{id or name}” for the name.
- Change the Style to “Template”
Your resource should now have a path of “/api/v2/item/{id or name}”. Your Request Editor should look like this now.
Go ahead and create the parameter for the Pokemon request. Your finished results should look like this.
Great job. You now know how to create new resources and set up your requests with parameters. Feel free to add more if you would like. For the purpose of this tutorial, we will only need the “Resources List”, “Pokemon”, and “Item” resources.
In the next post, we will create a Test Suite out of the requests that we made.
Next: Create the Test Suite
0 Comments