-
-
Notifications
You must be signed in to change notification settings - Fork 438
Open
Description
Please find below attached json requests.
here,
${$.POST_QUESTIONS.response.body.id} is #37:29 every-time its different.
How we can encode like %2337%3A1529
we need to send that encoded data in next URL. how to do it in Zerocode.
ex. String input ="#37:29";
String encoded = URLEncoder.encode(input,"UTF-8");
System.out.println(encoded);
// Output: %2337%3A1529
{
"scenarioName": "POST_QUESTION",
"ignoreStepFailures": true,
"steps": [
{
"name": "POST_QUESTIONS",
"url": "/questions",
"operation": "POST",
"request": {
"headers": {
"Authorization": "Bearer ${bearertoken}"
},
"body": {
"question": "zerocode"
}
},
"assertions": {
"status": 201,
"body": {
"id": "${$.POST_QUESTIONS.response.body.id}"
}
}
},
{
"name": "GET_QUESTIONS",
"url": "/questions",
"operation": "GET",
"request": {
"headers": {
"Authorization": "Bearer ${bearertoken}"
}
},
"assertions": {
"status": 200
}
},
{
"name": "UPDATE_QUESTION",
"url": "/questions/${$.POST_QUESTIONS.response.body.id}",
"operation": "PUT",
"request": {
"headers": {
"Authorization": "Bearer ${bearertoken}"
},
"body": {
"id": "#43:118",
"question": "Zerocode Question 123"
}
},
"assertions": {
"status": 200
}
},
{
"name": "DELETE_QUESTION",
"url": "/questions/${$.POST_QUESTIONS.response.body.id}",
"operation": "DELETE",
"request": {
"headers": {
"Authorization": "Bearer ${beareretoken}"
}
},
"assertions": {
"status": 204
}
}
]
}
Metadata
Metadata
Assignees
Labels
No labels