0

i have an api which i was load testing with tsung.All was ok. Now , i am getting no result using varibles data from file in load testing.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE tsung SYSTEM "/usr/local/Cellar/tsung/1.7.0/share/tsung/tsung-1.0.dtd">
<tsung loglevel="warning">

  <clients>
    <client host="localhost" use_controller_vm="true"/>
  </clients>

  <servers>
    <server host="127.0.0.1" port="8030" type="tcp"/>
  </servers>

  <load>
    <arrivalphase phase="1" duration="1" unit="minute">
      <users arrivalrate="100" unit="second"/>
    </arrivalphase>
  </load>
  <options>
    <option name="file_server" id="ids" value="id.csv" ></option>
  </options>
  <sessions>
    <session name="dummy" weight="1" type="ts_http">
        <setdynvars sourcetype="file" fileid="ids" order="iter">
            <var name="uid" />
        </setdynvars>
        <request subst="true">
            <http url="/api/v1/locations?user_ids=%%_uid" method="GET"  version="1.1" >
                <http_header name="Content-Type" value="application/json"/>
                <http_header name="RLS-Referrer" value="vivasoftltd.com"/>
            </http>
        </request>
    </session>
  </sessions>
</tsung>

this config file. and the id.csv is

1
2
3
4
5
6
7

now generating report showing

size_rcv is equal to 0 !
size_sent is equal to 0 !

And the report.html is showing all empty and all errors. How can i solve this

1 Answers1

0

Your dynamic variable substitution is incorrect inside your request.

<http url="/api/v1/locations?user_ids=***%%_uid%%***" method="GET" version="1.1" >

Please check this link for Tsung documentation regarding Dynamic variables.

Moorthi Raj
  • 21
  • 1
  • 1
  • 5