空手道API-带有模糊匹配#号的断言 [英] Karate API - Assertion with fuzzy matching #number
问题描述
路径:$ .ActiveScriptJobID,实际:"17124",预期:#number",原因:不是数字
path: $.ActiveScriptJobID, actual: '17124', expected: '#number', reason: not a number
在以下情况下显示以上错误消息
Above error message displays for below scenario
给出路径'admin/rest/activescript/job/17124' 方法获得时 然后状态200 *匹配resp.ActiveScriptJobID =="#number"
Given path 'admin/rest/activescript/job/17124' When method get Then status 200 * match resp.ActiveScriptJobID == "#number"
推荐答案
您尚未提供实际答复,因此您的问题不完整.
You haven't provided the actual response so your question is incomplete.
但是请检查JSON.一定是字符串(带引号)而不是数字.
But check the JSON. It is sure to be a string (within quotes) not a number.
也许您需要使用正则表达式: https://github.com/intuit/karate #fuzzy-matching
Maybe you need to use a regex: https://github.com/intuit/karate#fuzzy-matching
* match response.ActiveScriptJobID == "#regex \\d+"
这篇关于空手道API-带有模糊匹配#号的断言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!