-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add ability for RegexExtractor to fail sampler result if there is no match #3364
Comments
Sebb (migrated from Bugzilla): |
I'd like to reopen this ticket. It is a great addition. By far in most cases you want the sampler to fail if the regex extraction fails. Adding a response assertion with the exact same match is very unproductive, mostly forgotten and consumes extra resources. |
I tend to agree with jgaalen |
Extractors are not the place to fail a sampler. Their job is strictly to
extract.
Assertions are the correct place for failing a sampler.
Please re-close this ticket.
…On Fri, Mar 10, 2023, 10:49 jgaalen ***@***.***> wrote:
I'd like to reopen this ticket. It is a great addition. By far in most
cases you want the sampler to fail if the regex extraction fails. Adding a
response assertion with the exact same match is very unproductive, mostly
forgotten and consumes extra resources.
The argument that the response assertion can already do that is irrelevant
in my opinion. There are tons of features that can be done by other options.
this feature would be a valuable addition to jmeter without compromising
anything
—
Reply to this email directly, view it on GitHub
<#3364 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXQDSUNX6FBJRPIELKAIQ3W3LTI7ANCNFSM6AAAAAAVWEQNUE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
It might be a bit of a semantic discussion, but it's actually under 'Post Processor', and extracting + failing a request is exactly what a post processor can do. If a check box with 'Fail if not found' is too much for the extractors, perhaps create a similar post processor which does this: extract and fail if nog found. I think this is an important feature for a performance test tool (all other tools simply support this tho). I have seen tons of scripts made by others and I have never seen people duplicating their extractions to an assertion to make sure it actually extracted a value. If you don't do that, you have the risk that you just continue in the script and send bogus data and let the script fail too late. For the matter of creating sensible scripts, this feature is a must have in my opinion. |
I'd like to bump this ticket. I simply don't agree with the statement that Extractors are not the place to fail a sampler. You have to think of a way to improve the tool in an effective way and how users are using it. Users don't duplicate all extractors to place assertions to fail them once an extract has no match. It is a lot more work, inefficient and error prone. All other tools do have the options to (automatically) fail if the extraction fails, for a good reason. |
Could you provde a PR? |
Michael Zhilin (Bug 56431):
Often there is need to stop iteration / fail sampler result if RegexExtractor doesn't find matches. To resolve this problem usually we need to add Assertion together with RegexExtractor. It duplicates code, increase processing time and make script's author less happy.
This fix is very simple, it makes RegexExtractor to add Assertion failure in case of regexp mismatch.
Also fix is posted on github: mizhka@47a46ba
Created attachment fix.diff: SVN Diff
fix.diff
OS: All
The text was updated successfully, but these errors were encountered: