We are building a new experience for our SmartBear Community.
This site is now read-only. You can still browse and search as usual. Learn More
This site is now read-only. You can still browse and search as usual. Learn More
You should be able to do this with a Groovy Script Test Step, using code something like:
// You may have to escape backslashes, or store the file path and name as a URI
def yourFilename = 'Obtain filename from data source'
def file = new File(yourFilename)
def base64encodedData = file.getBytes().encodeBase64().toString()
log.info('Base64 data = ' + base64encodedData)
def soapRequestData = 'Build your SOAP request with Base64 data here'
testRunner.getTestCase().getTestStepByName('SOAP Request').setPropertyValue('Request', soapRequestData)
If you are unsure how to get the filename from the data source via Groovy, you can use the point and click https://support.smartbear.com/readyapi/docs/testing/properties/get-data.html GUI method.