空手道获得电话通行证,邮递员获得通行证 [英] get call passes randomly in karate and passes consistently in postman

查看:64
本文介绍了空手道获得电话通行证,邮递员获得通行证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试致电get call.这些呼叫未始终通过.我在哪里获得适当的CXRF令牌.

I am trying to call get call. These calls are not passing consistently. Where I am getting proper CXRF token.

获取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

附上截图以供参考

推荐答案

请检查是否已传递所有必需的标头.

Please check whether you have passed all the necessary headers.

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

Most likely you missed one - for example a cookie that is needed.

这篇关于空手道获得电话通行证,邮递员获得通行证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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