Apache JMeter Scripting Challenge 2

Опубликовано: 27 Апрель 2023
на канале: Performance Test Engineer - English - 1
849
12

Apache JMeter Scripting Challenge 2 #youtubevideo #jmeter #java #javascript #testing #viralvideo #youtuber #groovy #beanshell #javascript #javaprogramming #viral #testing #apache #youtubers #ScriptingChallenge #jmeter #interviewquestionsandanswers

****************************************************************************
Apache JMeter Scripting Challenge 2
***********************************

Scenario:
*********
I have one scanario 1st request pass only next request will be executed, other wise first
request is not passed 2nd request never executed stop the test This is the Scenario.

Solution:
*********

TestPlan
Threadgroup
httprequest-1
httprequest-2
Beanshell Pre-Processor
view results tree

Beanshell Pre-Processor
***********************
var rc=prev.getresponsecode();
var rm=prev.getresponsemessage();
log.info("****RC is****:"+rc);
log.info("****RM is****:"+rm);
if(!rc.equals("200"))
{
org.apache.jmeter.engine.standardjmeterengine.stopthread(thread.currentthread().getname());
}

output Example

http request1 : www.google.com
http request2 : www.bing.com


**************************************************