Postman to k6 convertion #109
Unanswered
Subramanyamveeraiah
asked this question in
Q&A
Replies: 1 comment
-
Looking at the error Are you sure that the response is looking in the format in K6, you expect? You could add some console.log() with responseBodyData |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am facing a issue while running the scripts. Hope I get some help here.
The "responseBodyData.result" is printing and "responseBodyData.result._id" is printing in console
After converting from postman to k6 and running I am getting an error.
// Auto-generated by the postman-to-k6 converter
import "./libs/shim/core.js";
import "./libs/shim/urijs.js";
export let options = { maxRedirects: 4 };
const Request = Symbol.for("request");
postman[Symbol.for("initial")]({
options,
environment: {
baseUrl:
"http://tenant-XYZ.com",
tenantId: "",
tenantName: "demo2"
}
});
export default function() {
postman[Request]({
name: "Onboard tenant",
id: "69e8633c-caa9-4d6b-bae3-2de1643564cd",
method: "POST",
address: "{{baseUrl}}/tenants",
data:
'{\r\n "name": "{{tenantName}}",\r\n "handler": "test",\r\n "description": "tenant"\r\n}',
post(response) {
});
}
Error: running k6
ERRO[0007] TypeError: Cannot read property '_id' of undefined
running at post (file:///C:/workspace/k6-notification-flow2-script.js:41:34(21))
default at executePostrequest (file:///C:/workspace/libs/shim/core.js:1253:11(22))
at executeRequest (file:///C:/workspace/libs/shim/core.js:1034:25(108))
at file:///C:/workspace/libs/shim/core.js:314:30(27)
at file:///C:/workspace/k6-notification-flow2-script.js:20:19(17) executor=per-vu-iterations scenario=default source=stacktrace
Beta Was this translation helpful? Give feedback.
All reactions