Not recording mapping for /something?a=1 as this has already been received

789 views
Skip to first unread message

Joe Le Brech

unread,
Jun 15, 2016, 5:48:24 AM6/15/16
to wiremock-user
I'm using the standalone like so:

java -jar wiremock-1.58-standalone.jar --port 9999 --verbose --enable-browser-proxying --record-mappings

It records a few api calls, but it gives me this message for something it hasn't yet recorded:

"Not recording mapping for /environments?session=xxx&uid=xxx as this has already been received"

It's a bigger response than the others, so maybe it times out?

Can I write a mapping file that forces it to record, or is there another solution?

Thanks.

Tom Akehurst

unread,
Jun 15, 2016, 5:55:35 AM6/15/16
to wiremock-user
By default the recorder will ignore any requests that match the URL (including query), method and body (if present) of a previously seen request. You can specify headers to vary on also.

What is different about subsequent invocations of the request you're making?

Joe Le Brech

unread,
Jun 15, 2016, 6:27:23 AM6/15/16
to wiremock-user
My mappings folder looks like the following attached image.

There's no initial recording of the "/environments" api call, which it does make (it must be proxying without recording) as the tests which create that call pass.
Screen Shot 2016-06-15 at 11.21.33.png

Joe Le Brech

unread,
Jun 15, 2016, 8:33:23 AM6/15/16
to wiremock-user
It's not recording too big a response, I used login details of a test user with less data and it recorded it.

Can the timeout or max sizes be changed?

Tom Akehurst

unread,
Jun 15, 2016, 9:09:51 AM6/15/16
to wiremock-user
I doubt it has anything to do with size or a timeout. What's likely happening is that during your recording session you're sending two requests that WM considers identical (URL and method). It's recording the first, then ignoring the second, which is deliberate as currently the recorder doesn't create stateful scenarios (returning different responses for a sequence of identical requests). This is a candidate feature for the future, incidentally.
Message has been deleted

Andrei Astrakharchik

unread,
Aug 8, 2017, 6:19:19 AM8/8/17
to wiremock-user
Hi Tom,

I'm facing the same problem:

{
  "id" : "b082930f-8ddd-3300-87e9-44618ab8de4a",
  "request" : {
    "url" : "/vplex/show-use-hierarchy",
    "method" : "POST",
    "bodyPatterns" : [ {
      "equalTo" : "{\"args\":\"clusters/*/virtual-volumes/*\"}"
    } ]
  },
  "response" : {
    "status" : 202,
    "bodyFileName" : "body-vplex-show-use-hierarchy-80gUu.json",
    "headers" : {
      "Server" : "Apache-Coyote/1.1",
      "Content-Type" : "application/json; format=1; prettyprint=0",
      "Transfer-Encoding" : "chunked",
      "Date" : "Fri, 04 Aug 2017 13:41:35 GMT"
    }
  },
  "uuid" : "b082930f-8ddd-3300-87e9-44618ab8de4a"
}
{
    "response": {
        "context": null,
        "message": "Command execution taking longer than 60 seconds. Command will be executed Asynchronously. Check command status at URL specified in Location",
        "exception": null,
        "custom-data": null
    }
}

After that, I'm checking the location periodically by sending the same request:

{
  "id" : "8e295021-2196-30ae-b22b-860577fb7e69",
  "request" : {
    "url" : "/vplex/commandresult/1501854095866",
    "method" : "GET"
  },
  "response" : {
    "status" : 517,
    "bodyFileName" : "body-commandresult-1501854095866-6lXKB.json",
    "headers" : {
      "Server" : "Apache-Coyote/1.1",
      "Content-Type" : "application/json; format=1; prettyprint=0",
      "Transfer-Encoding" : "chunked",
      "Date" : "Fri, 04 Aug 2017 13:41:35 GMT"
    }
  },
  "uuid" : "8e295021-2196-30ae-b22b-860577fb7e69"
}
{
    "response": {
        "context": null,
        "message": "Command execution continues to be under progress",
        "exception": null,
        "custom-data": null
    }
}

Unfortunately, the last response, the good one, is not recorded.

Is there a workaround? Does the latest version of WireMock implement stateful scenarios?

Thank you,
Andrei Astra

среда, 15 июня 2016 г., 16:09:51 UTC+3 пользователь Tom Akehurst написал:

Tom Akehurst

unread,
Aug 8, 2017, 7:28:39 AM8/8/17
to wiremock-user
Yep, latest version has a complete rewrite of the recorder. Suggest taking a look at: http://wiremock.org/docs/record-playback/

Andrei Astrakharchik

unread,
Aug 8, 2017, 7:49:56 AM8/8/17
to wiremock-user
I see now the 'Repeats as scenarios' section there.

Great! Thanks

вторник, 8 августа 2017 г., 14:28:39 UTC+3 пользователь Tom Akehurst написал:
Reply all
Reply to author
Forward
0 new messages