Unable to upload binary file with Taurus/Jmeter

923 views
Skip to first unread message

jfs...@coveo.com

unread,
Oct 25, 2017, 12:48:52 PM10/25/17
to codename-taurus
Hello all! 

I am trying to upload a binary file to Amazon S3 using Taurus/JMeter YAML. (it's part of a load test in several steps, one of which is uploading this file).

I *must* upload the file as a binary, with application/octet-stream as content type. My request performed manually through a REST client like Postman works correctly.

So I'm trying to emulate this upload in JMeter/YAML.

I can't use the "body" field. I tried opening the file in a groovy script, storing the binary content with a putObject method, and then send it to the body. But this breaks, as body coerces a string.

There's the upload-files field. When I try it, the upload sends an empty file. Actually, since this thing forces a "param" value, I am not even sure if this is the right use-case. I'm actually doing this

    # Upload document
    - url: ${uploadUri}
      method: PUT
      headers:
        Content-Type: application/octet-stream
        x-amz-server-side-encryption: AES256
      jsr223:
        - language: groovy
          script-file: documentFromFile.groovy
          execute: before
      upload-files:
      - param:
        path: ${uploadableFile}
        mime-type: application/octet-stream
      label: upload binary

The uploadableFile is the name and path of the file I want to upload, returned by the documentFromFile groovy script. Even if I enter an arbitrary value for the param property here, it still uploads an empty document.

Am I using this wrong? Is there another way I don't think of, of uploading a file in pure binary?

Thanks in advance!
JFS

Andrey Pokhilko

unread,
Oct 27, 2017, 10:35:21 AM10/27/17
to codenam...@googlegroups.com

Hi,

Your code looks absolutely fine. Are you sure your documentFromFile.groovy code does not modify request in an undesired way?


Andrey Pohilko
Chief Scientist
P: +7 (909) 631-21-69
BlazeMeter Inc.
25.10.2017 19:48, jfs...@coveo.com пишет:
CAUTION: This email originated from outside of CA. Do not click links or open attachments unless you recognize the sender and know the content is safe.

--
You received this message because you are subscribed to the Google Groups "codename-taurus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codename-taur...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codename-taurus/8f1d0907-1a65-430c-8710-92eaab5de1e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

grey....@gmail.com

unread,
Oct 30, 2017, 7:15:38 AM10/30/17
to codename-taurus
Hello.

Please try follow workaround:
1. fill param with empty string:
param: ""
2. use absolute path to file for local provisioning. In cloud prov don't forget to add your file to 'files' execution list.
---

Taras

jfs...@coveo.com

unread,
Oct 30, 2017, 11:14:31 AM10/30/17
to codename-taurus
This works! I think it was a question of absolute vs relative path.

Thank you very much!
JFS
Reply all
Reply to author
Forward
0 new messages