最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

jmeter - Wait for file Response using WebSocket Single Read Sampler - Stack Overflow

programmeradmin0浏览0评论

I'm new to JMeter from Java Selenium, and I am trying to carry out the following actions:

  1. Upload a file
  2. Wait for websocket response indicating that file has successfully uploaded.

To this effect, I am using the Websocket Single Read Sampler from this plugin,

My script is currently structured as

My Test Plan

  1. upload the file (This part at least works)

  2. While ${__javaScript("${UPLOADING}" != "false",)} a. Websocket Single Read Sampler: Sampler ↪JSON Extractor setting ${UPLOADING} to is-in-progress

    b. JSR223 Sampler: log.info("Current Status: " + UPLOADING)for debugging+logging

I have also tried Websocket Open Connection + Websocket Single Read Sampler (use existing connection). While I can open the connection successfully, in both cases I get WebSocket I/O error: Read timed out and the Single Read Sampler fails without showing up in the the log. The only error in the log is No such Property: Uploading for class because UPLOADING doesn't exist.

I'm new to JMeter from Java Selenium, and I am trying to carry out the following actions:

  1. Upload a file
  2. Wait for websocket response indicating that file has successfully uploaded.

To this effect, I am using the Websocket Single Read Sampler from this plugin,

My script is currently structured as

My Test Plan

  1. upload the file (This part at least works)

  2. While ${__javaScript("${UPLOADING}" != "false",)} a. Websocket Single Read Sampler: Sampler ↪JSON Extractor setting ${UPLOADING} to is-in-progress

    b. JSR223 Sampler: log.info("Current Status: " + UPLOADING)for debugging+logging

I have also tried Websocket Open Connection + Websocket Single Read Sampler (use existing connection). While I can open the connection successfully, in both cases I get WebSocket I/O error: Read timed out and the Single Read Sampler fails without showing up in the the log. The only error in the log is No such Property: Uploading for class because UPLOADING doesn't exist.

Share Improve this question edited Feb 3 at 19:35 Cormac Close asked Feb 3 at 19:27 Cormac CloseCormac Close 11 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

You need to change UPLOADING to vars.get('UPLOADING') where vars is a shorthand for JMeterVariables class instance.

See Top 8 JMeter Java Classes You Should Be Using with Groovy article for more details.

In WebSocket Single Read sampler you can try ticking use existing connection, if you say what the connection can successfully be established it might resolve your issue.

Also you can try enabling debug logging for the WebSocket Samplers plugin, it can be done by adding the next line to log4j2.xml file

<Logger name="eu.luminis" level="debug" />

Check documentation on the plugin for more details and troubleshooting tips.

发布评论

评论列表(0)

  1. 暂无评论