-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test Doesn't Stop #7
Comments
Hello, If you need to programmatically change the body for each request of a sampler, this is usually implemented with a JMeter pre processor like Jsr223PreProcessor. You might try implementing an adapter as we did for the Jsr223PostProcessor which should be mostly a copy (try in any case to modularize the commonalities to avoid duplicate code) and feel free to submit a PR for that. Something that we are currently considering when implementing logic, is to keep using JMeter functionality and keep compatibility with JMeter GUI (eg: being able to export the test plan to jmx). That being said, it doesn't mean that we can't implement something that is not supported by JMeter, if we ever do that we have just to be explicit with users and have a good reason to implement something non JMeter GUI compatible. In conclusion, if there is no clear benefit (there might be a very good reason for doing what you did, but I don't have currently enough information to discern), prefer going with JMeter classic way of solving these scenarios. Can you provide the code of the sampler you created and a test case to help you trace the issue you are experiencing? Regards |
Thanks. This was entirely me doing something stupid. I didn't notice I still had the repeat at the bottom of my test from the check for things from making sure the count was accurate earlier. As far as wanting to avoid Jsr233PreProcessor, we're currently looking for something we can use to generate tests preferably using existing Java code as much as possible. The specific thing we are attempting to do right now is load test an endpoint that we use for syncing data. Each request can contain ~500 records of various models. These models already have factories for internal testing purposes. We'd like to be able to re-use this code to generate various requests to test the sync endpoint. If each model doesn't have a distinct ID the test works very differently. Just generally speaking we'd much prefer to interact with requests/responses in the language we are familiar with with compiler support and IDE code completion so the PreProcessors are a pretty big turn off. For our use case at least we really don't care at all about JMeter and are really just looking at a programatic load testing solution. |
I've probably done something wrong, but I attempted to implement a version of the a DSL sampler that can provide a different body for every request. I mostly just copied and pasted the DslHttpSampler and replaced the body parameter which was a string with a Supplier which is then called every time build arguments is called.
I'm not sure why this is resulting in the program running over and over again, but I think having different request parameters on each iteration is likely a fairly common use case. (I had forked the repo and was going to make a PR if I could get it working).
The text was updated successfully, but these errors were encountered: