Modify the resource path for a sub-sample in JMeter -
i have recorded user journey in jmeter (using angularjs). when click link spawns request page, in-turn spawns additional sub-requests page resources (images).
in short:
test plan -- thread group ---- transaction controller ------ http request (main sample)
here main sample triggers additional sub-samples resources , fail due path issues works manually using browser.
i in need change path of sub-samples or not fail on 404 these sub-samples.
the fact getting different results in browser , jmeter indicates jmeter test not well-behaved doesn't replicate browser requests 100% accuracy therefore load test doesn't make lot of sense "good" load tests must represent real user sitting behind real browser close possible. recommend comparing requests being sent browser , jmeter sniffer tool fiddler or wireshark, identify differences , amend jmeter configuration jmeter-driven requests exact replica of browser-driven ones (apart dynamic parameters)
for time being can tell how convert failed sub-samples successful ones.
- add jsr223 postprocessor child of main request
put following code "script" area:
prev.getsubresults().each { it.setsuccessful(true) }
that's it, above groovy code mark sub-samples successful no matter of original status (the response status code, message, body, etc. remain original, jmeter won't consider them failed anymore). see apache groovy - why , how should use it article learn more using groovy scripting in jmeter tests.
Comments
Post a Comment