2

I created a Jenkins job where it run some JMeter scripts and return .jtl files. Now, I want to upload this files to Blazemeter Sense to see the performance test, downloads pdf reports, etc. I've searched a lot of information, where I find that to upload some file, I can use this command thats running from Windows CMD:

curl -v https://sense.blazemeter.com/api/files -H "Authorization: Token 'cat ~/.loadosophia.token'" -F "projectKey=Project_name" -F "jtl_file=@jtl.gz"

REFERENCE: https://sense.blazemeter.com/wiki/help:uploads/

The only values that I change are

  • cat ~/.loadosophia.token, where I replaced for my Upload Token (finded in Blazemeter Sense -> Options -> Settings -> Your Upload Token) enter image description here
  • projectKey where I replaced by my project name (test_taurus) enter image description here
  • jtl_file where I replaced by the file directory generated by Jmeter test (.jtl)

The final command is:

curl -v https://sense.blazemeter.com/api/files -H "Authorization: Token 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXYLaa'" -F "projectKey=test_taurus" -F "jtl_file=/path/of/file/file.jtl"

I missed some? What is my wrong? Existe another posibility to make it?

Thanks everyone

U P D A T E:

I did what Dmitri T said. Thats works. But when I run the command, the output is the following:

enter image description here

What could be the issue?

Carlos Andres
  • 12,740
  • 7
  • 18
  • 34

1 Answers1

1
  1. You need to remove quotation marks around the token
  2. You need to add an "at" symbol before the .jtl file path

    Fixed command would be something like:

    curl -v https://sense.blazemeter.com/api/files -H "Authorization: Token XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXYLaa" -F "projectKey=test_taurus" -F "jtl_file=@/path/of/file/file.jtl"
    

More information: Upload files with CURL


You might find BM.Sense Uploader plugin more convenient to use, the plugin can be installed using JMeter Plugins Manager:

JMeter BlazeMeter Uploader Plugin

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Hi @Dmitri T! I edit according your response, but the output is `Warning: setting file /path/of/file/file.jtl Warning: failed!`. But when I upload this file manually, its work without errors. I need to does it from command line. Thanks for your help! – Carlos Andres Jul 12 '18 at 15:04
  • Dear Carlos, have you tried to substitute `/path/of/file/file.jtl` with **real** and **full** path to your .jtl results file? – Dmitri T Jul 12 '18 at 15:08
  • Dmitri, maybe this error is because I running curl command from Windows CMD? So I dont know how to solve if the problem is for that. Sorry, I forget it, I update the question with that fact! – Carlos Andres Jul 12 '18 at 15:12
  • Ya, I did that. Im running the command with the full path of the file – Carlos Andres Jul 12 '18 at 15:15
  • 1
    Since when paths in Windows start with a backslash? – Dmitri T Jul 12 '18 at 19:03
  • I deleted the backslash between "at" symbol and C: "jtl_file=@C:\JMeter\Rendimiento\Personas\pruebas_taurus\%nombre_jtl%.jtl". Thanks Dmitri T :) – Carlos Andres Jul 12 '18 at 21:58