In this post we will see how to script a Rest API call in load runner.
Rest API details:
URL : https://10.36.133.105:8104/belocc/v2/belea/dealer/B1234/rep/B1234/smsession/10/consignments?access_token=800004e-c7ca-400b-9004-48c8aef00000
Method Type:
POST (Apart from POST other methods used in Rest API's are GET, PUT, PATCH & DELETE)
Mode: HTTP
Encoding Type: application/json
Request Body:
{
"code":"0032906789",
"entries":[
{
"CEntryNumber":"",
"orderEntry":{
"entryNumber":"1",
"quantity":"2"
}
}
]
}
Convert the Request body to the below loadrunner format (i.e) place '\' before every '"'.
{\"code\":\"0032906789\",\"entries\":[{\"CEntryNumber\":\"\",\"orderEntry\":{\"entryNumber\":\"1\",\"quantity\":\"2\"}}]}
save the formatted request body in a character pointer.
char *JsonReqInit;
char *JsonReqFinal;
JsonReqInit = "{\"code\":\"0032906789\",\"entries\":[{\"CEntryNumber\":\"\",\"orderEntry\":{\"entryNumber\":\"1\",\"quantity\":\"2\"}}]}"; //save the string in a C variable.
lr_save_string(lr_eval_string(JsonReqInit),"JsonReqFinal");
Goto Design --> Insert in Script --> New Step
Then Steps Tool search window will open in the right pane, search for web_custom_request and open it.
Enter the details in each field and click ok. Below request will get generated in the script.
web_custom_request("Rest_API",
"URL=https://10.36.133.105:8104/belocc/v2/belea/dealer/B1234/rep/B1234/smsession/10/consignments?access_token=800004e-c7ca-400b-9004-48c8aef00000",
"Method=POST",
"TargetFrame=",
"Resource=0",
"Referer=",
"Mode=HTTP",
"EncType=application/json",
"Body={JsonReqFinal}", //Pass the variable in the body of the web_custom_request.
LAST);
Rest API details:
URL : https://10.36.133.105:8104/belocc/v2/belea/dealer/B1234/rep/B1234/smsession/10/consignments?access_token=800004e-c7ca-400b-9004-48c8aef00000
Method Type:
POST (Apart from POST other methods used in Rest API's are GET, PUT, PATCH & DELETE)
Mode: HTTP
Encoding Type: application/json
Request Body:
{
"code":"0032906789",
"entries":[
{
"CEntryNumber":"",
"orderEntry":{
"entryNumber":"1",
"quantity":"2"
}
}
]
}
Convert the Request body to the below loadrunner format (i.e) place '\' before every '"'.
{\"code\":\"0032906789\",\"entries\":[{\"CEntryNumber\":\"\",\"orderEntry\":{\"entryNumber\":\"1\",\"quantity\":\"2\"}}]}
save the formatted request body in a character pointer.
char *JsonReqInit;
char *JsonReqFinal;
JsonReqInit = "{\"code\":\"0032906789\",\"entries\":[{\"CEntryNumber\":\"\",\"orderEntry\":{\"entryNumber\":\"1\",\"quantity\":\"2\"}}]}"; //save the string in a C variable.
Goto Design --> Insert in Script --> New Step
Then Steps Tool search window will open in the right pane, search for web_custom_request and open it.
Enter the details in each field and click ok. Below request will get generated in the script.
web_custom_request("Rest_API",
"URL=https://10.36.133.105:8104/belocc/v2/belea/dealer/B1234/rep/B1234/smsession/10/consignments?access_token=800004e-c7ca-400b-9004-48c8aef00000",
"Method=POST",
"TargetFrame=",
"Resource=0",
"Referer=",
"Mode=HTTP",
"EncType=application/json",
"Body={JsonReqFinal}", //Pass the variable in the body of the web_custom_request.
LAST);
Thank you because you have been willing to share information with us. we will always appreciate all you have done here because I know you are very concerned with our.
ReplyDeleteSoftware Testing Services
Functional Testing Services
Test Automation Services
QA Automation Testing Services
Regression Testing Services
API Testing Services
Compatibility Testing Services
Performance Testing Services
Security Testing Services
Vulnerability Testing Services
Functional Testing Services
IntelliMindz is a best IT Training in Bangalore with placement, offering 200 and more software courses with 100% Placement Assistance.
ReplyDeleteLoadrunner Training In Bangalore
Test-Complete Training In Bangalore
SDET Training In Bangalore
Splunk Training In Bangalore
Power Bi Course In Bangalore
Building Estimate And Costing Course In Bangalore
IntelliMindz is a best IT Training in Bangalore with placement, offering 200 and more software courses with 100% Placement Assistance.
ReplyDeleteETL Testing Course In Bangalore
Selenium Training In Bangalore
Java Training In Bangalore
Loadrunner Training In Bangalore
Test-Complete Training In Bangalore
düzce
ReplyDeletesakarya
tunceli
van
bayburt
ZX6
görüntülü.show
ReplyDeletewhatsapp ücretli show
EFM2RE
whatsapp görüntülü show
ReplyDeleteücretli.show
SPYRİZ
görüntülü.show
ReplyDeletewhatsapp ücretli show
XVX
https://titandijital.com.tr/
ReplyDeleteısparta parça eşya taşıma
ankara parça eşya taşıma
izmir parça eşya taşıma
diyarbakır parça eşya taşıma
UOBU26
ACAA9
ReplyDeleteBinance Referans Kodu
Tekirdağ Cam Balkon
Kars Evden Eve Nakliyat
Çanakkale Evden Eve Nakliyat
Ünye Evden Eve Nakliyat
C6392
ReplyDeleteParibu Güvenilir mi
Eryaman Alkollü Mekanlar
Bolu Evden Eve Nakliyat
Kastamonu Evden Eve Nakliyat
Bilecik Evden Eve Nakliyat
B63F9
ReplyDeleteUrfa Lojistik
Niğde Lojistik
Giresun Şehir İçi Nakliyat
Ordu Evden Eve Nakliyat
Sincan Fayans Ustası
Bartın Parça Eşya Taşıma
Bybit Güvenilir mi
Çankaya Parke Ustası
Silivri Parke Ustası
4D40C
ReplyDeleteAfyon Şehir İçi Nakliyat
Manisa Lojistik
Osmo Coin Hangi Borsada
Gölbaşı Boya Ustası
Tekirdağ Evden Eve Nakliyat
Kırklareli Evden Eve Nakliyat
Çorlu Lojistik
Kalıcı Makyaj
Bitget Güvenilir mi
5048C
ReplyDeletesohbet muhabbet
izmir yabancı sohbet
kars canlı sohbet siteleri
Ağrı Canlı Görüntülü Sohbet Siteleri
malatya bedava sohbet chat odaları
Giresun Sohbet Siteleri
kırklareli telefonda görüntülü sohbet
edirne en iyi ücretsiz görüntülü sohbet siteleri
Ankara Sohbet Sitesi
4A24B
ReplyDeleteagri rastgele görüntülü sohbet
çorum sohbet siteleri
kocaeli bedava görüntülü sohbet
canlı sohbet siteleri ücretsiz
Nevşehir Telefonda Görüntülü Sohbet
siirt en iyi ücretsiz sohbet uygulamaları
sesli sohbet mobil
canlı görüntülü sohbet siteleri
Urfa Kadınlarla Rastgele Sohbet
1BB60
ReplyDeletesivas görüntülü canlı sohbet
afyon canlı sohbet et
Sivas Telefonda Rastgele Sohbet
rastgele sohbet
canlı ücretsiz sohbet
Aydın Mobil Sohbet
canlı sohbet odası
Aydın Canli Sohbet
antalya kadınlarla sohbet et
29C3A
ReplyDeletenanytoo sohbet
yabancı sohbet
Osmaniye Sohbet Muhabbet
muş sesli görüntülü sohbet
tunceli mobil sohbet bedava
canlı ücretsiz sohbet
chat sohbet
canli sohbet chat
Bilecik Görüntülü Sohbet Sitesi
FE8BC
ReplyDeletePi Network Coin Hangi Borsada
Jns Coin Hangi Borsada
Binance Sahibi Kim
Spotify Dinlenme Hilesi
Instagram Beğeni Satın Al
Kripto Para Kazanma
Referans Kimliği Nedir
Osmo Coin Hangi Borsada
Bitcoin Yatırımı Nasıl Yapılır
EE21E
ReplyDeleteOsmo Coin Hangi Borsada
Btcst Coin Hangi Borsada
Youtube Beğeni Satın Al
Bitcoin Nasıl Üretilir
Ort Coin Hangi Borsada
Madencilik Nedir
Binance Referans Kodu
Coin Kazanma
Binance Madenciliği Nedir
29C47
ReplyDeleteFacebook Sayfa Beğeni Hilesi
Shibanomi Coin Hangi Borsada
Lovely Coin Hangi Borsada
Twitter Retweet Hilesi
Kripto Para Nasıl Kazılır
Discord Sunucu Üyesi Hilesi
Bitcoin Çıkarma
Azero Coin Hangi Borsada
Cate Coin Hangi Borsada
891FC
ReplyDeleteClysterum Coin Hangi Borsada
Bitcoin Madenciliği Siteleri
Vector Coin Hangi Borsada
Area Coin Hangi Borsada
Coin Nasıl Oynanır
Loop Network Coin Hangi Borsada
Bitcoin Kazanma Siteleri
Onlyfans Beğeni Satın Al
Trovo Takipçi Satın Al
EAF38
ReplyDeleteLunc Coin Hangi Borsada
Binance Sahibi Kim
Nexa Coin Hangi Borsada
Tiktok Beğeni Satın Al
Chat Gpt Coin Hangi Borsada
Bitcoin Nasıl Oynanır
Soundcloud Reposts Hilesi
Pinterest Takipçi Hilesi
Btcturk Borsası Güvenilir mi
8F6FC
ReplyDeletedefilama
looksrare
poocoin
galagames
poocoin
safepal
phantom
avax
uwu lend
افضل شركة تسليك مجاري بالاحساء a17FSf8fjr
ReplyDelete