How to make json-rpc calls? - jmeter

I've looked through previous questions about this but there was no definite answer so hoping someone can help me here.
I want to make a JSON RPC call using a Jmeter sampler but I'm not sure which one to use.
The request takes the following shape:
https://servicename.bla.com.service.dosomething({pass in JSON params})

If this is what you are talking about:
http://www.simple-is-better.org/rpc/#differences-between-1-0-and-2-0
You can use a regular HTTP sampler with Raw Post Body provided your service uses POST Method (which is what the example shows).
You can add an Http Header Manager to set Content Type

Related

Why is my HTTP request URL not being generated for a Logic App?

Good morning. I am new to logic apps and I am trying to figure out how I can trigger the execution based on a GET URL with three parameters. All the examples I've found on Google show the URL being generated once the JSON and relative path is entered, but that's not happening for me. Perhaps it's because I am creating the logic app in VS.
Here's what my "When a HTTP request is received" step looks like in the logic app.
I also tried removing the JSON and just using the parameters to pass the values to the function, as shown below. I'm just not sure the best way to do this.
All I really need to do is get the three parameters into the logic app so I can perform a function call with the parameters. Any suggestions would be greatly appreciated!
Why is my HTTP request URL not being generated for a Logic App?
You need to click save, and then the url will be automatically generated for the When a HTTP request is received trigger:
You can use this expression to accept values through GET parameters:
triggerOutputs()['queries']['parameter-name']
For example:
Noteļ¼š
Queries need to pass parameters in the form of json.

How to extract data from AMQP request in JMeter

I have used AMQP Publisher to publish the message in RabbitMQ then I use AMQP Consumer as listener. In the View Results Tree the messages from the queue in shown in the request tab of AMQP Consumer. My question is how to extract data from that request. I tried following the Bean Shell Post Processor but it seems it will only work on Http request. I tried to use JSR223 Post Processor and XPath extractor but it doesn't work as well. Any help?
I wanted to extract the documentId from the request. Here is the Request pattern.
I have already tried following links:
Extracting value from jmeter post request
how to extract value from request in Jmeter
How to extract the values from request input xml in jmeter
The statement that you tried something without sharing the code doesn't make sense
Posting JSON data or code as image is not the best idea
Any reason to extract data from the request? Normally people know everything about the request hence don't require to extract anything from it. Even if they do - they should normally able to store the request data into a JMeter Variable and apply the relevant Post-Processor to it.
Whatever, just in case here is the solution:
Add JSR223 PostProcessor (if you really want to do this using the Post-Processor) as a child of the request
Put the following code into "Script" area:
vars.put('foo', com.jayway.jsonpath.JsonPath.read(sampler.getArguments().getArgument(0).value,'$..documentId')[0])
That's it, you should be able to access the extracted value as ${foo} where required.
References:
JsonPath: Getting Started
Apache Groovy - Why and How You Should Use It

Getting js objects from browser console and Jmeter

I'm working on a new project, the client is a bank and I need to perform performance tests, I wanted to use jmeter as a main tool, but I found a problem, most of the pages ask for a token, so I need to catch token and set this to the next POST request in order to login and continue through the different page forms, the problem is that this token is generated by a javascript, so is not returned in any GET response body; I can just get it by console's browser, because this token is generated in a javascript object.
I've tried with postProcessor elements as regular expression extractor, JSR223 PostProcessor (I'm not a pro with) and finally with Webdriver Sampler, this last one is working, but I had to import some Java classes, did some modifications, etc; but I this is not an option, because if I perform the test with several virtual users the machine is going to run out of resources.
I was wondering if you have faced with something similar, if so, could you please make me a suggestion?, maybe perform tests with a different tool, framework...
Thanks in advance.
First of all I would recommend looking into the response more attentively as the token might be coming as a Cookie or a Header, if this is the case you should be able to extract it using HTTP Cookie Manager or Regular Expression Extractor correspondingly.
If the token is generated via JavaScript code you can re-implement the logic using Groovy language and use vars.put() function in order to store the generated value into JMeter Variables. If you cannot come up with the relevant Groovy code - update your question with the JavaScript code snippet and most probably we'll be able to help you with converting it into Groovy and exposing to next Sampler(s)

How to define email address with Jmeter user defined variables?

Problem: In email address # replaced by %40.
http header manager:
user defined variables:
http request:
and result tree:
I have researched about this, and they say that, if http method is POST, then it should encoded automatically. But It does not encoded automatically. Any advice, how can I resolve this?
Note: Jmeter version : 3.1 and I am trying to test a rest service.
Please try sending data in Body data instead of sending it in parameters.
Change "Implementation" of your HTTP Request sampler to Java
If you need to change it for more than one sampler - it makes sense to define the setting using HTTP Request Defaults.
I found the answer. #PoorvajaDeshmukh's answer suggest me. Like following (correct defination of body data);
I also tried #DmitriT's suggestion, but I did not work. Thanks for advices...

any gem available that will pull out the get and post parameters ofsource code that I've got using net/http?

I am pulling the source code of a webpage using net/http and I was wondering if there was anyway to parse out the get and post parameters so that they can be listed?
Thanks,
Tom
GET and POST parameters are in the HTTP header, not the HTML source. So the answer is no, you can't get it from the source, unless you know that the information has been somehow encoded in HTML, or can do that yourself.
However, any GET or POST parameters would have been sent by your Net::HTTP code, so you can print those out yourself.

Resources