Hi *,
I am trying to test the following situation with JMeter:
I have a jsp page (X.jsp) that needs a large amount of data to be retrieved
from the db and processed.
It takes a lot of time to get the response from the server and sometimes times
out.
To solve this, I have another wait page (Wait.jsp) that gets refreshed every 5
seconds and queries the session to see if the data has been loaded on the
session, and when it is, the X.jsp is displayed.
The test looks like this:
HTTP Request (Path: .../X.do)
Regular Expression Extractor (Reference Name: title; Regular
Expression: <title>(.*)</title>)
Loop Controller (Loop Count: 10)
If Controller (Condition ("${title_g1}" == "Wait"))
Constant Timer (5000 ms)
HTTP Request (Path: .../Wait.jsp)
Response Assertion (Patterns to Test: something from
the X page)
Regular Expression Extractor (Reference Name: title;
Regular Expression: <title>(.*)</title>)
(end if)
(end loop)
... other HTTP Requests
The idea was that:
- once the X page is returned, the other iterations will do nothing;
- if the server is loaded and it will take hours to respond, only wait for a
predefined time (no of iterations x timer)
In the iteration i (1<=i<=10), the response is indeed the X page, so the
assertion passes, but the title_g1 variable doesn't get assigned the title of
the X page.
So, the if is true in the following iterations and I continue to call the Wait
page after the X page has been returned.
This is because the title_g1 has always the value assigned in the first Regular
Expression Extractor, from the HTTP Request (Path: .../X.do).
How can I solve this?
I cannot use assertions to stop the thread because I have other HTTP Requests
that follow and must be tested.
Thanks,
Roxana