I'd use a variable global to a thread group. This way you don'T have to change 
any controller and you can use it in the if controller without need of heavy 
JavaScript.
Something like    ${rc} == 0     will do then.
I would consider a request to be successfull if it OK from BOTH technical and 
business views, the latter is determined by the assertions. Actually this is 
the way things work now.

Since the logic to determine if the request was successful already exists, the 
only effort I see is making the internal variable public in the thread context. 
This might well be less work than modifying controlls and their GUIs.

I would at first just supply the variable, (integer and not boolean, for later 
enhancements), so the user can check for ==0 and !=0.
This would be a major improvement for me.
Later we can enhance the feature and provide various return codes for covering 
different errors, but this seems for me being of seconary importance.

Regards,
Noam Paz


sebb <[EMAIL PROTECTED]> wrote on 13.01.2006 16:27:26:

>> 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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>
>> >
>> >             13.01.2006 15:26                                            To
>> >
>> JMeter Users List <[email protected]>
>> >                                                                         cc
>> >
>> Please respond to
>> >
>> "JMeter Users List" <[email protected]>                 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 <[EMAIL PROTECTED]> 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

Best regards / Viele Grüße

Noam Paz


--

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to