问题
I am developing WebUI automation tests using Karate 0.9.5.RC5 and it is working wonderfully. Does anyone know how to execute performance testing in Karate for WebUI Automation tests?
回答1:
That's great to hear and thanks for the feedback. To be honest, we have focused on API perf testing and UI functional test automation so far. Maybe you can help us by experimenting and sharing what you find.
You must be aware of the Gatling integration for API performance testing. So we have some pieces of the puzzle in place.
So maybe a hybrid strategy is best:
- identify the API calls being made by the UI, in the future we would like to derive them automatically from the Chrome network / devtools
- manually convert the API calls to Karate tests, note that the VS Code plugin has an option to import from cURL
- now you can convert the Karate tests to a performance test, and for most teams, this is sufficient
- if needed, you can add some Karate calls to load HTML and static resources to make the load profile more realistic
- finally, it may be possible to run a Karate UI test in parallel, just to measure "real user" experience and measure the HTML / JS load times etc on the browser side. we don't have this in place yet, but it should be possible to get all the page timings and perf-stats from Chrome
- potentially you could look at spinning up multiple Chrome instances in parallel using Docker - but again, this is something yet to be explored
来源:https://stackoverflow.com/questions/60100607/is-it-possible-to-execute-performance-test-in-karate-for-webui-automation