How to match the following in karate

て烟熏妆下的殇ゞ 提交于 2019-12-13 11:18:11

问题


My database output is as follows {web,app}

Output from response is as follows ["web","app"]

How to match these two in karate?


回答1:


Your database output {web,app} doesn't follow any proper data structure.

it would be difficult to iterate over this.

I assume it is a String

Edit:

if it is a string you write a js to get that as a convenient data structure (array)

* def pList = function(x) { return x.replace("{","").replace("}","").split(",") }

now pass your particular value to this function and it would give you an array of values which you can easily match



来源:https://stackoverflow.com/questions/53079269/how-to-match-the-following-in-karate

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!