Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How to customize the return status for same responder?

Options
yerapareddy
yerapareddy Posts: 1

I need to achieve following things.
1. 10% Calls should respond with HTTP 404 or HTTP 500
3. One of the services should get failures (HTTP 500) for 15-20 minutes and then it should pass (200 ok) for 15-20 minutes.

Answers

  • [Deleted User]
    [Deleted User] Posts: 0
    Options

    I believe your question is related to Virtualize?

    With respect to #1, there is a tool extension for Virtualize on Parasoft Marketplace that can accomplish this called the "Responder Randomizer:" https://marketplace.parasoft.com/#query?limit=24&offset=0&keywords=responder randomizer

    It allows you to specify what percentage of the time an alternative response should be sent (and you can specify what the HTTP code should be used for the alternate response):

    With respect to #2, I believe the correct approach would be to build two different virtual services: one which returns failures (HTTP 500) and one which passes (200 OK).

    Point your application under test at a proxy. To start, the proxy will be forwarding traffic to the HTTP 500 virtual service. Then at the 15-20 minute mark make an API call from your test to Environment Manager (or to the Virtualize server directly) to re-point the proxy to the second virtual service.

    It's always preferable to build the simplest virtual assets possible and then use proxies to change the flow of traffic in order to achieve different virtual behavior.