记录中的Jmeter上传错误 [英] Jmeter Upload Error in Recording

查看:266
本文介绍了记录中的Jmeter上传错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试记录有上传功能的会话。

我使用http代理服务器进行录制,录制控制器和http cookie管理器。

当我尝试上传文件并单击保存它显示以下错误:

I am trying to record a session in which there is a upload functionality.
I have used http proxy server for recording, recording controller and http cookie manager.
When I try to upload a file and click save it shows following error:


java.io.FileNotFoundException:a12-13538_110q.htm(系统不能
找到指定的文件)java.io.FileInputStream.open(Native
Method)at java.io.FileInputStream。(Unknown Source)at
java.io.FileInputStream。(Unknown Source )
org.apache.jmeter.protocol.http.sampler.PostWriter.writeFileToStream(PostWriter.java:408)
at
org.apache.jmeter.protocol.http.sampler.PostWriter .sendPostData(PostWriter.java:117)
at
org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.sendPostData(HTTPJavaImpl.java:115)
at
org .apache.jmeter.protocol.http.sampler.HTTPJavaImpl.sample(HTTPJavaImpl.java:510)
at
org.apache.jmeter.protocol.http。 sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1060)
at org。 apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:238)

java.io.FileNotFoundException: a12-13538_110q.htm (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(Unknown Source) at java.io.FileInputStream.(Unknown Source) at org.apache.jmeter.protocol.http.sampler.PostWriter.writeFileToStream(PostWriter.java:408) at org.apache.jmeter.protocol.http.sampler.PostWriter.sendPostData(PostWriter.java:117) at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.sendPostData(HTTPJavaImpl.java:115) at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.sample(HTTPJavaImpl.java:510) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1060) at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:238)

这个功能在我工作正常不使用jmeter录音。

This functionality works fine when I am not using jmeter recording.

请帮忙。

我有什么方法可以进行这项测试吗?

Kindly help on this.
Is there any way I can perform this test?

推荐答案

错误50079 :Jmeter确实不记录文件路径。

Bug 50079: Jmeter does not record the file path.

根据您的异常,由于上述问题,jmeter无法找到要上传的文件。

所以你必须在采样器中手动设置路径,最好使用变量进行测试参数化。

As per your exception jmeter cannot find file to upload, because of issue mentioned above.
So you have to set path manually in sampler, and it's better to use variable for this, for test parametrization.

根本不要使用记录和回放,或者至少检查并调整您录制的采样器。

在您的情况下,您必须设置以下记录的http [POST]请求:

Don't use record-and-playback at all, or at least check and adjust your recorded samplers.
In your case you have to set in recorded http [POST] request following:


  • 使用multipart / form-data for POST = true - 将文件作为请求的一部分发送;

  • 发送带请求的文件 - >文件路径= PATH_TO_FILE - 直接或使用变量的现有文件的路径。

  • Use multipart/form-data for POST = true - to sent file as part of request;
  • Send Files with Request -> File Path = PATH_TO_FILE - path to existent file, directly or using variable.

    . . .
    UPLOAD HTTP Request
    Method = POST
    Use multipart/form-data for POST = true
    -- Send Files with Request -- section:
    File Path = ${testFile}
    Parameter Name = datafile
    MIME Type = ...
    . . .

这篇关于记录中的Jmeter上传错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆