当前位置:网站首页>Error report of curl import postman

Error report of curl import postman

2022-06-10 23:55:00 InfoQ


Preface

Here is a test case system , It is convenient for manual personnel and automation personnel to cooperate to manage the test case library , There is a process when the script is written automatically , Just manually add an automated tag to this use case , I'm not used to it , There is no synchronization at the same time , When I finished writing the script happily , Go to the system to add the corresponding tag , Unexpectedly 100 Multiple , It is necessary to add one by one by hand , Waste hands , I just want to write a script to add it automatically .

problem

I found the corresponding interface , First use postman Local debugging , Then write the script , Two interfaces are used ,get  and put, get Copy from the browser to curl form , Import postman normal , debugging ok. put Report on arg.startsWith is not a function This is a mistake

Pictured

null
Import postman

null
Carefully analyze the put Interface , Found to be data-raw The double quotation marks of the data inside are as long as those copied --data-raw "{"title":"[ORI_DA_LBA_002][WAB-Client] Verify add third party bank",

hold json Double quotation marks in the string are changed to single quotation marks , Then save and re import ok--data-raw "{'title':'[ORI_DA_LBA_002][WAB-Client] Verify add third party bank',

But this problem is not inevitable ,  I changed the use case , Copied out put Interface json This is the same string exported from the string , But import postman There is no error , I should not have found the crux of the problem
原网站

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/161/202206102240189293.html