问题
What automation to do when have to test REST APIs, how to do, and how to get final conformance report, great to be in excel workbook having all API's test report detail.
Input file can be an excel workbook or XML file, let's say excel having APIs detail.
Main problem I am facing in comparing input expected and response payload, please consider it as JSON and as a result decision should be taken stating test PASS/FAIL.
In answer section going to upload developed scripts to do most of the automation except conformance over JSON, which I am looking here.
回答1:
"problem I am facing in comparing input expected and response payload"
- Have you tried using zerocode rest test library ? You can copy paste the JSON into the request response of the test case and then the framework takes care of comparing and asserting.. And/Or You can place/organize them in thesrc/test/resources
and point them from your test cases(JUnit or Suite). Frameworks then takes care of end point invocation usingapache HttpClient
, also optionally you can override the HttpClient in your way(if you need)."how to get final conformance report, great to be in excel workbook having all API's test report detail"
- It generates report in the tabular excel format with result PASS/FAIL in the last column(See here sample report) in to the target folder for every run with timestamped. Also you get a Spike Interactive Report with statistics of which API took how much time(in mili second). Hover the mouse on the individual spike to list the details.See the Test Report and Test Log section here for more details.
Beauty is no extra code is needed other than your request/response JSON
Hope this helps :-)
来源:https://stackoverflow.com/questions/38972221/api-automation-groovy-soapui-all-together-for-most