使用JMeter录制期间文件上传失败 [英] File upload fails during recording using JMeter

查看:1668
本文介绍了使用JMeter录制期间文件上传失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用端口8888在JMeter中记录文件上传,但是当使用JMeter作为代理(Recording Controller和HTTP(S)Test Script Recorder)时,文件上传失败.我还尝试通过选择开始"并查看我刚刚在查看结果树"侦听器中记录的内容,在JMeter中运行此文件.当我以这种方式运行它时,我在查看结果树"侦听器中收到文件上传行的500错误.

I attempted to record a file upload in JMeter, using port 8888, but the file failed to upload when using JMeter as the proxy ( Recording Controller and HTTP(S) Test Script Recorder ). I also tried to run this from within JMeter by choosing "Start" and viewing what I had just recorded in the View Results Tree listener. When I ran it this way, I received a 500 error for the file upload line in the View Results Tree listener.

因此,我在执行文件上传时运行了Charles网络代理,以查看是否发生了相同的事情.它没有.我能够通过同一端口8888上的Charles网络代理成功上传文件.

So, I ran Charles network proxy while doing the file upload to see if the same thing happened. It did not. I was able to successfully upload the file going through the Charles network proxy on the same port 8888.

此外,我删除了所有代理,并成功上传了文件.

Furthermore, I took out all proxies and did the file upload successfully.

仅当我使用JMeter作为代理时,我才在上传文件时遇到问题.

Only when I use JMeter as the proxy do I have a problem uploading the file.

在JMeter中,在没有任何更改的情况下首先运行它之后,我尝试更改许多设置,例如实现,内容编码,可浏览器的报头,检索所有嵌入式资源以及许多其他设置,以查看这是否有帮助,但确实如此不是.

In JMeter, after first running it with no changes, I then tried to change many settings like Implementation, Content Encoding, Browser-campatible headers, Retrieve All Embedded Resources, and many others to see if this would help, but it did not.

因此,我的直觉告诉我,有一个设置不正确.

So, my gut tells me that there is a setting that is set incorrectly.

我发现这篇文章谈到了在HTTP Request Defaults中更改为使用"Java". (使用Jmeter时无法上传图像/文件HTTP代理服务器),但是当我尝试这样做时并没有帮助我. 我发现这篇文章也提到了其他类型的事情(

I found this post that talks about changing to use "Java" in the HTTP Request Defaults. ( Unable to upload image/file when using Jmeter HTTP Proxy server ) This did not help me though when I tried that. I found this post also which mentions some other types of things ( Unable to record an upload file scenario in JMeter though it is possible by manual effort with specific browser settings ) . I did check the headers against Charles and they look the same.

有什么想法吗?

=============下面的编辑添加了测试计划屏幕截图==============

============= Edit below is adding the test plan screen shot===============

推荐答案

因此,显然,我不得不从路径"行中删除参数,并将其移至通过请求发送参数"行中.我遇到了500错误(我在上面附加的屏幕快照中的突出显示的行).

So, apparently, I had to remove the parameters from the "Path" line and move them to the "Send Parameters With the Request:" for the line that I had the 500 error on ( the highlighted line in the screen shot I had attached above ).

总而言之,这就是发生的事情.当我使用Recording Controller和HTTP(S)测试脚本记录器使用JMeter记录文件上载时,JMeter在JMeter为我记录的许多行上将所有参数都放在了"Path"字段中.对于JMeter为我自动完成的操作,我什至没有三思而后行.因此,在删除路径"字段中除"/"以外的所有文本并一次在发送带有请求的参数"下添加了每个参数之后,在给我输入以下信息的那一行上,我收到了"200"状态代码问题.我还进入了所有其他行,并对参数进行了相同的更改.我仍然不确定文件上传是否确实有效,但是我现在不在乎,因为我确实在线路上收到了"200"的字样,这给我带来了问题.这足以使我前进...:-).

In summary, here is what happened. When I recorded the file upload with JMeter using the Recording Controller and HTTP(S) Test Script Recorder, JMeter had put all of the parameters in the "Path" field for me on many of the lines that JMeter had recorded for me. I did not even think twice about what JMeter had done automatically for me. So, after I removed all text except "/" in the "Path" field and added each parameter one at a time under "Send Parameters With the request", I received a "200" status code on the line that had given me the problem. I also went into all other lines and made these same changes for the parameters. I still am not sure if the file upload is actually working, but I don't care about that right now since I did get a "200" on the line that was giving me a problem. That is enough progress to keep me moving ahead... :-).

这篇关于使用JMeter录制期间文件上传失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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