问题
I am using karate 0.9.0. I need to limit the request hits to 5 per second in my test suite due to threshold limit at gateway. is it possible in karate or not? If yes, how?
回答1:
Here is the suggestion - configure headers as a JavaScript function. Within the function body - use a Java singleton (and a static method) to track how many requests have been sent and how much "sleep" needs to be added to maintain the required throttling / threshold.
You will need some Java skills to do this, all the best. The documentation has details on how to call Java code.
来源:https://stackoverflow.com/questions/56544696/can-we-limit-the-number-of-request-hits-per-second-in-karate