如何性能测试的AngularJS Web应用程序? [英] How to performance test an AngularJS Web Application?

查看:222
本文介绍了如何性能测试的AngularJS Web应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前做的网站上的性能测试主要与JMeter的脚本。

I used to do performance testing on websites mostly with JMeter scripts.

然而,越来越多的项目是建立与前端MVC的,如AngularJS和当前项目加载的是它是通过角视图文件的内容,REST调用等。
不幸的是,JMeter的不执行任何JavaScript这样我的负载测试回到我在短短(400毫秒)的主页。
在真实的,它实际上需要几秒钟在浏览器中加载。当我检查响应数据,它不包含任何数据,由于棱角分明。

However, more and more projects are build with frontend MVC's, such as AngularJS and a current project is loading all of it's content via angular view files, REST calls etc. Unfortunately, JMeter doesn't execute any javascript thus my load test return me the homepage in just (400ms). In real, it actually takes several seconds to load in a browser. When I check the response data, it does not contain any data yet due to Angular.

相反,调查网络流量并单独加载每个组件(例如profile.html,notification.html,REST调用等)。有市场上的产品或者我可以按照类似于执行JMeter的脚本,但考虑到外部资源的JavaScript执行和加载由于JavaScript的一些最好的情况?

Instead of investigating the network traffic and individually loading each component (e.g. profile.html, notification.html, REST calls etc. ). Is there a product on the market or some best case I could follow that is similar to executing JMeter scripts, but considering javascript execution and loading of external resources due to javascript?

(我不打算来分析JavaScript的执行时间。这仍然是测试如果基础设施落后是能够服务XYZ并发用户)

(I am not planning to profile javascript execution times. This is still to test if the infrastructure behind is capable serving xyz simultaneous users)

推荐答案

虽然JMeter是不是能够执行客户端JavaScript它可以记录通过的 HTTP(S)测试脚本记录。一旦记录,你应该能够将所有独立的请求组合成一个聚集使用JMeter的事务控制器

Although JMeter isn't capable of executing client-side JavaScript it can record relevant requests via HTTP(S) Test Script Recorder. Once recorded you should be able to combine all the standalone requests into one "aggregate" using JMeter's Transaction Controller

如果由于某种原因,这个简单的方法不会为你检查出的如何负载测试AJAX / XHR启用站点使用JMeter 获得更多的选择和线索。

If this easy approach for some reasons doesn't play for you check out How to Load Test AJAX/XHR Enabled Sites With JMeter for more options and clues.

这篇关于如何性能测试的AngularJS Web应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆