Friday, February 28, 2020

Performance test script creation for GraphQL API calls using Jmeter and Loadrunner

Suppose, the application doesn’t have user interface and the application works based on the end point URL and the message posted through body of the request. The application team provides the API calls which are using GraphQL and application team wanted to do performance testing for those API calls. You can follow the below approach for developing script

Pre-requisites:
  1. URL
  2. Headers
  3. Body message (its applicable only for POST or PUT method)
  4. Format of the body message (In this case, GraphQL). 

Step #1 : Validate the API call manually using Postman.
  • Create the POST request in Postman 
  • Update URL, Method, Headers like below


     The below example shows POST method. Hence, it is required body message as well.      

         Send the request (click on Send button). You will get the response for that API call.
         
    
    
In Postman, Click on Code -> Select cURL in Filter Language and Copy the raw message shown in the below picture         

Step #2: Now you have valid API call details. Let us start scripting in Loadrunner now.
Open Virtual User Generator -> Click on New -> Select Web - HTML/HTTP protocol







Step #3: Insert the new step (web_custom_request) and provide URL, Method an Body message.




















Step #4: Include the header details in the script















Step #5: Execute the script











Now, you will see the same response message in both loadrunner and Postman.

NOTE: The difference between raw message format and Graph QL message format in Loadrunner is, just to add "{"query":" before the body message and "}" after the message.

Let us see how we can create the script using Jmeter now. 
Step #1: Open Jmeter -> Create new test plan -> Create new thread group -> Create HTTP sampler













Step #2: Add Header Manager under HTTP Sampler












Step #3: Add Listener (View Results Tree) under Thread Group













Step #4: Update URL, Path and Paste the message copied from Postman (refer Postman pictures) in HTTP Sampler Body











Step #5: Add the headers in HTTP Header Manager








Step #6: Run the script. Check the response in View Results Tree 









The result is same as Postman result. 

Simple ๐Ÿ˜€. Isn't it??

37 comments:

  1. it really helped me at right time...
    Your explanation and screenshots are perfect.

    ReplyDelete
  2. I found that site very usefull and this survey is very cirious, I ' ve never seen a blog that demand a survey for this actions, very curious https://soap2day.shop

    ReplyDelete
  3. Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too. https://soaptoday.website

    ReplyDelete
  4. Positive site, where did u come up with the information on this posting? I'm pleased I discovered it though, ill be checking back soon to find out what additional posts you include.
    https://watchcouchtuner.website

    ReplyDelete
  5. Remarkable article, it is particularly useful! I quietly began in this, and I'm becoming more acquainted with it better! Delights, keep doing more and extra impressive! https://newputlocker.website

    ReplyDelete
  6. Remarkable article, it is particularly useful! I quietly began in this, and I'm becoming more acquainted with it better! Delights, keep doing more and extra impressive https://watchcouchtuner.space

    ReplyDelete
  7. Remarkable article, it is particularly useful! I quietly began in this, and I'm becoming more acquainted with it better! Delights, keep doing more and extra impressive https://theprimewire.site/

    ReplyDelete
  8. i read a lot of stuff and i found that the way of writing to clearifing that exactly want to say was very good so i am impressed and ilike to come again in future.. INDIA MEDICAL VISA

    ReplyDelete
  9. If you are looking for more information about flat rate locksmith Las Vegas check that right away. Turkey Tourist Visa

    ReplyDelete
  10. I've proper selected to build a blog, which I hold been deficient to do for a during. Acknowledges for this information, it's serviceable! Serlรชdana Vรฎzaya Kanada Serhรชl

    ReplyDelete
  11. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. india visa from norway

    ReplyDelete
  12. For true fans of this thread I will address is a free online! ๊ฝ๋จธ๋‹ˆ์‚ฌ์ดํŠธ

    ReplyDelete
  13. Thanks for writing such a good article, I stumbled onto your blog and read a few post. I like your style of writing... ๋จนํŠ€๊ฒ€์ฆ์‚ฌ์ดํŠธ

    ReplyDelete
  14. Yes, I am entirely agreed with this article, and I just want say that this article is very helpful and enlightening. I also have some precious piece of concerned info !!!!!!Thanks. ๋จนํŠ€๊ฒ€์ฆ

    ReplyDelete
  15. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. ฮคฮฟฯ…ฯฮนฯƒฯ„ฮนฮบฮฎ ฮ’ฮฏฮถฮฑ ฮšฮฑฮฝฮฑฮดฮฌ

    ReplyDelete
  16. It is rather very good, nevertheless glance at the data with this handle. ๋จนํŠ€๊ฒ€์ฆ์‚ฌ์ดํŠธ

    ReplyDelete
  17. I can recommend primarily decent and even responsible tips, as a result, view it: beylikduzu eskort

    ReplyDelete
  18. Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work. ํ† ํ† 114

    ReplyDelete
  19. Gives you the best website address I know there alone you'll find how easy it is. pggame

    ReplyDelete
  20. Great article with excellent idea!Thank you for such a valuable article. I really appreciate for this great information.. ๊ฝ๋จธ๋‹ˆ์‚ฌ์ดํŠธ

    ReplyDelete
  21. This is very appealing, however , it is very important that will mouse click on the connection: ์ฑ”ํ”ผ์–ธ๊ฒŒ์ž„

    ReplyDelete
  22. I might suggest solely beneficial in addition to trusted facts, and so find it: ํ† ํ† ์ปค๋ฎค๋‹ˆํ‹ฐ

    ReplyDelete
  23. On that website page, you'll see your description, why not read through this. ํ† ํ† ์‚ฌ์ดํŠธ

    ReplyDelete
  24. I'm glad I found this web site, I couldn't find any knowledge on this matter prior to.Also operate a site and if you are ever interested in doing some visitor writing for me if possible feel free to let me know, im always look for people to check out my web site. ์บ๋‚˜๋‹ค ๊ด€๊ด‘ ๋น„์ž

    ReplyDelete
  25. On my website you'll see similar texts, write what you think. Deutscher Hosting

    ReplyDelete
  26. For many people, this is the best solution here see how to do it. interlining fabric

    ReplyDelete
  27. It is a fantastic post – immense clear and easy to understand. I am also holding out for the sharks too that made me laugh. http://www.2tua99.com

    ReplyDelete
  28. This comment has been removed by the author.

    ReplyDelete
  29. I was surfing the Internet for information and came across your blog. I am impressed by the information you have on this blog. It shows how well you understand this subject. best internet provider toronto

    ReplyDelete
  30. Great article with excellent idea!Thank you for such a valuable article. I really appreciate for this great information.. Brede keuze steigerwielen

    ReplyDelete
  31. Believe it or not, it is the type of information I’ve long been trying to find. It matches to my requirements a lot. Thank you for writing this information. Te koop kamersteiger

    ReplyDelete
  32. Great articles and great layout. Your blog post deserves all of the positive feedback it’s been getting. Fully redundant core SBCรข€™s and network

    ReplyDelete
  33. SMM Panel
    https://smmwebs.com/
    Hello, I read Your Article. This is very Helpful for me. Thanks. Please try
    smm panel

    ReplyDelete
  34. Very informative post! There is a lot of information here that can help any business get started with a successful social networking campaign. Ice Cream Nebraska Bakery

    ReplyDelete

Linux Series - SED Utility/Package - 4. Deleting Lines

Let’s explore sed’s explicit delete command, which you specify by using the option 'd'. Again, we are using the sample file named &#...