jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas <nosp...@massart.org>
Subject Re: How to test if previous sample is successfull ?
Date Fri, 13 Jan 2006 15:48:44 GMT
Hi,

Perhaps a variable which would have a global scope on thread loop level 
would do the job.
Something like $isLastSampleSuccessfull with a boolean value is enough, 
no need to have zero or positive and negative integers as return codes 
nor multiple variable for each states.
The success of a sample is defined using assertions, and we already have 
enough assertion types for the moment, so we don't need to be able to 
test why the sample failed as sebb says but if the sample failed or not.
A simple variable (global on thread loop level but each thread loop 
would have it's own variable value) with a boolean value would be very nice.
Then we would be able to test ${isLastSampleSuccessfull} in the 
javascript expression input of the IF controller and that's all.

hma...
Nicolas.

sebb wrote:

>Oops, I meant
>
>?CODE=404
>
>S.
>On 13/01/06, sebb <sebbaz@gmail.com> wrote:
>  
>
>>Agreed, it would be useful to have a status variable for the previous request.
>>
>>However, there are several possibilities for this - maybe there need
>>to be several variables.
>>
>>Result code - e.g. 200, 404 etc for HTTP
>>Success/Fail
>>There is another flag for samplers (can't remember the name off-hand;
>>I think it's only for internal errors).
>>
>>Also, how should Assertion Failures be treated?
>>At present, an Assertion can change the success/fail status of a sample result.
>>
>>If there is only a single variable, should it be set from the original
>>sample status, or should it track the output from Assertions?
>>
>>All this is doable, but would be harder than adding the equivalent of
>>LAST to the If Controller - as well as making the If Controller harder
>>to code, as one would need to express the comparison in JavaScript.
>>
>>So it might be better to start with adding some keyword conditions to
>>the If Controller. e.g. if the string starts with ?, then treat it as
>>a special condition, not JavaScript.
>>
>>For example:
>>
>>?SUCCESS
>>?FAIL
>>?CODE=
>>
>>This would be easier than coding
>>
>>"${STATUS}" == "SUCCESS"
>>
>>or whatever.
>>
>>In the longer term, adding variables/functions to get the information
>>would be more flexible.
>>
>>S.
>>On 13/01/06, Noam Paz <noam.paz@db.com> wrote:
>>    
>>
>>>Personally I don't find the options of the while controller very intuitive.
>>>I would suggest another approach: adding a built-in status variable to JMeter,
just like $? in unix shells.
>>>Then one can use this variable in  the various controllers like the if controller
without need to change them.
>>>The status variable will be updated after each request and will have the value
0 for a successfull request or nonzero otherwise. This idea can of course be elaborated (positive
values for technical errors, negative values for failing assertions etc.) but I guess zero/nonzero
would suffice at first.
>>>Would do you say?
>>>
>>>
>>>Best regards / Viele Grüße
>>>
>>>Noam Paz
>>>
>>>
>>>
>>>
>>>
>>>            sebb <sebbaz@gmail.com>
>>>
>>>            13.01.2006 15:26                                                 
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
        To
>>>                                                                             
                                                                                         
                                                                                         
                                                                                         
                                                          JMeter Users List <jmeter-user@jakarta.apache.org>
>>>                                                                             
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
        cc
>>>                                                                             
                                                                                         
                            Please respond to
>>>                                                                             
                                                                                         
          "JMeter Users List" <jmeter-user@jakarta.apache.org>                     
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
         Subject
>>>                                                                             
                                                                                         
                                                                                         
                                                                                         
                                                          Re: How to test if previous sample
is successfull ?
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>The While Controller has a LAST option:
>>>
>>>http://jakarta.apache.org/jmeter/usermanual/component_reference.html#While_Controller
>>>
>>>I guess it would be useful if the If Controller had it too.
>>>
>>>Might not be too hard to add.
>>>
>>>S.
>>>On 13/01/06, Nicolas <nospam0@massart.org> wrote:
>>>      
>>>
>>>>You're right Noam, thank for this explanation.
>>>>
>>>>Infact, I tested the Result Status Action Handler but what I need is to
>>>>use an IF logic controler to play or not a sample, not to stop the
>>>>thread or the entire test. For the IF controler to work, I need some
>>>>value to test. In some cases I can test a session ID extracted with
>>>>Regular Expression Extractor wich returns the ID or a "null" string as
>>>>default. In my IF controler I use something like "${userSession}" !=
>>>>"null" as condition.
>>>>But sometimes I dont have any data to extract from the sample and only
>>>>need to test if it suceeded. Thats the point.
>>>>
>>>>Thanks,
>>>>Nicolas.
>>>>
>>>>
>>>>
>>>>Noam Paz wrote:
>>>>
>>>>        
>>>>
>>>>>if I understood Nicolas correctly, he wants to perform requests conditionally.
>>>>>But Result Status Action Handler only allows him to stop the thread or
terminate the whole test.
>>>>>
>>>>>Best regards / Viele Grüße
>>>>>
>>>>>Noam Paz
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>            sebb <sebbaz@gmail.com>
>>>>>
>>>>>            13.01.2006 12:47
>>>>>          
>>>>>
>>>To
>>>      
>>>
>>>>>                                                                     
                                                                                         
                                                                                         
                                                                                         
                                                                  JMeter Users List <jmeter-user@jakarta.apache.org>
>>>>>
>>>>>          
>>>>>
>>>cc
>>>      
>>>
>>>>>                                                                     
                                                                                         
                                    Please respond to
>>>>>                                                                     
                                                                                         
                  "JMeter Users List" <jmeter-user@jakarta.apache.org>
>>>>>          
>>>>>
>>>Subject
>>>      
>>>
>>>>>                                                                     
                                                                                         
                                                                                         
                                                                                         
                                                                  Re: How to test if previous
sample is successfull ?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Result_Status_Action_Handler
>>>>>
>>>>>On 13/01/06, Nicolas <nospam0@massart.org> wrote:
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>Hi,
>>>>>>
>>>>>>I'd like to test if a previous sample succeeded before running another
>>>>>>sample.
>>>>>>Any ideas are welcome !
>>>>>>
>>>>>>Thanks,
>>>>>>Nicolas.
>>>>>>
>>>>>>---------------------------------------------------------------------
>>>>>>To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>>>>>For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>>>---------------------------------------------------------------------
>>>>>To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>>>>For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>--
>>>>>
>>>>>Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren
Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe dieser Mail ist nicht gestattet.
>>>>>
>>>>>This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient (or have received this e-mail in error) please notify the
sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution
of the material in this e-mail is strictly forbidden.
>>>>>
>>>>>
>>>>>
>>>>>---------------------------------------------------------------------
>>>>>To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>>>>For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>        
>>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>
>>>--
>>>
>>>Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren
Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe dieser Mail ist nicht gestattet.
>>>
>>>This e-mail may contain confidential and/or privileged information. If you are
not the intended recipient (or have received this e-mail in error) please notify the sender
immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution
of the material in this e-mail is strictly forbidden.
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>>
>>>
>>>      
>>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>  
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message