David
David

Reputation: 417

JMeter: POST Import Not Working Like In REST Client

I'm still somewhat new to JMeter and not a programmer by trade. (I'm typically a BA/QA who happens understands OO programming and taken a few programming courses.) I'm performing API testing through REST service calls to/from our multi-tenant database.

I'm attempting to perform IMPORT through JMeter and am having difficulty. I'm able to successfully do it through REST clients like Postman and Advanced REST Client, but when I attempt to configure it in JMeter, it fails.

In Postman, the configuration is:

Postman Import Config

This is successful 100% of the time, as shown in the database.

Postman Import Results

In JMeter, I'm trying to replicate the configuration as follows:

HTTP Header Manager

JMeter Header Mgr

HTTP Request

JMeter HTTP Request

For MIME Type, I've tried "application/vnd.ms-excel", "vnd.openxmlformats-officedocument.spreadsheetml.sheet", and null - all with no success.

I've tried adding additional Header values in various combinations with no success:

Any thoughts, comments, insight, possible solutions, are appreciated.

Upvotes: 0

Views: 754

Answers (1)

Dmitri T
Dmitri T

Reputation: 168147

When you have inconsistencies w.r.t JMeter and browser or other tools the best way to figure out the differences is capturing requests from both JMeter and browser (or other tool) with a sniffer like Wireshark, detect and work around the differences.

In regards to your case, in JMeter:

  1. Remove HTTP Header Manager (or at least Content-Type: multipart/form-data header)
  2. In HTTP Request:

    • Check Use multipart/form-data for POST
    • MIME Type: application/vnd.ms-excel

See Performance testing: Upload and Download Scenarios with Apache JMeter article for detailed instructions on how to properly simulate file operations in your JMeter test

Upvotes: 1

Related Questions