Virtual service think time based on incoming request
search cancel

Virtual service think time based on incoming request

book

Article ID: 211362

calendar_today

Updated On:

Products

Service Virtualization

Issue/Introduction

Have a requirement to have think time on virtual service on every 10th request.

 

Environment

All supported DevTest releases.

Resolution

To find out every 10th transaction, add a counter variable and increase that value for each request by adding a custom logic in scriptable data protocol.

Add a "Javascript" step between "VS Image Response Selection" and "HTTP/S Respond" step and add the logic to verify whether counter is multiple of 10.  If yes, then use Thread.sleep(10*1000); (Which will keep the thread in wait state for 10 seconds).