ReadyAPI allows you to use Groovy scripts to work with attachments – for example, extract data from text files, change their encoding, and so on.
This topic describes how to use a Groovy script to encode attachments.
There are several ways to run this script:
As a Groovy Script test step.
As a setup or teardown script on the project, test suite, or test case level in functional tests.
As a setup or teardown script in security tests.
As a setup or teardown script in performance tests.
As a Start, Stop, OnRequest, or AfterRequest script in virtual services.
The following code demonstrates how to encode the specific file with base64 in ReadyAPI: