HttpRunner中extract问题取值报Failed to extract!

报错:

HttpRunner中extract问题取值报Failed to extract!_第1张图片

ERROR    Failed to extract! => data.rows[0].{modifyby}
response body: {'code': 0, 'data': {'totalpage': 1, 'total': 3, 'pagesize': 50, 'pageindex': 1, 'rows': [{'modifyby': '10001', 'modifytime': 1563968714125, 'sourceno': '', 'skuunit': '箱', 'qtyallocated': 0.0, 'skuname': '可口可乐600ml', 'companyid': '155255889186529280', 'createby': '10001', 'companycode': '100', 'warehouseid': '328623759646851075', 'sourcetype': -100, 'id': '338732716663013376', 'warehousecode': '9D15', 'vendorcode': '1', 'isdel': 0, 'barcode': '6901939651605', 'categoryid': '12300104', 'holdflag': 2, 'createtime': 1563960173002, 'lpnid': '0', 'skucode': '101963', 'lpncode': '', 'produceddate': '20190627', 'discountrate': 0.75, 'locationcode': 'QC01', 'discountendtime': 1565532000000, 'lotno': '20190627_1', 'companyname': '会员店', 'locationid': '328629307670855686', 'locationtype': 14, 'qtyonhand': 5.0, 'skuid': '507', 'warehousename': '永辉上海市普陀区志丹路会员店'}, {'modifyby': '10001', 'modifytime': 1563968699116, 'sourceno': '', 'skuunit': '瓶', 'qtyallocated': 0.0, 'skuname': '可口可乐800ml', 'companyid': '155255889186529280', 'createby': '10001', 'companycode': '100', 'warehouseid': '328623759646851075', 'sourcetype': -100, 'id': '338426399163449344', 'warehousecode': '9D15', 'vendorcode': '20006631', 'isdel': 0, 'barcode': '6901939651605', 'categoryid': '12300101', 'holdflag': 2, 'createtime': 1563887141219, 'lpnid': '0', 'skucode': '101963', 'lpncode': '', 'produceddate': '20190627', 'discountrate': 0.75, 'locationcode': 'QC01', 'discountendtime': 1565532000000, 'lotno': '20190627_20006631', 'companyname': '会员店', 'locationid': '328629307670855686', 'locationtype': 14, 'qtyonhand': 1.0, 'skuid': '507', 'warehousename': '永辉上海市普陀区志丹路会员店'}, {'modifyby': '10001', 'modifytime': 1563886930672, 'sourceno': '', 'skuunit': '瓶', 'qtyallocated': 0.0, 'skuname': '可口可乐800ml', 'companyid': '155255889186529280', 'createby': '10001', 'companycode': '100', 'warehouseid': '328623759646851075', 'sourcetype': -100, 'id': '338423034144653312', 'warehousecode': '9D15', 'vendorcode': '20006636', 'isdel': 0, 'barcode': '6901939651605', 'categoryid': '12300101', 'holdflag': 2, 'createtime': 1563886338936, 'lpnid': '0', 'skucode': '101963', 'lpncode': '', 'produceddate': '20190627', 'discountrate': 0.75, 'locationcode': 'QC01', 'discountendtime': 1565532000000, 'lotno': '20190627_20006636', 'companyname': '会员店', 'locationid': '328629307670855686', 'locationtype': 14, 'qtyonhand': 3.0, 'skuid': '507', 'warehousename': '永辉上海市普陀区志丹路会员店'}]}, 'now': 1563969472916}
 

 

---------抓包的response:

可以看出来rows里面有2个{}

HttpRunner中extract问题取值报Failed to extract!_第2张图片

 

报错原因:

Failed to extract! => data.rows[0].{modifyby} 提取不到

 

解决办法:

参数提取器这样写就可以提取到modifyby的值

"extract":[
                     {"modifyby":"content.data.rows.0.modifyby"}
                 ] 

 

 

 

你可能感兴趣的:(HttpRunner中extract问题取值报Failed to extract!)