空手道API-带有模糊匹配#号的断言 [英] Karate API - Assertion with fuzzy matching #number

查看:86
本文介绍了空手道API-带有模糊匹配#号的断言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

路径:$ .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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆