regex - JMeter Response Assertion fails pattern -


apply to: main sample , sub-samples response field test: text response pattern matching rules: contains

patterns test:

<?xml version="1.0" encoding="iso-8859-5" standalone="yes"?> <cit_request>     <system>         <cit_version value="1.0"/>         <err value=""/>         <format value="xml"/>         <interface_ret value=""/>         <main_id value="37407427745"/>         <msg_id value=".*"/> - regexp not working         <sync value="n"/>         <version value="002"/>     </system>     <data>         <package_b64>     pe1zz0nsawvudefkzfjzihhtbg5zpsj1cm46c2nozw1hcy1wc2l0lxj1omdwij48 unfvsuq+mzc0mdc0mjc3ndu8l1jxvulepjxscvjlc3vsdd48u3rhdhvzpk9rpc9t dgf0dxm+penvbw1lbnq+tmv3pc9db21tzw50pgojcqk8l1jxumvzdwx0pjxszxn1 bhq+pensawvudelkpjc3mzy0ntgypc9dbgllbnrjzd48sw50zxjuywxfq2xpzw50 swq+mjy3pc9jbnrlcm5hbf9dbgllbnrjzd4kcqkjpc9szxn1bhq+cgkjpc9nc2dd bgllbnrbzgrscz4=  </package_b64>     </data> </cit_request> 

response:

<?xml version="1.0" encoding="iso-8859-5" standalone="yes"?> <cit_request>     <system>         <cit_version value="1.0"/>         <err value=""/>         <format value="xml"/>         <interface_ret value=""/>         <main_id value="37407427745"/>         <msg_id value="f3c826680f5e45c3aa97dee4da51f54b"/> - msg_id value changes each request         <sync value="n"/>         <version value="002"/>     </system>     <data>         <package_b64>     pe1zz0nsawvudefkzfjzihhtbg5zpsj1cm46c2nozw1hcy1wc2l0lxj1omdwij48 unfvsuq+mzc0mdc0mjc3ndu8l1jxvulepjxscvjlc3vsdd48u3rhdhvzpk9rpc9t dgf0dxm+penvbw1lbnq+tmv3pc9db21tzw50pgojcqk8l1jxumvzdwx0pjxszxn1 bhq+pensawvudelkpjc3mzy0ntgypc9dbgllbnrjzd48sw50zxjuywxfq2xpzw50 swq+mjy3pc9jbnrlcm5hbf9dbgllbnrjzd4kcqkjpc9szxn1bhq+cgkjpc9nc2dd bgllbnrbzgrscz4=  </package_b64>     </data> </cit_request> 

assertion failure message:

assertion error: false assertion failure: true assertion failure message: test failed: text expected contain /<?xml version="1.0" encoding="iso-8859-5" standalone="yes"?> <cit_request>     <system>         <cit_version value="1.0"/>         <err value=""/>         <format value="xml"/>         <interface_ret value=""/>         <main_id value="37407427745"/>         <msg_id value=".*"/>         <sync value="n"/>         <version value="002"/>     </system>     <data>         <package_b64>     pe1zz0nsawvudefkzfjzihhtbg5zpsj1cm46c2nozw1hcy1wc2l0lxj1omdwij48 unfvsuq+mzc0mdc0mjc3ndu8l1jxvulepjxscvjlc3vsdd48u3rhdhvzpk9rpc9t dgf0dxm+penvbw1lbnq+tmv3pc9db21tzw50pgojcqk8l1jxumvzdwx0pjxszxn1 bhq+pensawvudelkpjc3mzy0ntgypc9dbgllbnrjzd48sw50zxjuywxfq2xpzw50 swq+mjy3pc9jbnrlcm5hbf9dbgllbnrjzd4kcqkjpc9szxn1bhq+cgkjpc9nc2dd bgllbnrbzgrscz4=  </package_b64>     </data> </cit_request>/ 

please regexp or way out.

according "response assertion" chapter of how use jmeter assertions in 3 easy steps article

the pattern can either be:

  1. a “string” “equals” or “substring” clauses
  2. a “perl5-style” regular expression “contains” or “matches” clauses

so have 2 options:

  1. if still want use "contains" pattern matching rule need escape:

    • .^$*+?()[{\| characters outside character classes
    • ^-]\ characters inside character classes
  2. the easier option changing pattern matching rule "equals" or "substring"


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -