SCRIPT

Specifies javascript code, which will be executed in the context of the current page.

The script can set or print javascript values. It can also call any javascript function or method, including html objects such as the window and document.

The frame and window attributes allow the script to be executed in the context of the named frame and-or window

The following sets a variable and then prints it using document.writeln() and also by using the output element <output/>

               <script>myvar=10;</script>
               <script>document.writeln(myvar);</script>
               <output value="#{myvar} #{document.title}"/>
Note that there are two ways of invoking javascript - through the script element, or through any variable expansion e.g. in output. eval or set elements.
Variable expansions (using #{var} syntax ) first checks for global variables, and then javascipt variables on the current HTML page.

JavaScript support is based on that provided by HttpUnit. The following is copied from the HttpUnit documentation.

The near-term goal is full JavaScript 1.1 support. Currently, we do not plan to support browser-specific JavaScript. Inline and included scripts are supported, as are the following DOM elements:

Window

properties

events

methods

Navigator

properties

methods

Screen (1.2 feature)

properties

methods

Location

properties

methods

Document

properties

methods

Form

properties

events

methods

Image

properties

Link

properties

events

Input (and subclasses)

properties

methods

Button

events

Text

properties

events

TextArea

properties

events

Hidden

properties

Password

properties

events

Checkbox

properties

events

Radio

properties

events

Select

properties

events

Option

constructor

You may construct an Option object and assign it to an element in the Select.options array

properties


1. Allowed Content

#PCDATA

2. Attributes

AttributeValue(s) Default Value
framename CDATA #IMPLIED
windowname CDATA #IMPLIED

3. Content Rule

( #PCDATA )

4. Parent Elements

steps   -- This element contains all the test steps.
suite   -- Define a set of steps which can be "called" from a run element.
with   -- Group together a set of steps that use the same page definition.

Top Elements || All Elements || Tree


test DTD