robot framework 接口测试返回错误

用rf测试接口很多了,像往常一样写:


购物车新增完成
    ${dict}    create dictionary    Content-Type=application/x-www-form-urlencoded
    create session    api    ${url}    headers=${dict}
    ${commdata}    create dictionary    good_id=1    amount=3    token=${token}
    ${addr}    post request    api    /appInterface/cart/add    data=${commdata}    headers=${dict}
    should be equal as strings    ${addr.status_code}    ${200}
    ${responsedata}    set variable    ${addr.json()}
    ${code}    get from dictionary    ${responsedata}    code
    ${msg}    get from dictionary    ${responsedata}    msg
    delete all sessions

 

接口那边一直返回错误:

注:接口定义乱七八糟的其他错误都是返回:500 网络请求失败的错误

但是我用其他的工具,jmeter和runapi 都试过,可以成功返回:{"code":200,"msg":"成功"}

 

 

 

百思不得其解。。。。。。。。如果找不出原因,只能弃用RF了。

记录下,后续找到解决办法再更新。。。。。。。。。。。。。。。。

 

posted on 2017-12-01 18:06  张&娟  阅读(413)  评论(0编辑  收藏  举报

导航