什么是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 eval function.

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

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,and Slider.

Function Name

Description

ajax_accordion

Emulates a user extending or collapsing a menu.

ajax_collapsiblepanel

Emulates a user collapsing or expanding sections on a web page.

ajax_rating

Emulates a user setting a value of a rating control.

ajax_reorderlist

Emulates a user reordering elements in a list.

ajax_slider

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,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

ajax_accordion

Emulates a user extending or collapsing a menu.

ajax_autocomplete

Selects an item from a list based on text entered in a field.

ajax_collapsiblepanel

Emulates a user collapsing or expanding sections on a web page.

ajax_rating

Emulates a user setting a value of a rating control.

ajax_reorderlist

Emulates a user reordering elements in a list.

ajax_slider

Emulates setting a value using a slider control.

ajax_tabs

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",

"Framework=atlas",

"ID=ctl00_SampleContent_Slider1",

"UserAction=SetValue",

"Value=100",

LAST);

执行JavaScript的方法

使用web_browser函数,可以通过给EvalJavaScript属性赋值来执行javaScript语句,例如访问DOM,用EvalJavaScriptResultParam属性可以把语句执行的结果存入参数:

web_browser("keyId_Get",

"EvalJavaScript=document.getElementById(/"ctl00_SampleContent_Slider1_BoundControl/").innerText;",

"EvalJavaScriptResultParam=strValue",

LAST);

lr_output_message(lr_eval_string("{strValue}"));

LoadRunner测试AJAX的更多相关文章

  1. uislider – Sprite Kit iOS7 – 添加滑块

    我以为你可以在精灵套件应用程序中添加UIKit滑块/或按钮.但无法弄清楚如何做到这一点,以编程方式创建滑块的代码是以上不起作用,视图的子视图数量保持不变我假设我必须将它作为子项添加到我的图层,但addChild方法不适用于UiSlider.它需要是一个SKNode本身.我在这里的场景课中叫这个感谢评论,我可以让它显示–但我必须在viewController类中添加,就像这样在实际的场景类中是否没有它去做…

  2. 应用程序关闭时的iOS任务

    我正在构建一个应用程序,通过ajax将文件上传到服务器.问题是用户很可能有时不会有互联网连接,并且客户希望在用户重新连接时安排ajax调用.这可能是用户在离线时安排文件上传并关闭应用程序.应用程序关闭时可以进行ajax调用吗?

  3. swift UI专项训练31 Slider 滑块

    滑块是用一种渐进柔和的方式来展示一种设置或者一个进度。滑块的基类是UiSlider,属性比较简单主要是最小值最大值和当前值。):它最主要的事件就是值变更,跟我们之前遇到的控件差不多,现在我们让label显示滑动的当前值,最小是0,最大是10,我们上面设置过的。因为sender的值是个浮点数,所以我们要转成String,效果如下:

  4. [Swift]UIKit学习之滑块控件UISlider的用法

    UIKit学习之滑块控件UiSlider的用法Slider:Slidersenableuserstointeractivelymodifysomeadjustablevalueinanapp,suchasspeakervolumeorscreenbrightness.UiSlider:AUiSliderobjectisavisualcontrolusedtoselectasinglevaluefr

  5. swift中UISlider的使用

  6. 在Android应用程序中启用Media Volume Slider

    当按下硬件音量增大/减小按钮时,某些Android程序会触发“媒体音量”滑块.我的应用程序似乎在按下硬件按钮时设置振铃器音量.如何启用媒体音量滑块?

  7. android – Phonegap本地构建 – jquery ajax错误:readystate 0 responsetext status 0 statustext error

    解决方法您是否在索引文件中包含了内容安全元标记?

  8. Ajax简单的异步交互及Ajax原生编写

    一提到异步交互大家就会说ajax,仿佛ajax这个技术已经成为了异步交互的代名词.那下面将研究ajax的核心对象

  9. Ajax跨域问题的解决办法汇总(推荐)

    本文给大家分享多种方法解决Ajax跨域问题,非常不错具有参考借鉴价值,感兴趣的朋友一起学习吧

  10. ajax编写简单的登录页面

    这篇文章主要为大家详细介绍了ajax编写简单登录页面的具体代码,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

随机推荐

  1. xe-ajax-mock 前端虚拟服务

    最新版本见Github,点击查看历史版本基于XEAjax扩展的Mock虚拟服务插件;对于前后端分离的开发模式,ajax+mock使前端不再依赖后端接口开发效率更高。CDN使用script方式安装,XEAjaxMock会定义为全局变量生产环境请使用xe-ajax-mock.min.js,更小的压缩版本,可以带来更快的速度体验。

  2. vue 使用 xe-ajax

    安装完成后自动挂载在vue实例this.$ajaxCDN安装使用script方式安装,VXEAjax会定义为全局变量生产环境请使用vxe-ajax.min.js,更小的压缩版本,可以带来更快的速度体验。cdnjs获取最新版本点击浏览已发布的所有npm包源码unpkg获取最新版本点击浏览已发布的所有npm包源码AMD安装require.js安装示例ES6Module安装通过Vue.use()来全局安装示例./Home.vue

  3. AJAX POST数据中文乱码解决

    前端使用encodeURI进行编码后台java.net.URLDecoder进行解码编解码工具

  4. Koa2框架利用CORS完成跨域ajax请求

    实现跨域ajax请求的方式有很多,其中一个是利用CORS,而这个方法关键是在服务器端进行配置。本文仅对能够完成正常跨域ajax响应的,最基本的配置进行说明。这样OPTIONS请求就能够通过了。至此为止,相当于仅仅完成了预检,还没发送真正的请求呢。

  5. form提交时,ajax上传文件并更新到&lt;input&gt;中的value字段

  6. ajax的cache作用

    filePath="+escape;},error:{alert;}});解决方案:1.加cache:false2.url加随机数正常代码:网上高人解读:cache的作用就是第一次请求完毕之后,如果再次去请求,可以直接从缓存里面读取而不是再到服务器端读取。

  7. 浅谈ajax上传文件属性contentType = false

    默认值为contentType="application/x-www-form-urlencoded".在默认情况下,内容编码类型满足大多数情况。在这里,我们主要谈谈contentType=false.在使用ajax上传文件时:在其中先封装了一个formData对象,然后使用post方法将文件传给服务器。说到这,我们发现在JQueryajax()方法中我们使contentType=false,这不是冲突了吗?这就是因为当我们在form标签中设置了enctype=“multipart/form-data”,

  8. 909422229_ajaxFileUpload上传文件

    ajaxFileUpload.js很多同名的,因为做出来一个很容易。我上github搜AjaxFileUpload出来很多类似js。ajaxFileUpload是一个异步上传文件的jQuery插件传一个不知道什么版本的上来,以后不用到处找了。语法:$.ajaxFileUploadoptions参数说明:1、url上传处理程序地址。2,fileElementId需要上传的文件域的ID,即的ID。3,secureuri是否启用安全提交,默认为false。4,dataType服务器返回的数据类型。6,error

  9. AJAX-Cache:一款好用的Ajax缓存插件

    原文链接AJAX-Cache是什么Ajax是前端开发必不可少的数据获取手段,在频繁的异步请求业务中,我们往往需要利用“缓存”提升界面响应速度,减少网络资源占用。AJAX-Cache是一款jQuery缓存插件,可以为$.ajax()方法扩展缓存功能。

  10. jsf – Ajax update/render在已渲染属性的组件上不起作用

    我试图ajax更新一个有条件渲染的组件。我可以确保#{user}实际上是可用的。这是怎么引起的,我该如何解决呢?必须始终在ajax可以重新呈现之前呈现组件。Ajax正在使用JavaScriptdocument.getElementById()来查找需要更新的组件。但是如果JSF没有将组件放在第一位,那么JavaScript找不到要更新的内容。解决方案是简单地引用总是渲染的父组件。

返回
顶部