On 24/10/06, Philip Peake <[EMAIL PROTECTED]> wrote:
sebb wrote:
> On 23/10/06, Philip Peake <[EMAIL PROTECTED]> wrote:
>> I have a  number of username/password pairs. Some of these are known to
>> be bad and need to be reset. Exactly which ones, and how many is
>> unknown.
>> I have a very simple script to run through these and try a login:
>>
>>  TestPlan
>>       Threads
>>             Username/Password (read from file)
>>              HTTP Cookie headers
>>              HTTP Request defaults
>>
>>              HTTP Request (Login screen)
>>              HTTP Request (Submit login)
>>                     Response assertion
>>                     Result action handler (continue)
>
> No need for this; the default action is continue anyway
Probably - "continue" probably needs some clarification in the
documentation -- does it mean ignore the error condition, or does it
mean continue as in the sense of continue within a loop, which
short-circuits the rest of the execution and goes back to the top?

Continue means continue the test,  rather than stopping the thread or
the whole test.

>
>>              View results tree
>>              Aggregate graph
>>
>> Now, I originally thought I could log only errors in the "view results
>> tree" listener, and log to a file. Unfortunately, it logs only results,
>> and although the information is in the GUI display there seems no way to
>> log most of it.
>
> The Configure button can be used to change the fields that are logged.
>
> However, if the response does not contain the id, then at present
> there is no way to add a variable to the output.
>
> Depending on your application, you may be able to add some dummy
> information to the URL. Or you could try adding the user id to the
> submit login screen sampler label.
>
>> All I want to do is log ${username} to a file when the "Submit Login"
>> returns an error, as detected by the "Response Assertion" element.
>> Please don't say BeanShell -- maybe its just my unfamiliarity with Java,
>> but that just does not work. There are no working examples that I can
>> find, and even when I did get a trivial test working (took days ...) it
>
> There are some basic examples in the documentation and the extras
> directory, but BeanShell is intended for those familiar with Java.
>
>> doesn't work as defined in the documentation (ordering issues).
>
> That is a generic JMeter bug - nothing to do with BeanShell...
>
>> The _log() function looked promising -- but I can't find any element
>> which allows me to test the result status with a field which will take a
>> function.
>
> You can put the __log() function anywhere that you can use a variable.
>
>> How do I do this? It seems sucha  fundamental thing to want to do that I
>> assume there must be a way...
>
> See above.
Well, since there is nowhere that a variable can be placed which is only
executed on failure -- it can't be done, can it?

The Listeners do have a check box to only save samples to file on error.

Furthermore, the If Controller can be used to check if the last result
was successful or not - see the documentation for details.

As I said ... a really basic thing to expect to be able to do, and it
can't be done.

It can be done - there are several ways - as I described above and previously.

Its particularly annoying that the View Results Tree listener has
displays all the information needed, but has no way to dump that output
into a file.

Where is the information in the Tree Listener? As far as I am aware,
all the fields in the sample result can be written to the file - but
you do have to use the Configure button to select the appropriate
fields.

Try it and see.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to