Karate API - Assertion with fuzzy matching #number

半城伤御伤魂 提交于 2019-12-14 02:43:27

问题


path: $.ActiveScriptJobID, actual: '17124', expected: '#number', reason: not a number

Above error message displays for below scenario

Given path 'admin/rest/activescript/job/17124' When method get Then status 200 * match resp.ActiveScriptJobID == "#number"


回答1:


You haven't provided the actual response so your question is incomplete.

But check the JSON. It is sure to be a string (within quotes) not a number.

Maybe you need to use a regex: https://github.com/intuit/karate#fuzzy-matching

* match response.ActiveScriptJobID == "#regex \\d+"


来源:https://stackoverflow.com/questions/57760686/karate-api-assertion-with-fuzzy-matching-number

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