Thanks a lot for your reply! Will try to understand the functions to see if I can implement with functions. I want to avoid implementing a custom Sampler if possible.
I have tried making the CSV Data sampler a child of a while logic controller together with the Sampler to be repeated but it still tries to use the data to repeat the Sampler that follows the While controller in the testplan, which should only run once. I have pasted my Test Plan here : http://pastebin.com/0P7bCVTP Kind Regards, Jean On Wed, Aug 15, 2012 at 5:52 PM, Deepak Shetty <[email protected]> wrote: > Hi > I dont remember the scoping rules now (but I believe the CSV config had to > be a child of a while controller or equivalent to do what you want - but my > memory has always been poor :) ) > > In any case it looks like the csvread or stringfromfile functions would > work for you > http://jmeter.apache.org/usermanual/functions.html > > P.S. if you attached your test script it didnt come to the mailing list - > you should upload the script and provide a link to it. > regards > deepak > > On Wed, Aug 15, 2012 at 12:03 AM, Jean FX <[email protected]> wrote: > > > Hello Shaba. > > > > I had tried putting the CSV Data config element in both a Logic > Controller > > and a Sampler. In both case jMeter did not respect this. It repeated > > execution for every line in the csv file even beyond the Logic > > Controller(see my test plan bellow). > > > > Your site does not address this topic. > > > > On Tue, Aug 14, 2012 at 3:17 PM, Shaba K <[email protected]> wrote: > > > > > Yes we can include CSV data config as a child to that sampler. > > > > > > Here's a little write up about JMeter hope it helps. > > > > > > http://automationwithselenium.blogspot.co.uk/2012/01/jmeter-proxy.html > > > > > > cheers, > > > s > > > > > > On Tue, Aug 14, 2012 at 12:50 PM, Jean FX <[email protected]> wrote: > > > > > > > Hello, > > > > > > > > I am a really new user of jMeter. Trying to implement a set of > > functional > > > > tests in one single test plan. > > > > > > > > In this plan, I need to : > > > > > > > > 1- Send a constant XML-RPC request to a server and grab a value from > > the > > > > result(doing this with Xpath Extractor). > > > > 2- Then send a variable number of XML-RPC requests with values coming > > > from > > > > a csv file(Trying to use a CSV Data config for this) > > > > 3- Finally, send another last XML-RPC request only once. > > > > > > > > It all works as expected (almost) but the last XML-RPC request is > > > repeated > > > > for every line in the CSV Data config file. > > > > > > > > Is it possible to restrict the CSV Data config element to a specific > > > > Sampler or even Logic Controller? > > > > > > > > Thanks in advance, > > > > Jean > > > > > > > > Bellow My current test plan: > > > > > > > > > > > > <?xml version="1.0" encoding="UTF-8"?> > > > > <jmeterTestPlan version="1.2" properties="2.3"> > > > > <hashTree> > > > > <TestPlan guiclass="TestPlanGui" testclass="TestPlan" > > > > testname="ATPZero" enabled="true"> > > > > <stringProp name="TestPlan.comments"></stringProp> > > > > <boolProp name="TestPlan.functional_mode">true</boolProp> > > > > <boolProp > name="TestPlan.serialize_threadgroups">false</boolProp> > > > > <elementProp name="TestPlan.user_defined_variables" > > > > elementType="Arguments" guiclass="ArgumentsPanel" > testclass="Arguments" > > > > testname="User Defined Variables" enabled="true"> > > > > <collectionProp name="Arguments.arguments"> > > > > <elementProp name="MSISDN" elementType="Argument"> > > > > <stringProp name="Argument.name">MSISDN</stringProp> > > > > <stringProp name="Argument.value">66349528</stringProp> > > > > <stringProp name="Argument.metadata">=</stringProp> > > > > </elementProp> > > > > <elementProp name="volDA" elementType="Argument"> > > > > <stringProp name="Argument.name">volDA</stringProp> > > > > <stringProp name="Argument.value">17</stringProp> > > > > <stringProp name="Argument.metadata">=</stringProp> > > > > </elementProp> > > > > <elementProp name="countDA" elementType="Argument"> > > > > <stringProp name="Argument.name">countDA</stringProp> > > > > <stringProp name="Argument.value">29</stringProp> > > > > <stringProp name="Argument.metadata">=</stringProp> > > > > </elementProp> > > > > <elementProp name="bonusDA" elementType="Argument"> > > > > <stringProp name="Argument.name">bonusDA</stringProp> > > > > <stringProp name="Argument.value">42</stringProp> > > > > <stringProp name="Argument.metadata">=</stringProp> > > > > </elementProp> > > > > <elementProp name="MSISDN1" elementType="Argument"> > > > > <stringProp name="Argument.name">MSISDN1</stringProp> > > > > <stringProp name="Argument.value">66349528</stringProp> > > > > <stringProp name="Argument.metadata">=</stringProp> > > > > </elementProp> > > > > </collectionProp> > > > > </elementProp> > > > > <stringProp name="TestPlan.user_define_classpath"></stringProp> > > > > </TestPlan> > > > > <hashTree> > > > > <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" > > > > testname="AutoTester" enabled="true"> > > > > <elementProp name="ThreadGroup.main_controller" > > > > elementType="LoopController" guiclass="LoopControlPanel" > > > > testclass="LoopController" testname="Loop Controller" enabled="true"> > > > > <boolProp > > > name="LoopController.continue_forever">false</boolProp> > > > > <stringProp name="LoopController.loops">20</stringProp> > > > > </elementProp> > > > > <stringProp name="ThreadGroup.num_threads">1</stringProp> > > > > <stringProp name="ThreadGroup.ramp_time">1</stringProp> > > > > <longProp > > name="ThreadGroup.start_time">1344265518000</longProp> > > > > <longProp > name="ThreadGroup.end_time">1344265518000</longProp> > > > > <boolProp name="ThreadGroup.scheduler">false</boolProp> > > > > <stringProp > > > > name="ThreadGroup.on_sample_error">continue</stringProp> > > > > <stringProp name="ThreadGroup.duration"></stringProp> > > > > <stringProp name="ThreadGroup.delay"></stringProp> > > > > </ThreadGroup> > > > > <hashTree> > > > > <HeaderManager guiclass="HeaderPanel" > testclass="HeaderManager" > > > > testname="HeaderTestLab" enabled="true"> > > > > <collectionProp name="HeaderManager.headers"> > > > > <elementProp name="" elementType="Header"> > > > > <stringProp name="Header.name">User-Agent</stringProp> > > > > <stringProp name="Header.value">UGw > > > > Server/4.1/1.0</stringProp> > > > > </elementProp> > > > > <elementProp name="" elementType="Header"> > > > > <stringProp > name="Header.name">Content-Type</stringProp> > > > > <stringProp name="Header.value">text/xml</stringProp> > > > > </elementProp> > > > > <elementProp name="" elementType="Header"> > > > > <stringProp > name="Header.name">Authorization</stringProp> > > > > <stringProp name="Header.value">Basic > > > > 2hda-=asfafaad1</stringProp> > > > > </elementProp> > > > > </collectionProp> > > > > <stringProp name="TestPlan.comments">default ucip headers > for > > > > pssim</stringProp> > > > > </HeaderManager> > > > > <hashTree/> > > > > <GenericController guiclass="LogicControllerGui" > > > > testclass="GenericController" testname="BatchRequests" > enabled="true"/> > > > > <hashTree> > > > > <SoapSampler guiclass="SoapSamplerGui" > > testclass="SoapSampler" > > > > testname="PingUser" enabled="true"> > > > > <elementProp name="HTTPsampler.Arguments" > > > > elementType="Arguments"> > > > > <collectionProp name="Arguments.arguments"/> > > > > </elementProp> > > > > <stringProp name="SoapSampler.URL_DATA"> > > > > http://192.168.101.120:10010/Air</stringProp> > > > > <stringProp name="HTTPSamper.xml_data"><?xml > > > > version="1.0" encoding="UTF-8"?> > > > > <methodCall> > > > > <methodName>GetBalanceAndDate</methodName> > > > > <params> > > > > <param> > > > > <value> > > > > <struct> > > > > <member> > > > > <name>originNodeType</name> > > > > <value> > > > > <string>EXT</string> > > > > </value> > > > > </member> > > > > <member> > > > > <name>originHostName</name> > > > > <value> > > > > <string>USSDGW</string> > > > > </value> > > > > </member> > > > > <member> > > > > <name>originTransactionID</name> > > > > <value> > > > > <string>2012080619175629676</string> > > > > </value> > > > > </member> > > > > <member> > > > > <name>originTimeStamp</name> > > > > <value> > > > > > > > > > <dateTime.iso8601>20120806T19:17:56+0500</dateTime.iso8601> > > > > </value> > > > > </member> > > > > <member> > > > > <name>subscriberNumberNAI</name> > > > > <value> > > > > <i4>1</i4> > > > > </value> > > > > </member> > > > > <member> > > > > <name>subscriberNumber</name> > > > > <value> > > > > <string>${msisdn}</string> > > > > </value> > > > > </member> > > > > </struct> > > > > </value> > > > > </param> > > > > </params> > > > > </methodCall> > > > > </stringProp> > > > > <stringProp > name="SoapSampler.xml_data_file"></stringProp> > > > > <stringProp name="SoapSampler.SOAP_ACTION"></stringProp> > > > > <stringProp > > > > name="SoapSampler.SEND_SOAP_ACTION">false</stringProp> > > > > <boolProp > name="HTTPSampler.use_keepalive">false</boolProp> > > > > </SoapSampler> > > > > <hashTree> > > > > <XPathAssertion guiclass="XPathAssertionGui" > > > > testclass="XPathAssertion" testname="responseOK" enabled="true"> > > > > <boolProp name="XPath.negate">false</boolProp> > > > > <stringProp > > > > name="XPath.xpath">//member[name="responseCode" and > > > > value/*=0]</stringProp> > > > > <boolProp name="XPath.validate">false</boolProp> > > > > <boolProp name="XPath.whitespace">false</boolProp> > > > > <boolProp name="XPath.tolerant">false</boolProp> > > > > <boolProp name="XPath.namespace">false</boolProp> > > > > </XPathAssertion> > > > > <hashTree/> > > > > <XPathExtractor guiclass="XPathExtractorGui" > > > > testclass="XPathExtractor" testname="GetResponseCode" enabled="true"> > > > > <stringProp name="TestPlan.comments">contains the > > response > > > > code</stringProp> > > > > <stringProp > > name="XPathExtractor.default">100</stringProp> > > > > <stringProp > > > name="XPathExtractor.refname">rCode</stringProp> > > > > <stringProp > > > > > > > > > > > > > > name="XPathExtractor.xpathQuery">//member[name="responseCode"]/value/*[1]</stringProp> > > > > <boolProp > name="XPathExtractor.tolerant">false</boolProp> > > > > <boolProp > name="XPathExtractor.namespace">true</boolProp> > > > > <boolProp > name="XPathExtractor.validate">false</boolProp> > > > > </XPathExtractor> > > > > <hashTree/> > > > > </hashTree> > > > > <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" > > > > testname="ListOfUsers" enabled="true"> > > > > <stringProp > > > > name="filename">/home/jean/Integration/testmses.csv</stringProp> > > > > <stringProp name="fileEncoding"></stringProp> > > > > <stringProp > > > > > name="variableNames">msisdn,volDa,volVal,countDa,countVal</stringProp> > > > > <stringProp name="delimiter">,</stringProp> > > > > <boolProp name="quotedData">false</boolProp> > > > > <boolProp name="recycle">true</boolProp> > > > > <boolProp name="stopThread">false</boolProp> > > > > <stringProp name="shareMode">All threads</stringProp> > > > > </CSVDataSet> > > > > <hashTree/> > > > > </hashTree> > > > > <SoapSampler guiclass="SoapSamplerGui" > testclass="SoapSampler" > > > > testname="GetAccountDetails" enabled="true"> > > > > <elementProp name="HTTPsampler.Arguments" > > > > elementType="Arguments"> > > > > <collectionProp name="Arguments.arguments"/> > > > > </elementProp> > > > > <stringProp name="SoapSampler.URL_DATA"> > > > > http://192.168.101.120:10010/Air</stringProp> > > > > <stringProp name="HTTPSamper.xml_data"><?xml > > > > version="1.0" encoding="UTF-8"?> > > > > <methodCall> > > > > <methodName>GetAccountDetails</methodName> > > > > <params> > > > > <param> > > > > <value> > > > > <struct> > > > > <member> > > > > <name>originNodeType</name> > > > > <value> > > > > <string>${originNodeType}</string> > > > > </value> > > > > </member> > > > > <member> > > > > <name>originHostName</name> > > > > <value> > > > > <string>${originHostName}</string> > > > > </value> > > > > </member> > > > > <member> > > > > <name>originTransactionID</name> > > > > <value> > > > > <string>${transaction_id}</string> > > > > </value> > > > > </member> > > > > <member> > > > > <name>originTimeStamp</name> > > > > <value> > > > > > > > <dateTime.iso8601>${timestamp}</dateTime.iso8601> > > > > </value> > > > > </member> > > > > <member> > > > > <name>subscriberNumberNAI</name> > > > > <value> > > > > <i4>${subscriberNumberNAI}</i4> > > > > </value> > > > > </member> > > > > <member> > > > > <name>subscriberNumber</name> > > > > <value> > > > > <string>${subscriberNumber}</string> > > > > </value> > > > > </member> > > > > <member> > > > > <name>requestedInformationFlags</name> > > > > <value> > > > > <struct> > > > > <member> > > > > > > > <name>requestMasterAccountBalanceFlag</name> > > > > <value> > > > > <boolean>1</boolean> > > > > </value> > > > > </member> > > > > </struct> > > > > </value> > > > > </member> > > > > </struct> > > > > </value> > > > > </param> > > > > </params> > > > > </methodCall></stringProp> > > > > <stringProp name="SoapSampler.xml_data_file"></stringProp> > > > > <stringProp name="SoapSampler.SOAP_ACTION"></stringProp> > > > > <stringProp > > > > name="SoapSampler.SEND_SOAP_ACTION">false</stringProp> > > > > <boolProp name="HTTPSampler.use_keepalive">false</boolProp> > > > > </SoapSampler> > > > > <hashTree> > > > > <XPathAssertion guiclass="XPathAssertionGui" > > > > testclass="XPathAssertion" testname="responseOK" enabled="true"> > > > > <boolProp name="XPath.negate">false</boolProp> > > > > <stringProp > > > > name="XPath.xpath">//member[name="responseCode" and > > > > value/*=0]</stringProp> > > > > <boolProp name="XPath.validate">false</boolProp> > > > > <boolProp name="XPath.whitespace">false</boolProp> > > > > <boolProp name="XPath.tolerant">false</boolProp> > > > > <boolProp name="XPath.namespace">false</boolProp> > > > > </XPathAssertion> > > > > <hashTree/> > > > > <XPathExtractor guiclass="XPathExtractorGui" > > > > testclass="XPathExtractor" testname="GetResponseCode" enabled="true"> > > > > <stringProp name="TestPlan.comments">contains the > response > > > > code</stringProp> > > > > <stringProp > name="XPathExtractor.default">100</stringProp> > > > > <stringProp > > name="XPathExtractor.refname">rCode2</stringProp> > > > > <stringProp > > > > > > > > > > > > > > name="XPathExtractor.xpathQuery">//member[name="responseCode"]/value/*[1]</stringProp> > > > > <boolProp name="XPathExtractor.tolerant">false</boolProp> > > > > <boolProp name="XPathExtractor.namespace">true</boolProp> > > > > <boolProp name="XPathExtractor.validate">false</boolProp> > > > > </XPathExtractor> > > > > <hashTree/> > > > > </hashTree> > > > > <ResultCollector guiclass="ViewResultsFullVisualizer" > > > > testclass="ResultCollector" testname="View Results Tree" > > enabled="true"> > > > > <boolProp > > name="ResultCollector.error_logging">false</boolProp> > > > > <objProp> > > > > <name>saveConfig</name> > > > > <value class="SampleSaveConfiguration"> > > > > <time>true</time> > > > > <latency>true</latency> > > > > <timestamp>true</timestamp> > > > > <success>true</success> > > > > <label>true</label> > > > > <code>true</code> > > > > <message>true</message> > > > > <threadName>true</threadName> > > > > <dataType>true</dataType> > > > > <encoding>false</encoding> > > > > <assertions>true</assertions> > > > > <subresults>true</subresults> > > > > <responseData>false</responseData> > > > > <samplerData>false</samplerData> > > > > <xml>true</xml> > > > > <fieldNames>false</fieldNames> > > > > <responseHeaders>false</responseHeaders> > > > > <requestHeaders>false</requestHeaders> > > > > <responseDataOnError>false</responseDataOnError> > > > > > > > > > > > > > > > > > > <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage> > > > > <assertionsResultsToSave>0</assertionsResultsToSave> > > > > <bytes>true</bytes> > > > > </value> > > > > </objProp> > > > > <stringProp name="filename"></stringProp> > > > > </ResultCollector> > > > > <hashTree/> > > > > </hashTree> > > > > </hashTree> > > > > </hashTree> > > > > </jmeterTestPlan> > > > > > > > > > >
