Response Assertion with rule Substring doesn't work with a string contains characters + or ( If the (http) response send : <str name="parsedquery">+DisjunctionMaxQuery((text_fr:"a b" | title_fr:"a b")~0.01)</str> And use a assertion results with rules "Substring", we have : => Assertion failure message : Bad test configuration org.apache.oro.text.MalformedCachePatternException: Invalid expression: +DisjunctionMaxQuery(( ?+* follows nothing in expression
Created attachment 22527 [details] Patch to correcte the assertion substring with String contains regexp operators
This error because in ResponseAssertion.java (components) in method evaluateResponse(), this instruction : Pattern pattern = JMeterUtils.getPatternCache().getPattern(stringPattern, Perl5Compiler.READ_ONLY_MASK); is always execute even in a substring rule. 1/ thus if the stringPattern contains a false regexp expression, the error are detected 2/ and it's not necessary to execute this instruction for a substring rule solve : only execute this instruction for the rules : "contains" and "matches"
Thanks for the well-written report and patch. Patch (and test case) added to SVN in URL: http://svn.apache.org/viewvc?rev=692436&view=rev Log: Bug 45749 - Response Assertion does not work with a substring that is not a valid RE
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2150