Forum Discussion

Olga_T's avatar
Olga_T
SmartBear Alumni (Retired)
7 years ago

Develop a Script [part II] – Win in API Summer!

Hi Community,

 

Did you miss our suggestions for API Summer 2018 new topics? As a follow-up to the previous ideas, we have prepared a couple more:

 

  • Assertions Statuses and Messages

Create a script, which outputs information about each assertion after TestCase execution (Status and Message) to the log. 

 

  • Unescape JSON Strings

Create a Groovy script, which unescapes JSON strings in the body of a REST API response before the response in shown in the response editor:

Example of original response body:

{
"employee": "{\"name\":\"John\", \"age\":30, \"city\":\"New York\"}"
}

Example of the corresponding modified response body: 

{
"employee": {
"name": "John",
  "age": 30,
  "city": "New York"
}
}

 

Share your scripts, get more points, and hit the top of the leaderboard this week!