简体   繁体   中英

Tsung dynamic variables scope

I want to write a test case for a user hitting a websockets server with thousands of different packets generated by tsung, but I received only the same packet thousands of times.

What is the scope of Tsung's dyn variables?

....
<session name="websocket" probability="100" type="ts_websocket">
  <setdynvars sourcetype="random_number" start="9" end="16">
    <var name="randomNum" />
  </setdynvars>
  <for from="1" to="10" incr="1" var="counter">
    <request subst="true">
      <websocket frame="text" ack="no_ack" type="message">
        {"randomNumber":%%_randomNum%%}
      </websocket>
    </request>
  </for>
</session>
....

For each user I'll receive 10 messages all with the same "randomNumber", but I want the number to change between each of those 10 messages.

我们可以结束我只需要将dyn_variable放入其中的问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM