Hi experts,

I have an HTTP request which is submitted to server, and I need to wait on this 
request for the response content to contain some critical value that I need to 
extract and use in subsequent HTTP requests.

For example, when the HTTP request is submitted, initially I might get 
something like

window.parent.func_prepare('Preparing',' ....

But after server completes processing of the request and data has become 
available, then the Response content (to the above same HTTP request) will 
contain something like this:

window.parent.func_prepare('OKOK',' ....

So I have a RegEx Extractor trying to extract some string that is part of the 
'good' response, which is the one with ('OKOK', .... Plus critical value I want 
to extract)

But depending on the processing delay on the server backend, this request will 
fail to obtain the desired RegEx extraction, because it cannot find any RegEx 
match in the 'bad' response, which is the one with ('Preparing','...... stuff 
that does not contain the data I need)

I have set up HTTP request as follows:

                HTTP Sampler
                                ->Constant Timer
                                ->RegEx Extractor (for variable1)
                                ->Assertion (for existence of 'OKOK' and other 
strings based on RegEx match)
                                ->RegEx Extractor (for variable2)

First of all, I don't think the Constant Timer is working, since I can tell 
that execution just move on even if I set a large timer value.

But also, instead of simple (dumb) timer, perhaps I should use some more 
advance logic, like if response contains 'Preparing', then wait for response to 
change, until I see 'OKOK' in response, or after some timeout is reached.

But I am not sure how to construction that logic around this HTTP Sampler.

Any help is greatly appreciated.

Regards,
Charles


Reply via email to