As per the SOA architecture Web services are often designed that one of them is a consumer of the other. This often leads to scenarios where the output of one service is fed to the other to complete an overall business flow.
The provider and the consumer service can be loaded simultaneously by JMeter and performance of the system can be measured under the expected load.
Let us create an example where we will be passing the output value from the response of the first request to the input SOAP request of the second web service method.
Step 1: Create a test plan
Step 2: Add a Thread Group
Step 3: Add a User Defined Variable
Step 4: Add a WebService Request
Step 5: Add an XPath extractor
Step 6: Add a BeanShell PostProcessor
Step 7: Add Second WebService Request
Step 8: Add View Results Tree
The provider and the consumer service can be loaded simultaneously by JMeter and performance of the system can be measured under the expected load.
Let us create an example where we will be passing the output value from the response of the first request to the input SOAP request of the second web service method.
Step 1: Create a test plan
Step 2: Add a Thread Group
Step 3: Add a User Defined Variable
Step 4: Add a WebService Request
Step 5: Add an XPath extractor
Step 6: Add a BeanShell PostProcessor
Step 7: Add Second WebService Request
Step 8: Add View Results Tree
Step 1: Create a test plan
In the default test plan that appears on opening the JMeter UI (from JMeter.bat in the bin directory) set the option of 'Functional Test Mode' as true. You may also want to add user defined variables. However for this example I will not be using any user defined variable.
Step 2: Add a Thread Group
Add a Thread Group element by right clicking the test plan node and selecting 'Add-->Threads (Users)-->Thread Group'
Add Thread Group |
You set the loop count to specify how many times do you want each user to hit the web service. If you want to continue loading the web service then you can check the 'Forever' option on the Thread Group element UI.
You can also schedule the load tests by using the 'Scheduler' option provided on the 'Thread Group' UI.
Step 3: Add a User Defined Variable
Right Click on the Thread Group element and select 'Add --> Config Element --> User Defined Variables' to add the 'User Defined Variables' element. On the user defined variables UI screen click on the 'Add' button. Set the 'Name' of the variables and keep the value as blank.
Add User Defined Variable |
Step 4: Add a WebService Request
Right click on the 'Thread Group' element and select ' Add --> Sampler --> WebService (SOAP) Request'
Add Web Service Request |
Copy the SOAP request XML in the 'Soap/XML-RPC Data' text box you provide the path of the file in the 'Filename' section.
Step 5: Add an XPath extractor
Right click on the 'Thread Group' element and select ' Add -->Post Processors --> XPath Extractor'
Add XPath Extractor |
In the Refrence Name section enter the name of the variable that you created in the 'User Defined Variable section'. Enter the XPath query to point to the value which needs to be picked from the XML response. If the value 'TARGET' needs to be picked from the response XML of the format: <ABCD>TARGET</ABCD> then the following XPath query should work:
//*[local-name()='ABCD']/text()
Step 6: Add a BeanShell PostProcessor
Right click on the 'Thread Group' element and select ' Add --> Post Processors --> BeanShell Postpocessor'
Add BeanShell PostProcessor |
You can print the value of the user defined variable that you created above using the below script written for bean shell:
print("Beanshell processing SOAP response");
print("ACQIDD" +${ACQIDD} );
Here the name of the variable created is "ACQIDD" and the value is fetched from ${ACQIDD}.
You can see the value of the variable printed on the command screen that was used to launch the JMeter UI.
Step 7: Add Second WebService Request
Add another webservice request to your thread group element and pass the value of the user defined variable to the input request using the following format:
<value>${ACQIDD}</value>
Step 8: Add View Results Tree
Add a result tree element to the thread group to view the results of the web service requests. After adding the element you can save and run the test plan to see that the output of one SOAP request is read to extract the required value. This value is then passed to another SOAP request. The result tree looks something like this:
Results Tree |
Hi Satyam, Your post is very good and helped me a lot..thanks for sharing your knowledge..
ReplyDeleteThanks for the feedback. Good to know that it helped.
DeleteNice info... Solved my problem...
ReplyDeleteNice presentation, steps are very clear. your post helped me lot. Thank you!!
ReplyDeleteVery nice article!! I would like to know what is the purpose to keep the value blank in user parameter.
ReplyDeleteAt step #3-
>> Set the 'Name' of the variables and keep the value as blank. <<
It signifies that initialization is not required here. Thanks for the appreciation!
DeleteUser Defined Variable is global or local, if not global then how can i define global one
ReplyDeleteThe user defined variables are global within the thread-group and can be access/assigned across multiple objects within the thread group.
DeleteIf values need to be passed across thread-groups I would suggest writing and reading from/to property files.
Thanx can you tell me how we used assertion(any example as u given above.
DeleteIn the above example we can use Add-->Assertions-->Responce Assertion in the main sample(WebService (SOAP) Request) and check the text in the main sample.
DeleteIs there any other way to display the Jmeter Result (other than View result tree). I mean in Browser as we do for JUnit Run and sahi run (result of these two runs can be display in Browser).
DeleteIs there any way so that set of Jmeter script run on interval of every 5 minutes.
ReplyDeletenice share, thanks.
ReplyDeleteThank you!! very clear. This post helped me ..... _/\_
ReplyDeleteHi Satyam,
ReplyDeleteI am new to Jmeter. I am hitting a web service and getting a SOAP response in which i am getting two Id values (within ns2:id tag which is under ns2:config tags> which means that there are two elements for ns2:config.
I need to get these two id values (within ns2:id tag) from both the tags (within ns2:config tags) and give that as input to other SOAP request through loop.
I have tried this by using Regular Expression Extractor.
Reference name : id
Regular Expression : (.+?)
Template : $1$
After which used the ForEach controller and gave the input taken from extractor.
Input variable prefix : id
Output variable name : idValue
And tried to use this idValue to next SOAP request. But not getting the id value in the Regular Expression extractor step itself due to which the second SOAP request is not going at all.
Also tried using BeanShell PostProcessor inside the second web service request but i am not getting second id value.
Any suggestions on this would be highly helpful.
Thanks
Balıkesir
ReplyDeleteBursa
Mersin
Konya
Van
DJE
whatsapp görüntülü show
ReplyDeleteücretli.show
İXU812
whatsapp görüntülü show
ReplyDeleteücretli.show
W5URR
görüntülü.show
ReplyDeletewhatsapp ücretli show
YJW8P
ankara parça eşya taşıma
ReplyDeletetakipçi satın al
antalya rent a car
antalya rent a car
ankara parça eşya taşıma
TNTP
van evden eve nakliyat
ReplyDeletesivas evden eve nakliyat
çankırı evden eve nakliyat
bartın evden eve nakliyat
erzincan evden eve nakliyat
66L
amasya evden eve nakliyat
ReplyDeleteeskişehir evden eve nakliyat
ardahan evden eve nakliyat
manisa evden eve nakliyat
karaman evden eve nakliyat
ORİ8
147F2
ReplyDeleteAğrı Parça Eşya Taşıma
Batman Lojistik
Hatay Lojistik
Iğdır Lojistik
Urfa Evden Eve Nakliyat
33F2D
ReplyDeleteIsparta Parça Eşya Taşıma
Malatya Parça Eşya Taşıma
Malatya Evden Eve Nakliyat
Kayseri Parça Eşya Taşıma
Çanakkale Lojistik
DCACA
ReplyDeleteÇorum Evden Eve Nakliyat
Afyon Evden Eve Nakliyat
Urfa Evden Eve Nakliyat
Amasya Evden Eve Nakliyat
Aydın Evden Eve Nakliyat
4E290
ReplyDeleteErzincan Şehirler Arası Nakliyat
Çerkezköy Boya Ustası
Giresun Şehirler Arası Nakliyat
Adana Parça Eşya Taşıma
Poloniex Güvenilir mi
Ankara Parça Eşya Taşıma
Bitmex Güvenilir mi
Van Şehir İçi Nakliyat
Ordu Şehirler Arası Nakliyat
6AC11
ReplyDeleteTekirdağ Fayans Ustası
Silivri Çatı Ustası
Isparta Lojistik
Trabzon Şehir İçi Nakliyat
Çerkezköy Yol Yardım
Giresun Parça Eşya Taşıma
Erzincan Şehirler Arası Nakliyat
Isparta Evden Eve Nakliyat
Çanakkale Şehirler Arası Nakliyat
4A883
ReplyDeletesteroid cycles for sale
primobolan
order testosterone enanthate
Kars Evden Eve Nakliyat
winstrol stanozolol
deca durabolin
Bolu Evden Eve Nakliyat
buy testosterone propionat
buy testosterone propionat
AA172
ReplyDeletebinance indirim kodu
6019C
ReplyDeleteistanbul kızlarla canlı sohbet
sesli sohbet uygulamaları
adana sohbet odaları
giresun ücretsiz sohbet uygulamaları
sohbet odaları
nevşehir sesli sohbet uygulamaları
sivas sesli sohbet siteler
balıkesir mobil sohbet et
eskişehir kadınlarla sohbet et
7736E
ReplyDeletecanlı sohbet bedava
bedava sohbet
canli goruntulu sohbet siteleri
mersin canlı sohbet siteleri
yabancı sohbet
osmaniye sesli sohbet odası
yalova kadınlarla sohbet
kars canlı sohbet sitesi
istanbul parasız görüntülü sohbet uygulamaları
DCF37
ReplyDeleteeskişehir rastgele canlı sohbet
yabancı sohbet
diyarbakır ücretsiz görüntülü sohbet
yalova yabancı görüntülü sohbet uygulamaları
çorum canlı sohbet uygulamaları
yozgat mobil sohbet chat
rastgele canlı sohbet
ucretsiz sohbet
mersin telefonda kızlarla sohbet
9CDC8
ReplyDeletesakarya bedava görüntülü sohbet
telefonda sohbet
isparta sohbet odaları
osmaniye yabancı görüntülü sohbet uygulamaları
kilis canlı sohbet sitesi
aydın sesli sohbet uygulamaları
kars rastgele görüntülü sohbet
muş görüntülü sohbet kızlarla
ücretsiz sohbet
9C132
ReplyDeleteKastamonu Goruntulu Sohbet
elazığ canli sohbet bedava
sinop telefonda rastgele sohbet
siirt kızlarla rastgele sohbet
Düzce Görüntülü Sohbet Ücretsiz
kırşehir canlı sohbet odası
Denizli Canlı Görüntülü Sohbet Odaları
düzce mobil sohbet odaları
samsun görüntülü sohbet
شركة تنظيف مساجد بالجبيل iaAjUvuvCE
ReplyDeleteشركة تنظيف بخميس مشيط rqnnt4gcw9
ReplyDeleteشركة مكافحة حشرات بالاحساء XLdQA2bGmD
ReplyDeleteافضل شركة تسليك مجاري بالاحساء HUQdfLGvss
ReplyDeleteشركة مكافحة حشرات بالاحساء rr1Vh1fMh7
ReplyDeleteشركة عزل اسطح بالهفوف dJC5EOnjZs
ReplyDelete3645C558E0
ReplyDeletetürk takipçi