Software Benchmarks and Benchmarking: What is the way to use dynamic contents in XML using CSV file so that the XML can be send as HTTP Request in JMeter for RESTful service?
-
For more clarity on the question, I need to send a XML to be processed by RESTful service using JMeter. The dynamic content of the XML is <OrderNumber>${__CSVRead(CO1.csv,0)}</OrderNumber> where CSVRead() function used to get the N number of order number from CSV file. Use of JMeter and problem faced on it are mention below: 1. JMeter 2.9 version 2. Thread Group used to simulate users. 3. CSV file used for CSV Data Set Config. 4. HTTP Request Sampler used where the REST URL and file location which is used for send files With Request are assigned. Issue: The dynamic variable is used in the Request file ( XML) and the variable is not replaced runtime as mentioned in the CSV file. I need help how to pass the dynamic values in the Request XML while calling REST services. Thanks Abhijit
-
Answer:
One solutions I can think of is: Generate XML along with any variables and put that in a variable with vars.put("payLoad", xmlContent) after the Sampler ran. This should be written in the BeanShell post processor. Then, use this variable in the next sampler with variable name `${payLoad}`. I have done this to generate dynamic JSON POST request, from both JSON and Binary Responses.
Kishan Krol at Quora Visit the source
Related Q & A:
- How can you view an HTTP request in transit?Best solution by Information Security
- How to read csv file using php?Best solution by Stack Overflow
- How to skip columns empty in CSV file when importing into MySQL table using LOAD DATA INFILE?Best solution by Stack Overflow
- How can I send an http request at a specific time?Best solution by Stack Overflow
- How can i export my contacts to a csv file?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.