KITE script tips

KITE records many transaction scripts directly so that they can be used in testing without the need for additional work. Some scripts will require further work, however. This help topic explains some of the techniques that can be used to modify scripts for successful testing.

About script fields

  • Any field that is named "Index" is 0-based, and refers to the index among elements of the same type (or when used in a search, among the matching results).
  • Any field that is named "Label" usually refers to the display text of an element.
  • Any field that is named "Value" usually refers to the VALUE attribute of the element.
  • Windows are identified by a 0-based index. Frames are identified by a name and a 0-based index.

JavaScript elements

JavaScript can enhance the dynamics and interactive features of your page by allowing you to perform calculations, check input from forms, write interactive games, add special effects, customize graphics selections, create security passwords and more. Everything between the <script> and </script> tags on an HTML page is processed by the browser as executable JavaScript statements and data. Some HTML pages use a <noscript> tag as an alternative for browsers that do not support scripts.

When recording a transaction, any navigations invoked by JavaScript are automatically recorded as additional Navigate-type steps in the script.

HTML elements that are dynamically written to the page using JavaScript will not be processed by the agent. As a workaround, the resulting Link or Submit type step should be changed to a Navigate type step using the "Change to Navigate" option in the properties pane.

Note

In the case where there are HTML elements written client-side by JavaScript, the agent will not be able to find them, and you should change a Link or Submit to a Navigate. Aside from this case, you should keep the step as a Link or Submit when possible. The Link/Submit types are based on the document objects, as opposed to Navigate, which is URL-based. Therefore the Link/Submit step types can handle dynamic values better, and KITE will try to record a step as a Link/Submit whenever it can (but the Navigate data is saved as well).

Hidden elements

KITE records all hidden elements on the HTML page. Since this data is dynamic, you must edit each hidden field recorded. JavaScripted links and Submit actions that record as Navigate actions often have hidden elements. Hidden elements display in the Form Elements page of the Details pane (in the lower half of KITE); however, they are not identifiable there as hidden elements (they display in the same way that all of the form elements display). You can verify that an element is a hidden element by verifying the script, and then using the HTML tab of the details pane to save the HTML code to a text editor so you can search for the word hidden.

Use the Properties pane of KITE to edit your hidden script elements so the Keynote load agents will be able to play the script back consistently.

When the script is run, the Keynote load agents look for the Name of the edited hidden elements and use any Value for them that is written to the page.

Note

If a form submission is recorded as a Submit type step, the hidden fields are not captured as (and do not need to be) part of the script, because the agent will automatically extract their values when the script is played back. However, if the submission is recorded as a "Navigate" step, then the hidden fields used during the recording are captured as part of the script. Any hidden field that is dynamic should be parametrized by using the Value corresponding to name variable option in the "Value" field.

Form elements

Most e-businesses use HTML forms to gather user input. HTML forms are comprised of one or more INPUT elements such as INPUT text boxes, clickable radio buttons, multiple-choice check boxes, pull-down menus, and clickable images. For the various kinds of INPUT elements that your Web site may include, the KITE provides functions called variables for varying the input, which make your script more realistic. Other INPUT elements, such as the hidden INPUT element, need special handling by KITE so that the load agents are able to play back the script correctly. KITE provides function options for replacing recorded script elements that might not be playable otherwise.

The required ACTION attribute for an HTML form specifies the URL of the application that is to receive and process the form's data. The other required attribute specifies the METHOD by which the browser sends the form's data to the Web server for processing. There are two ways: the POST method and the GET method. The ACTION and METHOD attributes are both included within the initial FORM tag.

INPUT elements likely to be in your script are described in the table below. An example of HTML code for these kinds of elements is shown in Form Fields Example.

**HTML INPUT Element Types **

INPUT Type Description
check box Creates a multi-value input area in the form.
file Allows a file stored on the user's computer to be returned with the form.
hidden Allows embedded information into forms that can not be altered by the user. For example, session ids, which can be helpful to the Web server when sorting submitted forms. Sometimes nearly each INPUT tag in a form has a corresponding HIDDEN tag to give the Web server instructions on handling the user input. Since the purpose of this element is to report back to the Web server dynamic data, these elements must always be modified when included in your script. Instructions for doing this are given in Hidden Elements.
image button Allows use of an image file as a button.
password Causes the text input box to hide the value being entered.
radio button Allows only one value to be selected and returned with the form.
reset button Clears the form fields or resets them to their default values.
select Creates either a pull-down or scrollable list in the form.
submit button Sets in motion the form's submission to the Web server from the browser.
textarea Creates a multiline text-entry area in the form.

HTML examples

This section includes two examples of HTML code:

Form fields example

This example Web page illustrates the INPUT, METHOD, ACTION, and event handler tags previously described. The ACTION tag references a phony URL. You can copy this text (starting with <html> ), paste it into a Notepad document, save it as a html file, and open it in a browser. This is an example of a fairly simple HTML page with a form that has no elements needing extra steps in order for your script to be such that the load agents can play back consistently.

<html><head><title>Web Banking</title></head>
<body>
<h1>Web Banking</h1>
Welcome to our Web banking page! You can get balances, make transfers, and list the most recent transactions on your account.
<form METHOD="POST" ACTION="/ws/index.shtmll?324141515">
<pre>
Account Number:<input type="text" name="acct">
PIN:<input type="password" name="pin" size=8>
Transaction:<select name="transaction">
<option selected>Account balances
<option>Transfers
<option>Show recent transactions
<option>Stop payment on a check
</select>
<input type="radio" name="verify_by_mail" value="yes" checked> Mail me a written verification.
<input type="radio" name="verify_by_mail" value="no"> Do not mail me a written verification. 
Mail me some information on:
<input type="checkbox"name="info" value="cds"> Certificates of deposit.
<input type="checkbox"name="info" value="mortgages"> Home mortgage interest rates.
Tell us what you think about our Web services!
<textarea rows=5 cols=60 name="comments"></textarea>
<input type="submit"> <input type="reset">
<input type=button value="Press me"
onClick="alert('Goodbye world!');">
</pre>
</form>
</body></html>

Hidden elements example

Here is an example of the above HTML Web page that uses JavaScript event handlers to enhance the form. The SUBMIT button has been removed. It has been replaced with a button that checks for a non-blank account name and PIN number before submitting the form. HIDDEN fields have been added to give the form a session ID, and to tell the form processing page what to do when a successful transaction occurs and what to do when a failed transaction occurs. In such a case as this, you need to remove the dynamic part of the URL value in the ACTION attribute of the form (the GET or POST line).

See also Hidden Elements.

<html>
<head>
<title>Web Banking</title>
<script type="text/javascript">
function checkForm(input)
{if (input.form.acct.value == "" || input.form.pin.value == "") 
{ alert("Please enter an account number and PIN.")}
else 
{ input.form.submit()}}
</script>
</head>
<body>
<h1>Web Banking</h1>
Welcome to our Web banking page! You can get balances, make transfers, and list the most recent transactions on your account.
<form METHOD="POST" ACTION="/ws/index.shtmll?324141515">
<input type="hidden" name="failure" value="/ws/failed.shtmll?324141515">
<input type="hidden" name="success" value="/ws/success.shtmll?324141515">
<input type="hidden" name="sessid" value="4208401">
<pre>
Account Number:<input type="text" name="acct">
PIN:<input type="password" name="pin" size=8>
Transaction:<select name="transaction">
<option selected>Account balances
<option>Transfers
<option>Show recent transactions
<option>Stop payment on a check
</select>
<input type="radio" name="verify_by_mail" value="yes" checked> Mail me a written verification.
<input type="radio" name="verify_by_mail" value="no"> Do not mail me a written verification. 
Mail me some information on:
<input type="checkbox" name="info" value="cds"> Certificates of deposit.
<input type="checkbox" name="info" value="mortagages"> Home mortgage interest rates.
Tell us what you think about our Web services!
<textarea rows=5 cols=60 name="comments"></textarea>
<input type="reset">
<input type=button value="Press me to submit the form."
onClick="checkForm(this)">
</pre>
</form>
</body>
</html>

Rollovers

Rollover images (that highlight when your mouse is over them) are actually made up of a pair of images. When you move your mouse over a rollover image, KITE captures the second image of the pair (the highlighted one), but the actual link's destination is associated with the first image of the pair. Typically, these pairs of images have matched names such as something1.gif and something2.gif. When you verify those types of actions, the Edit Link box will display and suggest the image that has the actual link associated with it.

For example, you may roll your mouse over three roll-overs in a row, recording three Link actions, each with an image named something2.gif. As you verify, the Edit Link box will ask you to convert each something2.gif to a something1.gif. If you see this trend during verification, or if you know that your site uses roll-overs in a certain way, you can modify your script actions' Label in the details pane (even before verifying) to be the correct Label.