Do you think IIT Guwahati certified course can help you in your career?
No
Introduction
This blog will discuss how we can test the APIs using Properties available in Ready API. A Ready API is a tool the DevOps teams utilize to enhance API quality by managing APIs, security, performance testing, and automated functionality in one integrated interface.
Properties in Ready API
There are multiple properties available in Ready API that we can use according to our requirements. Now let's discuss each of them one by one.
Object Property
The objective to use object property is when we need to change the configuration of test items like workspace, project, test suite, load test, and many more in Ready API. We use object property from the Properties tab in the Navigation panel. If it is disabled, go to View -> Properties in the main menu.
Custom Properties
You can make custom properties for many things in a project, like a test case, test suite, load, and many more. You can also create custom properties for the project in Ready API. You can see custom properties in Navigator or the editor of the test items.
Keep in mind that these custom properties have their scope means project-level-property cannot override test-level-property in the project.
Global Properties
Global Properties are independent of the project. Use the Global Properties tab of the ReadyAPI Setting to change them.
Global properties can also be changed by the -G command-line attribute.
System Properties
The system properties is a dialog box that you can use to see the java machine setting started with which particular Ready API instance. Go to the Help->system properties in the main menu of Ready API.
Encrypt Properties
You can encrypt project properties or your entire project if you need to store sensitive data. Ready API preferences can also be encrypted to protect global properties.
The project's values of encrypted properties won't be visible and won't appear in logs, reports, or test results either.
Get Data Dialog
With the help get a data dialog box, you can specify a PropertyExpansion. The role of a property expansion is to allow a user to insert the variables in property value, request body, and many more things. This section will discuss how to use a Get data dialog.
Right-click the area where you want to add property expansion and choose Get Data to launch the dialogue. Additionally, some text fields have an ellipsis button that opens this dialogue.
Now in the dialog, you will see four column Test Suite, Test Case, Test Step, and Properties having properties according to the corresponding level.
You can also filter out the items by searching the name of an item search field at the top of each column.
How to select a property?
You can select a property by following the below steps.
Include the test suite or test case of the project to which that property belongs.
Then select the property and click Add bottom or double-click it to add.
Add custom properties
You can an add a custom property in the Get Data dialog. Just follow these steps.
Click on the + button next to the object you want to add.
Now insert the name and property value and click Create.
Without Get Data Dialog
You can add property expansion to a project without using the Get data dialog box. You just need to add some commands into the CLI in Ready API, and the work is done.
Scope in syntax means to specify the property owner like #projectname#, #Testcase#.
Property-Name specifies the type of property.
Datasource-Row and Path-Expression in the syntax are optional. Datasource to use when you need to specify a particular data row and Path-Expression to use when you want value from the JSON and XML format.
Dynamic Expression
Sometimes in property expansion, you might deal with dynamic data. You must apply the Groovy script in Ready API CLI to provide data.
Syntax
${=Groovy code}
Property Expansion in Scripts
You can use scripts in property expansion if you want a property's value in a Groovy script. Just add the following syntax.
def foo = context.expand( 'Property expansion' )
At the place of Property expansion, just specify the property expansion you want to use. For example, ${ #Testcase#userid} will give us the user's id.
Isolate a Property Expansion
You can pass a property expansion without parsing it by adding an extra $ at the start of a property expansion. You may deal with some cases where you want to parse the property later.
Example.
$${#TestCase#Propertyname}
Locally stored properties
Ideally, properties are stored in the project folder, but you can exclude some of these properties and store them in your local environment. Keep them in a local environment because you will be working with a team in a collaborative project so that some properties might be suitable for your environment and not others.
How to add?
Select the project or test case.
Now go to the custom properties section and select the properties you want to store in the local environment by choosing the local path.
Remember that custom properties can only be saved in the local environment.
Frequently Asked Questions
Who uses Ready API?
DevOps mainly use ready API to enhance API quality.
Ready API is written in which programming language?
Ready API is written in the JAVA programming language.
How can we use Ready API?
To use Ready API, you must install SOAPUI, a tool integrated with Ready API.
Can we insert a property expansion without using CLI commands?
Yes, you can apply property expansion with the help of the Get Data dialog available in Ready API.
How to deal with sensitive data in Ready API?
You can encrypt property data in the Ready API.
Conclusion
In this blog, we learned about the Ready API and how we can use the properties available in Ready API. There are multiple properties available in Ready API, and we can use each accordingly. We have also discussed creating custom properties in Ready API.
To learn more about Ready API, check out the following articles.