|
AJAX Scripting in LoadRunnerThis page analyzes (truthfully, without the hype and generalizations) the issues around recording and running LoadRunner C scripts on websites built using the AJAX design pattern. |
|
When the term AJAX was coined by Jesse James Garrett in his blog on February 18, 2005, many in the industry were still struggling to achieve common behavior among browsers and using Adobe Flash to build RIA (Rich Internet Applications).
After Gmail, Outlook WebMail offered selective update of a web page rather than refreshing the entire page with each user action and enabled users to drag items, other developers were inspired to develop websites with the same interactive look and feel of a desktop app and brave souls came forward with libraries (toolkits) to simplify use of JavaScript.
LoadRunner's HTML protocol (functions web_form_submit and web_form_data) are based on a sychronous exchange between client and server. LoadRunner waits for a response after each request is sent, and issued a time-out if one is not received.
The "A" in AJAX stands for Asychronous", which means that LoadRunner should not wait for a response from one request before moving on.
The one command LoadRunner that seems to behave in this way works on requests for resources of a single HTML request, not on multiple requests. Its use with AJAX resulted in errors.
So LoadRunner scripters were forced to spend many hours essentially using synchronous tools to solve asynchronous problems -- meticulously analyzing requests and responses to figure out how to duplicate what went on inside the browser. Such an approach requires a level of experience with web development that most LoadRunner scripters lack.
Acknowledgement of how inefficient these efforts were came when this whitepaper claimed "reduces scripting time up to 80 percent" are achieved by using the entirely new set of "Click and Script" functions HP invented to work with AJAX.
Scripting AJAX using LoadRunner is still not as easy as HP salesmen may make it out to be.
Alas, lack of documentation, training events, and buggy implementations resulted in LoadRunner users needing to fall back on time-consuming HTML recording for synchronous commands and forensic techniques.
Here are the annoyances with using LoadRunner on AJAX apps:
To make matters worse, as LoadRunner's support for AJAX frameworks failed to keep up with rapid changes (and new libraries popping up all the time), the belleaguered HP Support organization became defensive about defects. Rumors are that this is due to organizational turmoil and apparent infrequent communication with developers of LoadRunner in Isreal.
My observation is that technologies are progressing so quickly that it's difficult for traditionally organized organizations and programmers to keep up.
Most workers are not in a position to select what tool they get paid to use. We just have to make it work.
Even if you have the political power to make good on an emotionally satisfying statement like "to hell with LoadRunner, I'm going to use Selenium", (or other product), you may find that there can be as much difficulty creating scripts with other tools as with LoadRunner. Each tool has its own strengths and weaknesses. A tool that is quick to record scripts may require more manual effort during runs and analysis. What you may gain within another tool in one area (such as scripting) you may lose in ease-of-use in another area (such as metrics collection or analysis).
The complexity of AJAX requires HP engineers to develop a way to recognize tricky coding, which takes time. This means that LoadRunner users have to wait for the next release or beg HP Support for a patch.
I (Wilson Mar) also offer a service where I analyze your script during a WebEx session or on-site. Email me at WilsonMar at gmail.com or call 310.320-7878.
Testers dig into the system from the end-user back through the system API down into application code.
This is quite a different process than what developers usually look at (and relate to).
Developers struggle to understand the API so conjure up code which make the system behave the way they want.
On the other hand, LoadRunner C script creators struggle to understand the actual implementation so they can invoke behaviors making requests of the system under test.
For example, when ASP.NET AJAX developers make use of the ScriptManager component, LoadRunner scripters do not see "SciptManager" anywhere when looking at browser source code. But they know that its impact from the because (unlike standard web pages), JavaScript files are not explictly defined for retrieval in the HTML source sent to client browsers.
Performance testers do not need to duplicate every behavoir of the client application, only those behaviors that cause requests to be made of the server.
The "XML" refers to the XMLHttpRequest (XHR) method Javascript uses to make requests to the server behind the scenes rather than the GET and PUT methods which refreshes the entire page with every interaction with the server. JavaScript code then updates the HTML in the browser's DOM (Document Object Model) containing all elements of the browser session.
This means that tools are needed to expose what is happening inside the browser.
Many LoadRunner testers (to their detriment) see their role as scripting for simulation of load rather than also providing actionable feedback to developers.
This works to the detriment of both parties because it engenders an invisible wall between testers and developers.
Many developers, in order to save time (and code more productively) make use of API libraries so that they don't need to mess with how their coding is actually resolved into JavaScript on client machines, a process that can be quite convoluted.
But problems in recording scripts are usually reported from the point of view of the end-user, at the other end of the convolutions. This means that the developer then has to trace the complex sequence of events backward from how he or she usually needs to think in order to create source code.
For example, in the source code obtained from the browser, a text box can have a name of "ctl100_SampleContent_MessageTextBox", which would have no meaning to a developer if that name is auto-generated by the API and not the developer.
This is where performance testers can uniquely provide value.
If someone can communicate difficulties with how a page works not just from the end-user perspective, but also in language that developers can understand, then a valuable service is provided.
But this can happen only if that person takes the time to first dive deep into how JavaScript works internally, helped by learning some tools to analyze what is going on internally.
In organizations which accustomed to a wall, it may also involve a cultural shift.
To achieve this, performance testers first must be able to open both defects (reporting a violation of requirements), and enhancement requests such as "add a UpdateProgress control to keep users informed of remaining time to complete a long-running action".
Perhaps management will add tested performance test scripts to the list of work items which need to be produced before a module is considered "done".
HP has stated that they support these frameworks for AJAX functions:
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:
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???
10 Advantages to jQuery
jQuery Cheat Sheet
Rather than downloading Dojo, jQuery, Prototype, Script.aculo.us, or MooTools, have clients download from code.google.com/apis/ajaxlibs via a loader API so that users only download the library once to their client for all sites. This also enables Google to correctly set cache headers and staying up-to-date with the most recent bug fixes.
These are members of the Open AJAX Alliance which TIBCO implements with its publish/subscribe PageBus.
SlickSpeed compares the speed of Mootools vs. Dojo, Prototype, JQuery, and YUI.
In late 2008 Microsoft announced it would be integrating jQuery into Visual Studio, distributing jQuery version 1.3.2 with its ASP.NET MVC framework, a constituant part of ASP.NET 4.0 and Visual Studio 2010. Microsoft makes its AJAX library available on its CDN (Content Delivery Network) of servers around the world by using this code:
The "min" signifies the minified version (with white space removed).
Visual Studio 2008 Web Developer SP1 users can enable IntelliSense support for jQuery by downloading it and perhaps this hotfix to use a file name ending with -vsdoc to describe jQuery's functionality to Visual Studio.
Using jQuery in VS 2008 makes it easier to use JSON.
EXT 3.0 (announced August 2009) supports development of Google's Web Toolkit (GWT) (pronounced "gwit"), which turns Java code (written using Eclipse IDE) into JavaScript so that screen size and browser differences are automatically addressed.
Its community of developers make for innovations such as enabling data dragged from Excel into ExtJS Grid control on a website.
Not mentioned by HP are these other JavaScript libraries:
BackBase claims to be the "most widely used AJAX Framework with the richest library of AJAX components."
AJAX function | Emulates a user ... |
---|---|
web_browser | entering a URL Address. |
web_button | clicking on a button. |
web_check_box | selecting or clearing a check box. |
web_edit_field | entering input fields with text and password. |
web_element | clicking on an element defined with any HTML tag. |
web_file | entering a path for file input elements. |
web_image_link | clicking on an image that is a hypertext link. |
web_image_submit | clicking on an image that fires a submit request. |
web_list | selecting an item from a list control. |
web_map_area | activating an area within a client side map. |
web_radio_group | selecting one button from a radio button group. |
web_reg_dialog | registering user response for the subsequent call to a JavaScript function (modal dialog). |
web_static_image | clicking on a static image. |
web_table | acting on a table. |
web_text_area | entering text in an input text area. |
web_text_link | clicking on a hypertext link. |
This table provides links to compare LR and demos of jQuery widgets:
LoadRunner Function | Emulates ... | jQuery |
---|---|---|
ajax_accordion | a user extending or collapsing a menu. | native |
ajax_autocomplete | selection of an item from a list based on text entered in a field. | native |
ajax_collapsiblepanel | a user collapsing or expanding sections on a web page. | add-in |
ajax_rating | a user setting a value of a rating control. | add-in |
ajax_reorderlist | a user reordering elements in a list. | add-in |
ajax_slider | setting a value using a slider control. | native |
ajax_tabs | use of folder-style tabs in Atlas applications. | native |
Some now consider Microsoft's AJAX library as rather basic because it doesn't natively provide widgets which the jQuery UI 1.6 library provides:
This table also identifies where the jQuery depends on others' add-ins, plug-ins, and extensions to fill out its widget capabilities:
Also, the jQuery UI library provides these interactions (demo'd on one page) and listed here:
http://ecn.channel9.msdn.com/o9/mix/10/mp4/EX22.mp4 Video: Six Things Every jQuery Developer Must Know by Elijah Manor
http://ecn.channel9.msdn.com/o9/mix/10/mp4/EX36.mp4 EX36 How jQuery Makes Hard Things Simple John Resig http://ecn.channel9.msdn.com/o9/mix/10/mp4/FT50.mp4 http://ecn.channel9.msdn.com/o9/mix/10/pptx/FT50.pptx FT50 Advanced Web Debugging with Fiddler Eric Lawrence
LoadRunner has trouble recognizing JavaScript within .htc (HTML Component) files proprietary to Microsoft browsers used by Microsoft DataGrid controls. However, I have found a way to make LoadRunner work with it.
LoadRunner 9.51 does not process JavaScript DEFER tags the same way as browsers render them. I have attempted to file a defect on this with HP.
$(document).ready(function() { $("<p>dynamic text</p>").appendTo("body"); });
This jQuery code binds JavaScript to process a user button click:
<input id="cmdTest" type="button" ... $("#cmdTest").bind('click', hellojQuery());''
To resolve problems, I've found the need to analyze many files.
The above diagram illustrates the components that can be considered when recording AJAX web apps.
This tutorial makes heavy use of tools that analyzes each Asynchronous JSON request to and response from ASP.NET app servers and displays
Other add-ons appear in the Explorer Bars sub-menu.
Nikhil Kothari's Web Development Helper is unique in providing an ASP.NET-specific ViewState parser and Debug/Trace feedback. It also captures a page into a graphic file. In addition to being a JavaScript console (immediate window), DOM inspector, HTTP tracing tool, script profiler diagnostics,
However, because it is an IE6+ browser extension, it is session-based and oblivious to what VuGen does since VuGen emulates other browsers.
Alternately, the debugger also activates if the developer puts in the Javascript code the keywork debugger.
Due to the complexity of AJAX, I also recommend saving a graphic file (visual snapshot) for each before/after condition along with the HTML that created each.
After recording, additional script coding is usually needed to be added to reveal internal conditions.
I usually get rid of the Tasks pane and click the Script icon.
There is an earlier version on .NET Framework 2.0 developed using Visual Studio 2005.
After your run, turn it back on again:
The expected response from the computer is:
Before performing each activity on the page being recorded, I add a comment so I can remember the text I clicked on and why I did it.
Copy and paste the text from your list of actions planned. If you didn't plan, open a Notepad and add to the list as your record.
At the time I accessed the example site, there were 32 items on the left panel of controls, starting from "Accordion".
The people who created this page were nice enough to be consistent about every control, so I can code just one function to invoke each of them each from a list. This means I could verify whether the correct page was retrieved by looking for the control's name before the word " Demonstration".
The function I code for each control then would contain code only applicable to that control.
Notice that JavaScript files downloaded to a client from an ASP.NET AJAX web app are not specified in a <script src ... HTML tags. This is because the AJAX ScriptManager manages downloading of its Scripts collection.
The ScriptManager names have a strange set of unique characters.
Previously to AJAX, it was assumed that each web page receives a response before going to the next step.
But AJAX code can fire and move on. To accomodate Asynchronous AJAX, a LoadRunner service function can be addeded manually to the script.
web_reg_cross_step_download("URL/RE=start_a\.htm$",LAST);
The \. and dollar sign ($) are regular expression markers.
To obtain a value and display it by issuin a pop-up alert, remember to escape quotes around values:
web_browser("keyId_Get", ACTION, "EvalJavaScript=document.getElementById(\"keyId\");", "EvalJavaScriptResultParam=rKeyId", LAST); web_browser("Send_Alert", ACTION, "EvalJavaScript=alert(\"rKeyId=\"+\" {rKeyId}\");", LAST);
The double underlines in the JavaScript function __doPostBack(eventTarget, eventArgument) invoked to trigger postback indicate that it belongs to (generated by) the underlying ASP.NET engine and not custom application code. It has two parameters: __EVENTTARGET containing the control name and __EVENTARGUMENT stored in hidden form INPUT fields.
"EvalJavaScript=alert(\"EVENTTARGET=\"+Request.Params.Get(\"__EVENTTARGET\"));",
To change a value within the JavaScript DOM, use the .Value method:
web_browser("keyId_Set", ACTION, "EvalJavaScript=document.getElementById(\"keyid\").Value=\"123ABC\"";", LAST);
To use JavaScript to submit against <form id="myform" action="...
web_browser("keyId_Set", ACTION, "EvalJavaScript=document.myform.submit();", LAST);
By default, LoadRunner generates onFocus statements.
They are not neededd (and can be deleted) unless there is an onFocus event specified in javascript.
So disable it in Options > Recording > Custom.
With AJAX, user actions are emulated using the new web_reg_dialog LoadRunner service function which references code in an action automatically created by LoadRunner during recording.
web_reg_dialog( DESCRIPTION, "Type=Confirm", "Message=Click OK to continue", ACTION, "Click=OK" , LAST);To enter text in a pop-up edit box after the next AJAX command is invoked:
web_reg_dialog( DESCRIPTION, "Type=Prompt", "Message=Where is Walt Whitman buried?", ACTION, "SetText=Camden, N.J." , LAST);To close a modal dialog window:
self.close(); or window.close();
There are two values that LoadRunner needs: the ID of the element and the value.
Fortunately, when the wrong value is provided to a function, VuGen displays a list of possible valid values.
Some web pages block all keys and programmatically recognize only specific keycodes. This is done to disable right-clicking by website users.
To obtain the value for the ID of a form INPUT field:
web_edit_field("1_1", "Snapshot=t21115.inf", DESCRIPTION, "Type=password", "name=PinCode", "WindowType=Modal", ACTION, "EvalJavaScript=document.getElementById(\"ct100_CardNum\").value=\"1\"", LAST);
Try this equivalent EvalJavaScript:
"EvalJavaScript=$get(\"ct100_CardNum\").value=\"1\"",
If you find that LoadRunner parameters in EvalJavaScript values are not being recognized, use sprintf to define a C string and expand the LoadRunner parameter into that. then use the resulting string in place of the EvalJavaScript attribute.
Try this equivalent EvalJavaScript:
sprintf(buffer1,"EvalJavaScript=%s",lr_eval_string("{myvar1}"));
"JavaScript Failed to compile" errors may be caused by the JavaScript engine not having time to update. Try adding before the request:
sleep(1000);
"Failed to execute JavaScript code" may be avoided by invoking the submit directly:
"EvalJavaScript=this.Form1.Submit();",
In the past, to obtain information not displayed during AJAX protocol recording, I performed a recording in HTML protocol.
However, I prefer to use developer tools instead.
In looking at output from the Log Viewer, I can make a
web_browser("Please enter the initial URL here", DESCRIPTION, ACTION, "Navigate=Please enter the initial URL here", LAST);
web_reg_find("Text=Untitled",
LAST);
To avoid a playback error, comment it out (with //).
Unlike static HTML web pages, one cannot "View Source" at the client browser to look for text to correlate. With AJAX sites, one must look at the dynamic exchange of data VuGen captures in its Generation Log and in VuGen's new Tree view.
VuGen captures the traffic between client and server much like HTTP Proxy client utilities such as Fiddler.
In the Generation Log, the first GET request is for the URL specified to obtain the response.
"HTTP/1.1 200 OK" is the normal expected valid response, as agreed in the HTTP 1.1 spec.
In the Response Header, notice the
Set-Cookie: JSESSIONID=89B629853850438A28F07F366FD57F4A; Path=/a4j-simpleRepeator
<HTML>
<HEAD>
</HTML>
<TITLE>ajax4jsf. Simple Repeator Demo</TITLE>
</HEAD>
<script type="text/javascript" src="/a4j-simpleRepeator/org.ajax4jsf.resource/org.ajax4jsf.framework.ajax.AjaxScript">
<BODY>
<form id="_id0" method="post" action="/a4j-simpleRepeator/demo.jsf" enctype="application/x-www-form-urlencoded">
</BODY>
<table><tbody>
</form>
<tr>
</tbody></table>
<td> Type the Text:</td><td><input type="text" name="_id0:_id3" value="" onkeyup="A4J.AJAX.Submit('_viewRoot','/a4j-simpleRepeator/demo.jsf',this,{'parameters':{'_id0:_id4':'_id0:_id4'}})" size="50"></td>
</tr><tr>
<td>Text in the AJAX Response:</td>
</tr>
<td><span id="_id0:repeater"></span></td>
<input type="hidden" name="_id0" value="_id0">
The remaining HTML is not shown here.
If the script was recorded with "Recording Options" set to "HTML", then the script would not have a separate request for the AjaxScript because the "mode=HTML" in the VuGen script tells LoadRunner to automatically retrieve resources (such as script, css, img, and other files) mentioned in the HTML.
The "jsessionid=" appended to the end of the URL to retrieve the AjaxScript means that the file will be downloaded again at the start of every session, which developers want if the file changes dynamically.
If the script file is not expected to change, users would not need to wait for the file to be downloaded if there was not a "jsessionid=" in the URL, since the browser will automatically reuse what remains in the cache. That is unless the browser has been set by the user to "refresh with every page" or the expiration date on the file has passed.
When normally static file changes, developers rename the file name to ensure that all active clients get the new file rather than reusing the old file in their cache.
The AjaxScript file can be examined at the location where browsers download resources (cookies, CSS files, etc.). On IE browsers, pull down "Tools", "Internet Options", click "Settings" within the "Temporary Internet files" section, then "View Files...". This opens up a Windows Explorer. Scroll right or expand the width of the window to click "Last Accessed" once or twice to sort the list.
Save the file by right clicking on it, select "Copy", then paste it into another Windows Explorer window.
At that new location, right click on it, select "Properties" to note its size (e.g., 50,798 bytes).
For faster download, "production" websites would have the content of static compressed (stripped of whitespace such as blank spaces and tabs).
If that is the case, for human readability we would need to
reverse the compression by saving the code in a file and sending it through a code formatter utility to indent the statements.
The SlickEdit editor can reformat code.
BTW, at the top of the file, notice the comment "Sarissa
is an ECMAScript library acting as a cross-browser wrapper for native XML APIs."
Scroll down to see that this particular library uses logging functions extensively.
Notice that "RecContentType=text/javascript" appears even when the file name is suffixed with ".AjaxScript" rather than ".js". "AjaxScript" is really JavaScript.
Other websites code the onKeyPress= event instead because it represents the entire keystroke and can be canceled.
The event specified to fire is the A4J.AJAX.Submit function defined in a JavaScript/AjaxScript library on the client. Other libraries may use another function name.
Unlike other attributes, "onkeyup=" does not require the user to click on another area of the screen before it gets to work.
Search for this in the ActionScript file. We see that it accepts 3 parameters (separated by commas within the parentheses):
A4J.AJAX.Submit = function( containerId, form, obj , options ) {
This function in turn calls A4J.AJAX.SubmitRequest (which has the same parameters)
at last invokes form.onsubmit that sends a request out to the server
"/a4j-simpleRepeator/demo.jsf",
Java Server Faces file. specified "<form action=" HTML.
The request body shown in the Generation Log, such as:
are formatted in the "Add Event" script presented under "ITEMDATA" in VuGen scripts, presented in this table with a correspondence to the source of parameters in HTML code through AjaxScript functions:
HTML | onkeyup= A4J.AJAX.Submit parameter | parameter in Javascript function | VuGen script generated within web_submit_data |
---|---|---|---|
<form action=... | '/a4j-simpleRepeator/demo.jsf' | form | "Action=http://livedemo.exadel.com/a4j-simpleRepeator/demo.jsf;jsessionid={JSESSIONID2}", |
- | '_viewRoot' | containerId | "Name=AJAXREQUEST", "Value=_viewRoot", |
<input type="text" name="_id0:_id3" | this | obj | "Name=_id0:_id3", "Value=x", |
- | {'parameters':{'_id0:_id4':'_id0:_id4'}} | options | "Name=_id0:_id4", "Value=_id0:_id4", |
<input type="hidden" name="_id0" value="_id0"> | - | - | "Name=_id0", "Value=_id0", |
<form ... enctype="application/x-www-form-urlencoded" | - | - | "RecContentType=text/xml" |
Within Javascript, "this" refers to the text object itself, which in the example contains a text value "x".
The enctype="application/x-www-form-urlencoded" in the HTML form requests the browser to send (asynchronously) what the HTTP spec calls an XMLHttpRequest by specifying Content-Type: application/x-www-form-urlencoded;charset=UTF-8 in the Request Header.
"RecContentType=text/xml" appears with the web_submit_data instead of
"RecContentType=text/html" for regular HTML requests.
Internally, this results in VuGen sending out a "HTTPXMLrequest".
The second and subsequent Response Header do not contain a "Cookie: JSESSIONID=" that browers and LoadRunner automatically resend back to the server to help maintain the same session.
Note that the response body begins with <?xml version="1.0" encoding="iso-8859-1"?>, which IE does not display.
During playback, the Run-Time Viewer would display an error for pages beginning with this
(if in "Tools", "General Options", "Display" tab, "Show browser during replay" is checked).
A JavaScript listener function in the AjaxScript reads the rest of the response body. For example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><title>ajax4jsf. Simple Repeator Demo</title> </head> <body><hr /> <span id="_id0:repeater">x</span> <span id="ajax-update-ids" style="display: none" title="_id0:repeater"> <input type="hidden" name="jsf_sequence" value="1" /> </span> <div style="font-size:9px;height:150px;width:800px; border: 1px solid darkblue;padding: 5px 5px 5px 5px; overflow: auto;" id="logConsole"> </div> </body></html>
Notice that this response does not contain some of the HTML of the first Response Body (why AJAX is preferred over traditional whole-page exchangees).
<span id="ajax-update-ids" style="display: none" title="_id0:repeater">
id="ajax-update-ids" triggers an update of the innerHTML text in the object named in title="_id0:repeater", which is defined in the first HTML above by <span id="_id0:repeater">.
An AjaxScript "callback" function update displays the text "x" between <span id="_id0:repeater"> and </span>.
So to verify the response, add to the VuGenscript a LoadRunner web_reg_save_param() call to capture the text between those two markers.
web_reg_save_param("pRetText","Search=Body", "ORD=ALL", "LB=<span id=\"_id0:repeater\">", "RB=</span>", "Notfound=warning", LAST);
Note that back slashes are added to quote characters being searched.
Add logic to perform the VuGen script command to capture the JSESSIONID value AGAIN if cookies are cleared or if the application user logs off.
Add logic to NOT perform the VuGen script command to capture the JSESSIONID value during the same continuous session.
This can be done by declaring an integer (binary) flag in the vuser_init section:
int intHaveJSessionID = 0; // 0 = NO.
The Action section would have:
if( intHaveJSessionID == 0 ){ web_reg_save_param("JSESSIONID2", "LB/IC=jsessionid=", "RB/IC=\"", "Ord=1", "Search=header", "RelFrameId=1", LAST); intHaveJSessionID = 1; // 1 = YES } ... web_cleanup_cookies(); intHaveJSessionID = 0;
Simply adding "Notfound=warning", to the generated web_reg_save_param command does not work because that would cause the JESSIONID2 parameter to be unusable when the value is not there to find.
Because the Response Header is usually smaller than the Response Body, you can save a little script execution time by changing
"Search=body" to
"Search=header"
Instead of a traditional web_submit_data command, VuGen may records this out-going XML requests as web_custom_request() commands containing a Body such as:
"Body=AJAXREQUEST=_viewRoot&_id1%3AtextArea=This%20text%20area%20should%20not%20be%20updated&_id1%3A_id18=any&_id1%3A_id21=yellow&_id1%3A_id24=any&_id1=_id1&_id1%3A_id22=_id1%3A_id22&",
Other examples from Exadel, the sponsor of AJAX4JSP, require hidden type fields such as com.sun.faces.VIEW to be captured within VuGen scripts.
The Get Author webapp described here
Requested by/as | File Downloadload | Bytes | Notes |
---|---|---|---|
user | solution.html | 2,067 | |
- | .../fonts.css | 634 | |
.../reset.css | 441 | ||
.../yahoo.js | 4,548 | global object used by YUI Library. | |
.../event.js | 60,717 | ||
.../dom.js | 34,659 | ||
.../calendar.js | 132,161 | ||
.../calendar.css | 1,928 | ||
EXTRARES | ...bc_1.7.3.js | 3,211 | |
EXTRARES calendar.css | ...callt.gif | 94 | |
...calrt.gif | 94 | ||
Total: | ?.? |
YAHOO.namespace("example.calendar"); invokes a function in the yahoo.js library which invokes the function YAHOO.widget.Calendar.
function init()" in the calendar.js library knows to replace
<div id="cal1Container"></div> with HTML code that it generates based on the current date.
Such generated HTML can only be seen if "Full Source" or a special Microsoft DLL is installed.
In that generated HTML, each clickable field is defined with a class and an id that are also generated internally by JavaScript.
YAHOO.util.Event.addListener(window, "load", init); establishes a listener for responses from the server.
The following response from the server is a JSON (JavaScript Object Notation) data payload format. Its use of braces and indentation instead of tags in XML makes it more "lightweight" and easier to read.
{"addressbook": {"name": "Mary Lebow", "address": { "street": "5 Main Street" "city": "San Diego, CA", "zip": 91912, }, "phoneNumbers": [ "619 332-3452", "664 223-4667" ] } }
Within browser Javascirpt, this is read by code such as:
var myObj = eval( '(' + JSON_response + ')' );
JSON is also favored because its use of server callback functions gets around browsers preventing files being loaded across domains
Json.org lists links, such as
BEA's Intro to JSON
Resources:
Related Topics:
Performance Testing
NT Perfmon / UNIX rstatd Counters
Mercury LoadRunner
Mercury Virtual Table Server (VTS)
Mercury WinRunner
Rational Robot
Free Training!
Tech Support
| Your first name: Your family name: Your location (city, country): Your Email address: |
Top of Page
Thank you! |