Different Doors In Apache JMeter

Different Doors In Apache JMeter

First of all this is my first ever article in the Linked in community. And I want to inform you that I'm not elaborating the content like the content creators usually doing on web to attract the readers. Here I writing my experiences which can be helpful for the fellow techies who is frustrated in JMeter in some way. Some of you may already knew this, Please correct me if there is any mistakes. And Let me take you to the good part.

In generally we can Perform a load testing in JMeter if we know the API parameters know properly. But the The problem occurring when we don't know that. As usual what we do is simply recording the feature and try to run with the Recorded data. It will be helpful to recognize the parameters but when we Try to run a test it will normally lead us to the failure. Not with all type of Applications I agreed. Today I want to share the two situations and I will share more later. The first one is that when we try to record and run a url or API which is run only by taking a particular value from the response of the previous one. For example if the result of API 1 is having a url like "https://abscd123456jkl.com" then the API 2 will only work if it passed the value"123456" from the above url. When it comes to bulk run we couldn't manage it by doing it manually so there is the problem arrives. Next one is the Solution.

The solution is we should use the Beanshell processor in JMeter so that by using it we can Extract the Response and filter it out. First we should extract the response with regular expression extractor and should filtered it out using the Beanshell Processor. I will attach a sample code below.

[url = vars.get("url");

file = new FileOutputStream("C:/Users/user/Desktop/apache-jmeter-5.4.3/user.csv", true); //specify true if you want to overwrite file. Keep blank otherwise.

p = new PrintStream(f);?

this.interpreter.setOut(p);?

print(token);

f.close();]

This will help to survive such situations. The Next Situation we stuck in Load Testing in JMeter is one that When we try to call API which is having a CSRF Token. Calling API's with authentication token from the response of login API feature is a little bit old these days. You will feel amazed and frustrated when you try to call API with all valid credentials and parameters and still it is not working. It is common when you try to call a CSRF token protected API's. It is working like a key. The key is different in each login. And also you may not get the CSRF Token from the login response it should be hidden. So what you want to do is that the Call in internal API in browser and inspect the page and you can find the CSRF from the Internal API values. Because the Internal API (create ,POST) couldn't called without the the CSRF token. So that Copy the CSRF value to the JMeter without making another Login Attempt so that you can successfully run it in JMeter. This all I want to say in this article. And I'm temporarily signing out......

要查看或添加评论,请登录

Jithin Somaraj的更多文章

  • How to check all checkboxes on a web page from the browser console.

    How to check all checkboxes on a web page from the browser console.

    Some of us may get frustrated with the large number of checkboxes that need to be clicked to proceed to the next page…

    1 条评论
  • How to Perform Data-Driven Testing in Postman?

    How to Perform Data-Driven Testing in Postman?

    Data-driven testing is a smart way to test software by running tests with different sets of data. Postman, a popular…

  • How To Generate Individual HTML Report in OWASP ZAP

    How To Generate Individual HTML Report in OWASP ZAP

    When scanning multiple APIs simultaneously in OWASP ZAP, many users find it challenging to generate individual API…

    1 条评论
  • How to load external JavaScript file in JMeter

    How to load external JavaScript file in JMeter

    In certain situations, such as during payment processes or when submitting forms within the application, front-end…

    1 条评论
  • How do they Do It ?!!!!

    How do they Do It ?!!!!

    Today I want to share you about how much efforts it takes to hack your device for intruders Because of there is a…

  • How To Set Up Swagger UI editor Locally in Windows

    How To Set Up Swagger UI editor Locally in Windows

    This was one I have searched a lot more but couldn't find a simple answer fortunately I had time to find it out so that…

    7 条评论
  • Appium Android Automation Starter

    Appium Android Automation Starter

    Introduction Appium is an Open-source tool which can be used to automate mobile and desktop applications. Appium…

  • An Introduction to Kali Linux

    An Introduction to Kali Linux

    Kali Linux is an operating basically an operating system which is based on linux.As per Wikipedia, Kali Linux is a…

社区洞察

其他会员也浏览了