本文介绍了尽管可以通过特定的浏览器设置手动操作,但无法在JMeter中记录上载文件方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发仅在Internet Explorer上运行的上载文件模块,并且需要以下浏览器设置为强制性:应该启用在将文件上传到服务器时包括本地目录路径".

I am working on upload file module that works on internet explorer only and it requires following browser setting mandatory:"Include local directory path when uploading files to server" should be enabled.

如果我们没有在浏览器中进行必要的设置,而是尝试手动操作,则会显示失败消息无法上传文件".

A failure message "Unable to upload file" displays when we do not make required setting in browser while manual attempt else it works fine.

现在,当我尝试在JMeter中记录场景时,即使我进行了必需的浏览器设置,也会收到相同的错误消息.

Now when I am trying to record the scenario in JMeter, getting same error message even I made required browser settings.

注意:此外,我尝试通过从浏览器工具复制并将这些调用粘贴到JMeter事务中来包含这些调用,但在响应中得到相同的结果.

Note: Additionally, I tried to include these calls by copying from browser tools and paste it in JMeter transaction but get the same result in response.

任何人都经历过同样的经历或可以帮助我吗?

Have any one experience the same or can help me out?

谢谢,尼丁

推荐答案

使用jmeter上传图像的步骤:

Steps to upload the image using jmeter:

  1. 在bin文件夹中找到图像选择发布"方法,然后选中使用HTTP请求中的POST的multipart/form-data"
  2. 通过HTTP请求中的请求提供发送文件的详细信息
  3. 在Jmeter中记录上载场景和停止按钮(在Jmeter中记录时图像不会上传)
  4. 现在,在运行脚本之前,请转到上载响应并在使用请求字段发送文件"中提供图像的完整路径
  5. 现在运行脚本.您可以看到图像
  1. locate the image in bin folder Select Post method and check the "Usemultipart/form-data for POST" in HTTP Request
  2. Provide details of Send files With the Request in HTTP Request
  3. Record the Upload scenario and stop button in Jmeter (Image wouldn't upload while recording in Jmeter)
  4. Now before running the script, Go to upload response and give the full path of image in "Send files with request field"
  5. Now Run the script. You can able to see the image

这篇关于尽管可以通过特定的浏览器设置手动操作,但无法在JMeter中记录上载文件方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 14:27