添加“?”时出现问题在空手道基地 URL 中。如何解决?
There is an issue when i add "?" in base URL in Karate . How to resolve it?
Background:
* url "https://abc.testrail.net/index.php?"
Scenario: : Create CHECK
Given path'/api/v2/get_case/121'
And header Content-Type = 'application/json'
When method GET
Then print response
下面是运行上面代码时API命中的url
https://abc.testrail.net/index.php/api/v2/get_case/121?
预期的 url 是 https://abc.testrail.net/index.php?/api/v2/get_case/121
由于这是一个不寻常的(在我看来是一个设计糟糕的)URL 方案,请不要使用 path
并手动形成 URL。这不是空手道的问题。
Background:
* def baseUrl = "https://freshwave.testrail.net/index.php?/api/v2/"
Scenario: : Create CHECK
Given url baseUrl + 'get_case/121'
And header Content-Type = 'application/json'
When method GET
Then print response
Background:
* url "https://abc.testrail.net/index.php?"
Scenario: : Create CHECK
Given path'/api/v2/get_case/121'
And header Content-Type = 'application/json'
When method GET
Then print response
下面是运行上面代码时API命中的url https://abc.testrail.net/index.php/api/v2/get_case/121?
预期的 url 是 https://abc.testrail.net/index.php?/api/v2/get_case/121
由于这是一个不寻常的(在我看来是一个设计糟糕的)URL 方案,请不要使用 path
并手动形成 URL。这不是空手道的问题。
Background:
* def baseUrl = "https://freshwave.testrail.net/index.php?/api/v2/"
Scenario: : Create CHECK
Given url baseUrl + 'get_case/121'
And header Content-Type = 'application/json'
When method GET
Then print response