How to pass data from JSR223 sampler to Http Request sampler in JMeter
up vote
0
down vote
favorite
Earlier we use to have CSV dataset config and Our Jmeter script read this seed data and prepare HTTP Request, it is working good.
But As per the current requirement we need to get data from mongodb pass those dynamic values to HTTP Request Sampler, I mean we need to build HTTp request sampler based on dynamic values from database ?
Can you please some one help me on this .
mongodb jmeter jsr223
add a comment |
up vote
0
down vote
favorite
Earlier we use to have CSV dataset config and Our Jmeter script read this seed data and prepare HTTP Request, it is working good.
But As per the current requirement we need to get data from mongodb pass those dynamic values to HTTP Request Sampler, I mean we need to build HTTp request sampler based on dynamic values from database ?
Can you please some one help me on this .
mongodb jmeter jsr223
Which component are you trying to gauge the performance for? The MongoDB or the server that receives the HTTP request?
– M Navneet Krishna
Nov 11 at 18:03
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Earlier we use to have CSV dataset config and Our Jmeter script read this seed data and prepare HTTP Request, it is working good.
But As per the current requirement we need to get data from mongodb pass those dynamic values to HTTP Request Sampler, I mean we need to build HTTp request sampler based on dynamic values from database ?
Can you please some one help me on this .
mongodb jmeter jsr223
Earlier we use to have CSV dataset config and Our Jmeter script read this seed data and prepare HTTP Request, it is working good.
But As per the current requirement we need to get data from mongodb pass those dynamic values to HTTP Request Sampler, I mean we need to build HTTp request sampler based on dynamic values from database ?
Can you please some one help me on this .
mongodb jmeter jsr223
mongodb jmeter jsr223
asked Nov 10 at 6:56
user3509718
183
183
Which component are you trying to gauge the performance for? The MongoDB or the server that receives the HTTP request?
– M Navneet Krishna
Nov 11 at 18:03
add a comment |
Which component are you trying to gauge the performance for? The MongoDB or the server that receives the HTTP request?
– M Navneet Krishna
Nov 11 at 18:03
Which component are you trying to gauge the performance for? The MongoDB or the server that receives the HTTP request?
– M Navneet Krishna
Nov 11 at 18:03
Which component are you trying to gauge the performance for? The MongoDB or the server that receives the HTTP request?
– M Navneet Krishna
Nov 11 at 18:03
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
There is vars
shorthand in the JSR223 Sampler which stands for JMeterVariables class instance which provides read/write access to all JMeter Variables in the Thread scope.
So if you do the following in JSR223 Sampler:
vars.put('foo', 'bar')
it will create foo
JMeter Variable with the value of bar
, you will be able to refer it as foo
in the HTTP Request sampler
With regards to MongoDB connectivity setting up you can refer to How to Load Test MongoDB with JMeter article, in order to get the mentioned test elements (MongoBD Source Config and MongoDB Script) add the next line to user.properties file:
not_in_menu=org.apache.jmeter.protocol.mongodb.sampler.MongoScriptSampler,org.apache.jmeter.protocol.mongodb.config.MongoSourceElement
JMeter restart will be required to pick the property up.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
There is vars
shorthand in the JSR223 Sampler which stands for JMeterVariables class instance which provides read/write access to all JMeter Variables in the Thread scope.
So if you do the following in JSR223 Sampler:
vars.put('foo', 'bar')
it will create foo
JMeter Variable with the value of bar
, you will be able to refer it as foo
in the HTTP Request sampler
With regards to MongoDB connectivity setting up you can refer to How to Load Test MongoDB with JMeter article, in order to get the mentioned test elements (MongoBD Source Config and MongoDB Script) add the next line to user.properties file:
not_in_menu=org.apache.jmeter.protocol.mongodb.sampler.MongoScriptSampler,org.apache.jmeter.protocol.mongodb.config.MongoSourceElement
JMeter restart will be required to pick the property up.
add a comment |
up vote
0
down vote
There is vars
shorthand in the JSR223 Sampler which stands for JMeterVariables class instance which provides read/write access to all JMeter Variables in the Thread scope.
So if you do the following in JSR223 Sampler:
vars.put('foo', 'bar')
it will create foo
JMeter Variable with the value of bar
, you will be able to refer it as foo
in the HTTP Request sampler
With regards to MongoDB connectivity setting up you can refer to How to Load Test MongoDB with JMeter article, in order to get the mentioned test elements (MongoBD Source Config and MongoDB Script) add the next line to user.properties file:
not_in_menu=org.apache.jmeter.protocol.mongodb.sampler.MongoScriptSampler,org.apache.jmeter.protocol.mongodb.config.MongoSourceElement
JMeter restart will be required to pick the property up.
add a comment |
up vote
0
down vote
up vote
0
down vote
There is vars
shorthand in the JSR223 Sampler which stands for JMeterVariables class instance which provides read/write access to all JMeter Variables in the Thread scope.
So if you do the following in JSR223 Sampler:
vars.put('foo', 'bar')
it will create foo
JMeter Variable with the value of bar
, you will be able to refer it as foo
in the HTTP Request sampler
With regards to MongoDB connectivity setting up you can refer to How to Load Test MongoDB with JMeter article, in order to get the mentioned test elements (MongoBD Source Config and MongoDB Script) add the next line to user.properties file:
not_in_menu=org.apache.jmeter.protocol.mongodb.sampler.MongoScriptSampler,org.apache.jmeter.protocol.mongodb.config.MongoSourceElement
JMeter restart will be required to pick the property up.
There is vars
shorthand in the JSR223 Sampler which stands for JMeterVariables class instance which provides read/write access to all JMeter Variables in the Thread scope.
So if you do the following in JSR223 Sampler:
vars.put('foo', 'bar')
it will create foo
JMeter Variable with the value of bar
, you will be able to refer it as foo
in the HTTP Request sampler
With regards to MongoDB connectivity setting up you can refer to How to Load Test MongoDB with JMeter article, in order to get the mentioned test elements (MongoBD Source Config and MongoDB Script) add the next line to user.properties file:
not_in_menu=org.apache.jmeter.protocol.mongodb.sampler.MongoScriptSampler,org.apache.jmeter.protocol.mongodb.config.MongoSourceElement
JMeter restart will be required to pick the property up.
answered Nov 12 at 7:02
Dmitri T
67.3k33257
67.3k33257
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53236713%2fhow-to-pass-data-from-jsr223-sampler-to-http-request-sampler-in-jmeter%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Which component are you trying to gauge the performance for? The MongoDB or the server that receives the HTTP request?
– M Navneet Krishna
Nov 11 at 18:03