Tsung problem with Dyn_Variable

I am very new to ERLANG and TSung, I have never worked in this area, but I am very interested in knowing the basics and performing a distributed load test for my web application. I am halfway to completion, but I have a big obstacle and cannot move forward, please read the tsung.xml file below and let me know where and what I am missing?

 **===> tsung.xml (this file perfectly working without any errors)** *<?xml version="1.0"?> <!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd"> <tsung loglevel = "debug" dumptraffic="true" version="1.0"> <clients> <client host="localhost" weight ="1" maxusers="40000" cpu = "1" > <ip value = '127.000.000.111'/> </client> </clients> <servers> <server host="127.000.000.112" port="80" type="tcp"></server> </servers> <load duration="1" unit="minute"> <arrivalphase phase="1" duration="1" unit="minute"> <users arrivalrate="10" unit="second"></users> </arrivalphase> </load> <sessions> <session name="mySession" probability="100" type="ts_http"> <transaction name="trx"> <request> <dyn_variable name="myId" re="&lt;myId&gt;(\.*)\&lt;/myId&gt;"/> <-- Trying with RegExp option, not getting the value myId <!--dyn_variable name="myId" xpath="//response/myId" /--> <-- Trying with xpath option, not getting the value myId <!--dyn_variable name="myId" jsonpath="response.myId" /--> <-- Trying with jsonpath option, not getting the value myId <http url='http://127.000.000.112/Create_Rec' method='POST' version='1.1' content_type='text/xml'/> </request> <request subst="true"> <http url='http://999.000.000.999/Get_Rec/myId=%%_myId%%' method='GET' version='1.1' content_type='application/xml'/> </request> </transaction> </session> </sessions> </tsung>* 

When I run this URL (this is a web service call) " http: //_127.000.000.112/Create_Rec " in a web browser, I get the following similar response from the server (in the back, it creates an entry in the database and generates a new identifier, i.e. myId). When I run on tsung.xml, the first request works just fine, as I expected.

===> answer (browser response)

 <response id="SomeWebService"> <status> <statusCode>1</statusCode> <statusMsg>SomeMessage</statusMsg> <statusTime>2013-06-20 02:52:25</statusTime> </status> <myId>298346728934734987</myId> </response> 

What I'm looking at here, I need to grab myId from the first request and pass the second request myId = %% _ myId %%, but it never works and myId is always an empty string. I am outside of dyn_variable since two days, no tips and right examples / documentation on it. Please suggest me what I am missing.

+4
source share
1 answer

You will need to configure subst = "true" in your request for a job substitution. So, your request should change to ..

 <request subst="true"> 

If everything still does not work, I suggest you look at the tsung.dump file and check the response you get from the server

+1
source

Source: https://habr.com/ru/post/1487428/


All Articles