Your e-Business Quality Partner eValid™ -- Automated Web Quality Solution
Browser-Based, Client-Side, Functional Testing & Validation,
Load & Performance Tuning, Page Timing, Website Analysis,
and Rich Internet Application Monitoring.

eValid -- JavaScript Interface Commands
eValid Home

This page describes commands relating to JavaScript interaction within eValid.

These commands provide a way for an eValid playback script to cause a JavaScript function to be invoked, and a way from within JavaScript to call a function that causes a specific eValid command to be executed.

In effect this structure is a two-way interconnection between eValid playback scripts and JavaScript activities. Both types of interaction occur only during eValid playback. When the eValid browser is not in playback mode the internally generated JavaScript commands have no effect but do not produce any errors.

Some simple examples are given below. Here is a completely described clickElement.js Example that illustrates how the JavaScript interface can be used in a complex application playback.

Available Commands

JavaScript Interface Commands
PROF CallJavaScript wid "function([argument [, argument]])" "Frame Path" Edit When encountered, eValid calls the named JavaScript function with the specified JavaScript arguments. The function is assumed to exist and if it does not exist no error message is sent.

The function name and arguments are written in the eValid script as character strings.

If there are errors in the function name or parameters the eValid browser will throw a JavaScript error flag. If such flags are suppressed then an erroneous function name or parameter will effectively be ignored.
N/A external.eValidRunCommand(command [, "arguments"] ...)   This new member function is now available to be invoked from a current page's JavaScript.

When executed by the JavaScript interpreter this function queues the specified eValid script command and its arguments (if any) to be played back after completion of playback of the current script command.

The command will use as a line number the line number of the immediately preceeding command completed and the Event Log will be updated as if the command had actually appeared in the script.

Note: This command only will have effect when it is executed if eValid is in playback mode, the only mode in which script commands are being executed.
N/A external.eValidInPlayback
  These two read-only data members also included are available to assist in determining from within a JavaScript passage the current state of the eValid browser.  

Additional Notes
There is no inherent synchronization between these commands other than what the user builds in. Also, there is no error processing. If an eValidRunCommand makes no sense then it may be ignored or it may cause an eValid playback Error flag to be set. If an external.eValidRunCommand has a syntax error this may be caught by the JavaScript interpretation engine.

It is important that arguments in JavaScript calls be enclosed in quotes because they are strings. Execution exceptions are likely if you don't include strings in quotes.

Practical Examples
Here are practical examples of use of the above commands.

  1. Typical eValid script command:
    Note "Hello world."

  2. Example JavaScript command (executed within eValid during playback mode operation):
    external.eValidRunCommand("Note", "Hello world.")

  3. An example eValid script command executed within an eValid playback script through use of the JavaScript engine:
    CallJavaScript "external.eValidRunCommand("Note", "Hello world.")"

  4. Example JavaScript command (executed within eValid during playback mode operation) and protected from non-playback mode execution with use of the external.eValidInPlayback variable:
    if(external.eValidInPlayback == 1)
    external.eValidRunCommand("Note", "Hello world.")