Yes, request body can be modified with the help of utility methods. Let's take an example scenario.
Suppose we want to encrypt request body before executing the test case. We can achieve this with the help of utility methods in the following steps:
- First write a utility method which pre-process our input. In our example scenario, first write an utility method which encrypts the data. A sample code can be downloaded below for your reference.
- Now, in test cases, you may encrypt the request body as shown in the below figure:
Note: You may even pass the dynamic data using variables to this utility method.