我开始使用空手道进行测试,但是当我使用“path”关键字时,我收到“http request failed: null”错误。
当使用以下场景时,它有效:
Feature: items
Scenario: Testing /items response status
Given url appBaseUrl + '/items'
And param param1 = 1
And param param2 = 10
When method get
Then status 200
但是当我尝试使用“path”关键字(如下面的代码所示)时,我最终收到错误
Feature: items
Scenario: Testing /items response status
Given url appBaseUrl
And path 'items'
And param param1 = 1
And param param2 = 10
When method get
Then status 200
items.feature:8 - null
com.intuit.karate.exception.KarateException: items.feature:8 - null
at ✽.When method GET (items.feature:8)
我不明白我做错了什么。是否有一些额外的步骤需要完成而我遗漏了?
一定还有其他事情发生,因为这应该有效。例如尝试这个:
* def appBaseUrl = 'http://httpbin.org/anything'
Given url appBaseUrl
And path 'items'
And param param1 = 1
And param param2 = 10
When method get
Then status 200
在我的系统上运行良好。
所以我建议你遵循这个过程:https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue
编辑:这确实是一个错误:https://github.com/intuit/karate/issues/760- 并使用karate-jersey
在修复之前是一个解决方法
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)