0

I'm currently trying to create a load test for my API using soapUI to send Adobe Message Format requests. I have a request that expects a byte[] data type, but I know next to nothing about Groovy or Java.

I've pieced together information from different threads and I'm trying to create a property expansion along the lines of "${byte[] contents = new File("C:/Users/jloiselle/Desktop/TestDragon.png").getBytes()}" which obviously does not work.

Can anyone help me out or at least point me in the right direction?

Thanks in Advance

2 Answers2

0

You have the correct way of getting the bytes of the file;

new File("C:/Users/jloiselle/Desktop/TestDragon.png").bytes

How are you trying to send this array to the request?

tim_yates
  • 167,322
  • 27
  • 342
  • 338
0

After lookin at the soapUI tutorials again, I realized I was attempting to reference the property incorrectly.

The solution was as follows:

In the script window of my request I added:


def temp = new File("C:/Users/jloiselle/Desktop/TestDragon.png").bytes

parameters['contents'] = temp


Thanks for the verifying the syntax for geting the bytes of a file.