jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arihan <arihan.si...@gmail.com>
Subject Re: How to run Multiple HTTP samplers inside the IF controller
Date Thu, 03 Oct 2013 10:31:01 GMT
I am using jmeter 2.9.

If i simply use if controller and put multiple http sampler inside it then
it works fine. 

However my scenario is bit different.

http sampler user logsin
simple controller - get excursion id
    http sampler - get all reservation ids (/reservations)
           reg expression extractor ( getReservationIdForExcursion, "id":
\"(.+?)\", $1$, -1)
    ForEach controller ( input - getReservationIdForExcursion, output -
ReservationIdForExcursion)
          http sampler for each resevation-id (
/reservation/${ReservationIdForExcursion}/excursions) 
             json path extractor:- reservationCode ,
$.payload.destinationAreaExcursions..reservationCode[0]
             json path extractor:- serviceId ,
$.payload.destinationAreaExcursions..serviceId[0]
             json path extractor:- code ,
$.payload.destinationAreaExcursions..code[0]
          if controller (${reservationCode} != null && ${serviceId} != null
&& ${code} != null)
              http sampler1
              http sampler2
              BSF post processor ( beanshell, This processor is to remove
all variables so that it would come              out of for loop)

Here the problem is only httpsampler1 runs. Anything I am missing??

If you refer the screenshot and result view.

As per result
The first login is for the http sampler login 
second and third http sampler login is because if controller condition is
true
Now it goes to HTTP sampler reservations
for each reservation id , it goes to the excursion view. 
The first Excursion view for Reservation id :- the if controller condition
did not get satisfied
The second excursion view for reservation id :- the if controller condition
got satisfied
so it came inside if controller  
Now here I expect it should run both the login http samplers. ( *however it
runs only once)*
Then it removes all variables through bsf post processor
Then it logs out.

Any idea how to resolve it????

Actually I need that if the condition true in if controller for a particular
reservation-id then all the http samplers mentioned inside if controller
should run . Then it would come out from the for loop.
<http://jmeter.512774.n5.nabble.com/file/n5718299/Screen_Shot_2013-10-03_at_11.25.42_AM_%282%29.png>




--
View this message in context: http://jmeter.512774.n5.nabble.com/How-to-run-Multiple-HTTP-samplers-inside-the-IF-controller-tp5718288p5718299.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Mime
View raw message