2014-01-23 151 views
1

我想通過iMe​​ter Soap/XML-RPC數據測試SOAP功能。邏輯很簡單,我傳遞一個用戶標識並想要返回用戶配置文件。我想測試100個用戶,用戶ID從1到100.並且我想創建50個線程,每個線程通過這100個ID運行2個小時。我的問題是如何讓jMeter調用所有這100個用戶請求。請求XML是這樣的。我是否應該創建100個這樣的xml請求,ID爲1到100?多個請求的jMeter肥皂測試

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://server.smartleads.alliancetech.com" xmlns:data="http://data.post.server.smartleads.alliancetech.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <soapenv:Header/> 
    <soapenv:Body> 
    <ser:getRegistration> 
     <ser:aaGetRegReqObj> 
      <data:action>0</data:action> 
      <data:version xsi:nil="true"/> 
      <data:debug>true</data:debug> 
      <data:id>55</data:id> 
     </ser:aaGetRegReqObj> 
    </ser:getRegistration> 
    </soapenv:Body> 
</soapenv:Envelope> 
+0

對不起,我在我的問題中犯了一個錯誤,用戶實際上是一個隨機數+ char組合,它不僅僅是從1到100。我很抱歉我的錯誤。在這種情況下,我應該怎麼做?謝謝! – topcan5

回答

2

1的簡單循環到100 SOAP/XML取樣:

循環:
http://2min2code.com/articles/jmeter_intro/loop_controller

SOAP/XML:
http://jmeter.apache.org/usermanual/component_reference.html#SOAP/XML-RPC_Request

它看起來像你剛剛開始使用JMeter,下面是JMeter入門視頻教程:
http://blazemeter.com/blog/jmeter-tutorial-video-series

+0

謝謝你的幫助。對不起,我在我的問題中犯了一個錯誤,用戶實際上是一個隨機數+ char組合,它不僅僅是從1到100。我很抱歉我的錯誤。在這種情況下,我應該怎麼做?謝謝! – topcan5

2

有很多方法來實現你的目標。他們中的一些:

  1. 使用__counter()功能
  2. 使用配置emelment - Counter

例如,如果你使用計數器,其配置是這樣的: counterExample

然後,請在您的要求中使用指定的參考名稱:

<ser:aaGetRegReqObj> 
      <data:action>0</data:action> 
      <data:version xsi:nil="true"/> 
      <data:debug>true</data:debug> 
      <data:id>${userId}</data:id> 
     </ser:aaGetRegReqObj> 
+0

謝謝你的幫助。對不起,我在我的問題中犯了一個錯誤,用戶實際上是一個隨機數+ char組合,它不僅僅是從1到100。我很抱歉我的錯誤。在這種情況下,我應該怎麼做?謝謝! – topcan5

+0

你可以使用__random()函數 - http://jmeter.apache.org/usermanual/functions.html#__Random – Jay

+0

或__RandomString()函數 - http://jmeter.apache.org/usermanual/functions.html#__RandomString – Jay

1

我想我會在這種情況下使用CSV數據集配置。謝謝大家!