本文介绍了是否可以在Karate中执行WebUI自动化的性能测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Karate 0.9.5.RC5开发WebUI自动化测试,并且运行良好.有人知道如何在Karate中执行性能测试以进行WebUI自动化测试吗?

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?

推荐答案

很高兴听到您的声音,并感谢您的反馈.老实说,到目前为止,我们一直专注于API性能测试和UI功能测试自动化.也许您可以尝试并分享您发现的内容来为我们提供帮助.

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.

您必须了解 Gatling集成,以提高API性能测试.因此,我们准备了一些难题.

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:

  • 识别由UI进行的API调用,将来我们希望自动从Chrome网络/devtools中获取它们
  • 手动将API调用转换为空手道测试,请注意,VS Code插件可以选择从cURL
  • 现在您可以将空手道测试转换为性能测试,对于大多数团队来说,这就足够了
  • 如果需要,您可以添加一些空手道调用来加载HTML和静态资源,以使加载配置文件更加逼真
  • 最后,可以并行运行空手道UI测试,只是为了衡量真实用户"体验并衡量浏览器端的HTML/JS加载时间等.我们尚无此功能,但应该可以从Chrome浏览器获取所有页面计时和性能统计信息
  • 潜在地,您可能会考虑使用Docker并行地多个Chrome实例-但是,这又是一个值得探索的地方
  • 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

这篇关于是否可以在Karate中执行WebUI自动化的性能测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-24 18:33