[英]Embedded Erlang in Tsung.xml Dynamic Variable fails to parse for If expressions
[英]Dynamic variable on Tsung XML config file
我已經設置了TSUNG(v1.7)來測試我的應用程序,但是在HTTP請求上使用動態變量時遇到了一些問題。 更精確地說,我需要從CSV文件中檢索一些數據並將其插入我的請求中。
在閱讀文檔時,由於使用的版本高於1.3,因此似乎並不需要編寫任何函數,因此,只需在'option'標記上指定文件路徑並使用“ setdynvars”,但不幸的是它似乎不起作用(Web服務器響應說內容為空)。 知道為什么嗎?
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/home/Desktop/tsung-1.7.0/tsung-1.0.dtd">
<tsung loglevel="warning">
<clients>
<client host="localhost" use_controller_vm="true"/>
</clients>
<servers>
<server host="127.0.0.1" port="8000" type="tcp"/>
</servers>
<load>
<arrivalphase phase="1" duration="2" unit="minute">
<users interarrival="45" unit="second"/>
</arrivalphase>
</load>
<options>
<option name="file_server" id="transactions" value="/home/Desktop/transactions.csv"/>
</options>
<sessions>
<session name="dummy" weight="1" type="ts_http">
<setdynvars sourcetype="file" fileid="transactions" delimiter=";" order="iter">
<var name="number_transaction"/>
</setdynvars>
<request>
<http url="...path..." method="GET" version="1.1"></http>
</request>
<request subst="true">
<http url='...path...' version='1.1' contents='transaction_id=%%_number_transaction%%' content_type='application/x-www-fomr-urlencoded' method='POST'></http>
</request>
</session>
</sessions>
</tsung>
經過一番嘗試,我發現只需從請求中刪除屬性content_type
,它將使整個配置工作!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.