让电话在空手道中随机传递并在邮递员中始终如一地传递

get call passes randomly in karate and passes consistently in postman

我正在尝试拨打接听电话。这些电话没有始终如一地通过。我在哪里获得正确的 CXRF 令牌。

GET URL 调用:

Given url appServer +'/integration/live/rest/accessProfile'+'?page=0'+'&pageSize=10'+'&sortBy=name'+'&fieldList=name,id,date_created,date_modified,created_id,modified_id'+'&filter=id%20not%20equal%20to%20%27200%27%20AND%20id%20not%20equal%20to%20%27100%27%20AND%20id%20not%20equal%20to%20%27101%27%20AND%20id%20not%20equal%20to%20%27102%27%20AND%20id%20not%20equal%20to%20%27103%27%20'+'&getTotalRecordCount=true

完整代码:

Scenario: create Access Profile
Given url appServer +'/integration/live/rest/accessProfile'+'?page=0'+'&pageSize=10'+'&sortBy=name'+'&fieldList=name,id,date_created,date_modified,created_id,modified_id'+'&filter=id%20not%20equal%20to%20%27200%27%20AND%20id%20not%20equal%20to%20%27100%27%20AND%20id%20not%20equal%20to%20%27101%27%20AND%20id%20not%20equal%20to%20%27102%27%20AND%20id%20not%20equal%20to%20%27103%27%20'+'&getTotalRecordCount=true'
And header X-CSRF-TOKEN = csrfToken
* cookie JSESSIONID = jsessionid

Given request ' '
When method get
Then status 200
And print response
Then match response.platform.message.code contains '0'
Then match response.platform.message.description contains 'Success'


* def accessProfileNames = get response.platform.record[*].name
* print accessProfileNames
Then  match accessProfileNames contains 'TestAccessProfile'


#fetch the access profile id
* def AccessProfileNode = get[0] response.platform.record[?(@.name=='TestAccessProfile')]
* def accessProfileId = AccessProfileNode.id
* print accessProfileId

附上截图以供参考

请检查您是否通过了所有必要的headers。

很可能您错过了一个 - 例如需要的 cookie。