0
votes

I need to simulate a test scenario where my application sends a request with 100s of queries. On the back-end, this request is broken down into requests containing a single query each. So a request from Jmeter with 100 queries will become 100 requests on the back-end. Now - the response from the back-end could either contain the requested data for each of those queries OR contain a unique queryID. Sending back a queryID is server's way of telling that this query is still running. For example, if Jmeter sends a request with 100 queries, it might get back data for 80 and 20 unique queryIDs. So my application under test makes a callback request with those 20 queryIDs every 15 seconds until it gets back the requested data or timeout.

Here is what I have implemented so far.

-main_request_with_100_queries
--XPath_extractor_to_extract_any_queryIDs_found
-if_controller_to_check_if_queryID_MatchNr_is_greater_than_0
--15_second_pause
--beanshell_preprocessor_to_create_the_request_body_with_all_queryIDs
--callback_request_with_queryIDs

What I want to implement is to have another XPath extractor for my callback_request and if any queryIDs are found, then go back to the if_controller

I'm trying to make this work by using a module_controller but so far no luck. Has anyone ever implemented something like this? Can anyone suggest some ideas?

1

1 Answers

0
votes

You can use While Controller to keep making the request until there is a queryID in the response.

While Controller [ "${querid.present}"=="true" ]
   HTTP Request
     Pre Processor [to_create_the_request_body_with_all_queryIDs]
     Post Processor [to check for query ID. if no query id  - change querid.present to false ]

If possible, try to use Regular Expression Extractor. xpath is very slow and might affect your performance of the script. Check here for more details.

Creating modular test script in JMeter.