LoadRunner测试AJAX
什么是AJAX?
Ajax, shorthand for Asynchronous JavaScript and XML, is a web development technique for creating interactive web applications. The intent is to make web pages feel more responsive by exchanging small amounts of data with the server behind the scenes, so that the entire web page does not have to be reloaded each time the user requests a change.This is meant to increase the web page's interactivity, speed, and usability.
The Ajax technique uses a combination of:
- XHTML (or HTML) and CSS, for marking up and styling information.
- The DOM accessed with a client-side scripting language, especially ECMAScript implementations such as JavaScript and JScript, to dynamically display and interact with the information presented.
- The XMLHttpRequest object is used to exchange data asynchronously with the web server. In some Ajax frameworks and in certain situations, an IFrame object is used instead of the XMLHttpRequest object to exchange data with the web server, and in other implementations, dynamically added <script> tags may be used.
- XML is sometimes used as the format for transferring data between the server and client, although any format will work, including preformatted HTML, plain text, JSON and even EBML. These files may be created dynamically by some form of server-side scripting.
Like DHTML, LAMP and SPA, Ajax is not a technology in itself, but a term that refers to the use of a group of technologies.
JSON
JavaScript Object Notation (JSON) is a lightweight format for representing
objects and their state. Major technology providers, such as Yahoo WS
and Microsoft ASP.NET, have chosen JSON for client-server data exchange
as an alternative to XML, because it can be parsed more easily than XML.
For example, JSON objects can be de-serialized by simply passing them to the JavaScript evalfunction.
LoadRunner支持的AJAX框架
LoadRunner支持的AJAX框架比较少,以下内容摘自http://www.wilsonmar.com/ajax_rec.htm:
HP has stated that they support these frameworks for AJAX functions:
- Atlas 1.0.10920.0/ASP.NET AJAX (All controls) (developed using Visual Studio 2005). LoadRunner 9.10 supported the Atlas 2.0 version in Visual Studio 2005.
- This is one generation behind the ASP.NET 3.5 AJAX AjaxControlToolkit shown on the their sample website. However, I have been able to use LoadRunner 9.51 to work with many MS AJAX 3.5 controls even though some controls are not being created during recording.
- Scriptaculous 1.8 — Autocomplete, Reorder List, and Slider
- Atlas 1.0.10920.0/ASP.NET AJAX (All controls) (developed using Visual Studio 2005). LoadRunner 9.10 supported the Atlas 2.0 version in Visual Studio 2005.
HP advertises that VuGen supports these frameworks at the "engine level", implying that VuGen will create Web Click and Script LoadRunner functions, but not LoadRunner's AJAX specific functions:
- Prototype 1.6
- Google Web Toolkit (GWT) 1.4
I've heard that additional licensing is needed for LoadRunner to support the Infragistics library. What is the HP product code for this, if it exists???
LoadRunner的AJAX函数
LR9.0:
VuGen supports recording for the following ASP.NET AJAX controls: Accordion, Collapsible Panel, Rating, Reorder List, and Slider.
|
Function Name |
Description |
|
Emulates a user extending or collapsing a menu. |
|
|
Emulates a user collapsing or expanding sections on a web page. |
|
|
Emulates a user setting a value of a rating control. |
|
|
Emulates a user reordering elements in a list. |
|
|
Emulates setting a value using a slider control. |
LR9.5:
The supported frameworks for AJAX functions are:
➤ Atlas 1.0.10920.0/ASP.NET AJAX—All controls
➤ Scriptaculous 1.8—Autocomplete, Reorder List, and Slider
VuGen supports the following frameworks at the engine level. This implies
that VuGen will create standard Web Click and Script steps, but not AJAX
specific functions:
➤ Prototype 1.6
➤ Google Web Toolkit (GWT) 1.4
|
Function Name |
Description |
|
Emulates a user extending or collapsing a menu. |
|
|
Selects an item from a list based on text entered in a field. |
|
|
Emulates a user collapsing or expanding sections on a web page. |
|
|
Emulates a user setting a value of a rating control. |
|
|
Emulates a user reordering elements in a list. |
|
|
Emulates setting a value using a slider control. |
|
|
Emulates use of folder-style tabs in Atlas applications. |
LoadRunner测试AJAX的例子
以asp.net ajax的在线samples为例:
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Slider/Slider.aspx
测试其中的slider,LoadRunner可以录制下脚本,并调用ajax_slider函数来处理slider控件的行为:
web_browser("Slider.aspx",
DESCRIPTION,
ACTION,
"Navigate=http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Slider/Slider.aspx",
LAST);
ajax_slider("Slider",
DESCRIPTION,
"Framework=atlas",
"ID=ctl00_SampleContent_Slider1",
ACTION,
"UserAction=SetValue",
"Value=100",
LAST);
执行JavaScript的方法
使用web_browser函数,可以通过给EvalJavaScript属性赋值来执行javaScript语句,例如访问DOM,用EvalJavaScriptResultParam属性可以把语句执行的结果存入参数:
web_browser("keyId_Get",
ACTION,
"EvalJavaScript=document.getElementById(/"ctl00_SampleContent_Slider1_BoundControl/").innerText;",
"EvalJavaScriptResultParam=strValue",
LAST);
lr_output_message(lr_eval_string("{strValue}"));
LoadRunner测试AJAX的更多相关文章
- LoadRunner测试ajax框架,回放后系统中没有产生数据解决方法
1.QTP11 下载地址:http://www.genilogix.com/downloads/unified-functional-testing/quicktest-professional-11 ...
- loadrunner测试ajax框架
loadrunner测试ajax框架的系统时,录制回放都没有报错,但是回放后系统中没有产生数据,解决方法 loadrunnerajax框架测试脚本headerajax [问题描述]用loadrunne ...
- LoadRunner测试ajaxweb程序攻略
用loadrunner测试WEB程序的时候总是会碰到AJAX或者ActiveX实现的功能,而通常这些功能会包含很多客户端函数(一般为JavaScript).我们该如何处理?如果从功能实现的角度去考虑这 ...
- 本地测试AJAX请求
要在本地测试AJAX,首先是环境的搭建,因为XHR对象的open方法中参数url是指文件在服务器上的文件.下面以WampServer为例. 1. 下载wamp的安装包,下载地址为:http://221 ...
- LoadRunner测试结果分析03 转载至zhangzhe的新浪博客
LoadRunner测试结果分析之我见 前面分析的Web Resource(网络资源)的测试情况,其主要关注的是服务器性能,而系统本身和环境都有可能存在问题,页面诊断(Web Page Diagnos ...
- LoadRunner测试结果分析02 转载至zhangzhe的新浪博客
LoadRunner测试结果分析之我见 上述测试过程的重点在于事务,而LoadRunner生成的测试结果图并不局限于事务上,其中还有是关于Vusers.Errors.Web Resources.Web ...
- LoadRunner测试结果分析01 转载至zhangzhe的新浪博客
LoadRunner测试结果分析之我见 LoadRunner生成测试结果并不代表着这次测试结果的结束,相反,这次测试结果的重头戏才刚刚开始.如何对测试结果进行分析,关系着这次测试的成功与否.网上关于L ...
- LoadRunner测试场景中添加负载生成器
如何在LoadRunner测试场景中添加负载生成器 本文对如何在LoadRunner的测试场景中添加负载生成器,如何使用负载生成器的方法,总结形成操作指导手册,以指导测试人员指导开展相关工作. 1.什 ...
- LoadRunner测试50人同时登陆下单
LoadRunner测试50人同时登陆下单 一.LoadRunner简介 LoadRunner,是一种预测系统行为和性能的负载测试工具.通过以模拟上千万用户实施并发负载及实时性能监测的方式来确认和查找 ...
随机推荐
- 团队开发中git分支的使用
1.Github上保持两个分支:master和develop. master是主分支,对项目进行tag或发布版本等操作,都必须在该分支上进行.最好设为不可提交只能合并的. develop是开发分支,从 ...
- AC日记——[NOIP2015]运输计划 cogs 2109
[NOIP2015] 运输计划 思路: 树剖+二分: 代码: #include <cstdio> #include <cstring> #include <iostrea ...
- P问题,NP问题 NPC问题 大神解答
http://blog.sina.com.cn/s/blog_5212bec30100o03y.html http://blog.csdn.net/u010385646/article/details ...
- python3爬虫爬取煎蛋网妹纸图片(下篇)2018.6.25有效
分析完了真实图片链接地址,下面要做的就是写代码去实现了.想直接看源代码的可以点击这里 大致思路是:获取一个页面的的html---->使用正则表达式提取出图片hash值并进行base64解码--- ...
- Codeforces 1038E Maximum Matching
可能写了个假算法 假设定义:含有一个欧拉路的图为类欧拉图 欧拉路的定义:一个无向连通图中,存在一条路径对所有边都遍历且仅遍历一次:判断方法:该连通图中度为奇数的点的个数不能超过2,即为0或者2 题目解 ...
- Linux命令之ps
ps [选项] 报告当前进程状态.ps显示有关选择的活动进程的信息.如果要重复更新选择和显示的信息,请使用top.ps命令可以搭配kill随时中断.删除不必要的程序.ps命令是最基本同时也是非常强大的 ...
- 数据结构-二叉搜索树(BST binary search tree)
本文由@呆代待殆原创,转载请注明出处:http://www.cnblogs.com/coffeeSS/ 二叉搜索树简介 顾名思义,二叉搜索树是以一棵二叉树来组织的,这样的一棵树可以用一个链表数据结构来 ...
- mysql 列转行,合并字段的方法
数据表(表名:xsk) +----+------+-----------+-------+ | id | name| course | score | +----+------+----------- ...
- [CF441E]Valera and Number
题意:给定$x,k,p$和一份伪代码,伪代码大致是循环$k$次,每次有$p\%$的概率把$x$乘$2$,有$(100-p)\%$的概率把$x$加$1$,问最后在二进制下$x$的末尾期望$0$个数 鸽了 ...
- MetaWeblog是什么
MetaWebBlog API(MWA)是一个Blog程序接口标准,允许外部程序来获取或者设置Blog的文字和熟悉.他建立在XMLRPC接口之上,并且已经有了很多的实现. 所以现在很多博客系统都支持这 ...