[Vermont Creative Software (VTSOFT)]
 

Home | About Us | Products | Sales | Demos | Links | Support | Contact Us

 
           
 
 

PRODUCTS

[Vermont HighTest]Vermont Hightest
[Vermont HighTest New Enhancements]New Enhancements
[Vermont HighTest Tour]Tour
[Vermont Test]Vermont Test
[Vermont Test/Terminal]Test/Terminal
[Vermont Views]Vermont Views
[Vermont Views — UNIX]UNIX
[Vermont Views — DOS]DOS
[VSP Support]VSP Support
[Year 2000]Year 2000

[Subscribe to our Mailing List]

Vermont HighTest Plus TourVermont HighTest Plus Tour:
Previous Page 1 2 3 4 5 6 7 8 9 10 Next Page

 

Page 8 — Scripting Language

The Vermont HighTest scripting language has all of the elements that you would expect in any language. They are designed to be flexible, but easy to use as there are only those things that are needed to support testing in the language and none of the additional overhead associated with most other languages. Here is a summary of the things you will find:

Variables
Statements
Functions
Commands

Variables

Variables greatly increase the flexibility of the script, allowing you to extract data from controls or windows so you can analyze the values, to make your script data-driven so you can have one script that can run with different sets of data from an external file. Variables also may be defined as local to the current script file, or may be defined as global and can be used by any script that is called while the parent script is still active.

Datatypes supported are:

  • INTEGER. An integer is defined as any whole number value, either positive or negative, in the range -32768 to +32767. For example, -123 is an integer.
  • LONG. A long is defined as any whole number value, either positive or negative, in the range of -2147483648 to +2147483647. For example, 135,398 is a long.
  • FLOAT. A float is defined as any number that allows a decimal point as part of its value. A float must be in the range 3.4x10-38 to 3.4x10+38 and can be either positive or negative. For example, 14.01 is a float.
  • DOUBLE. A double is defined as any number that allows a decimal point as part of its value. A double must be in the range -10307 to +10307. For example, 157.4863 is a double.
  • STRING. A string is defined as any sequence of ASCII characters. Literal string values are represented as the sequence of ASCII characters delimited by double quotes. For example, "filename.txt" is a string. A string can be up to 254 characters in length. If a string variable is passed as a parameter to a HighTest function that is expecting a file and path name, then the first 254 characters are recognized.

HighTest supports automatic type conversion for all supported variables. This allows you to store an integer in a float variable, or convert a double to a string via the Set statement. Variables can be used as a parameter in any script command where a literal value can be used.

Statements:

  • Comments. May be placed on any line at any location. All text to the right is treated as a comment and is ignored.
  • Conditionals. If/Then/Else conditional logic allows you to control program flow.
  • Loops. For/Next statements allow you to execute a series of script commands multiple times, such as when your script is data-driven.
  • Assignment. The Set statement allows you to assign a value to a variable. Automatic type conversion is supported. ‘+’ is the only supported operator.
  • Goto. Goes to label in the script.

The following Operators are supported in HighTest:

'>' greater than
'>' greater than
'<' less than
'>=' greater than or equal to
'<=' less than or equal to
'>=' not equal to
'=' equal to
'+' add or concatenate, depending on the operand types
'-' subtract
'*' multiply
'/' divide

Functions

HighTest supports the creation of functions that you can call at any time. The use of functions is recommended for times when you have a block of commands that you want to use multiple times. Putting them into a function reduces the number of lines in your script and reduces the amount of effort to maintain the script as your application changes over time. Functions are accessed via the Call() statement and can be in the same script module or in a separate module.
Functions can also include parameters and support passing both into and out of them, making them very flexible and easy to use. When defined with parameters, these functions become part of the scripting language and are called directly within your script. You do not need to use the Call( ) command to use them.

Commands

The commands in the HighTest scripting language provide a wealth of capability in a relatively small number of commands. They range from the straightforward like Delay() to more powerful such as WaitImage() to the extremely powerful such as GetInfo(). Note that the web specific commands that deal with web objects include “Web” in their names to differentiate them from their Windows controls siblings.

ActivateWindow( ) Activates the specified window
ClickButton( ) Clicks a button
ClickComboBox( ) Opens a ComboBox and/or selects an item from the drop-down ListBox
ClickEdit( ) Positions the cursor in an edit control and optionally select some text within it
ClickHeader( ) Performs a click on a Header control
ClickListBox( ) Selects an item in a ListBox control
ClickListView( ) Clicks on an item in a ListView control
ClickMenu( ) Selects a menu option
ClickScrollHorz( ) Performs actions on a horizontal Scrollbar
ClickScrollVert( ) Performs actions on a vertical Scrollbar
ClickSlider( ) Clicks on a Slider control
ClickSpin( ) Clicks on the up or down arrows in an Up/Down control
ClickTab( ) Clicks on a tab in a Tab control
ClickToolBar( ) Selects an item in a Toolbar
ClickTreeView( ) Performs actions in a TreeView control
ClickWebButton( ) Click on various button types including Button, Radio, Checkbox, Submit, and Reset.
ClickWebComboBox( ) Click on a combobox and select a single item.
ClickWebEdit( ) Click on an edit box, optionally selecting some text.
ClickWebImage( ) Click on a graphic image that links to another page, or location within the page.
ClickWebLink( ) Click a hyperlink on the page. This will cause a jump to a new location.
ClickWebListBox( ) Click on a listbox and select a single item. If multiple items are being selected, one command for each will be generated.
ClickWebUploadFile( ) Click on an upload file edit box or browse button.
CloseWindow( ) Performs the equivalent of clicking on the X close button
CompareFile( ) Compares two files with optional masking
CompareScreen( ) Compares a reference image with an image of a specified portion of the screen
CompareTextFile( ) Perform a text comparison of two files
CompareWindowInfo( ) Compares reference data with the internal details of a specified window
CompareWindowText( ) Compares the title of a window against a specified value
CopyFile( ) Copies a file from one location to another
DateDiff ( ) Calculate the difference between two times in seconds
DateGet( ) Get the date and time in the user specified format and/or as seconds
Delay( ) Wait for a specified period of time
DeleteFile( ) Deletes a file
FileExists( ) Checks for the existence of a file
GetClipboard( ) Get text from the clipboard
GetCurrentDirectory( ) Gets the current working directory
GetEnvVar( ) Get the value of an environment variable
GetInfo( ) Gets internal details from a window or control
GetOS( ) Get information about the version of Windows
GetScriptDirectory( ) Get the directory of the current script
GetScriptName( ) Get the name of the current script
GetUserName( ) Get the name of the current user
GotoURL( ) Navigate to the specified page.
IsFloat( ) Checks a variable value to see if it is a floating point number
IsInteger( ) Checks a variable value to see if it is an integer number
KeyMod( ) Presses one or more of the modifier keys (shift, alt or control)
Keys( ) Sends the specified keys to the focus window with variable delays
LogComment( ) Writes a comment to the log file
MakeDir( ) Creates a directory
MouseClick( ) Clicks the mouse at a specified location
MouseDoubleClick( ) Double-clicks the mouse at a specified location
MouseMove( ) Moves the mouse to the specified location
MousePress( ) Presses a mouse button at the specified location
MouseRelease( ) Releases a mouse button at the specified location
MouseWheel( ) Performs the equivalent of rotating the mouse wheel
Pause( ) Suspends playback and restores HighTest to the screen
PutClipboard( ) Write text to the clipboard
ReadFile( ) Reads data from an ini-style file
ReadRecord( ) Reads data from a file. Can read multiple values into variables
RemoveDir( ) Deletes a directory and its contents
RenameFile( ) Rename a file with optional overwrite
SetDir( ) Sets the current directory
SetIgnore( ) Dynamically allows HighTest to ignore certain script parameters
SetLog( ) Turns logging on or off for the specified command
SetLogDirectory( ) Sets the directory that the log file is written to
SetModifier( ) Set modifier keys to on or off states
SetScale( ) Sets the scaling factor used to account for changes in screen resolution
SetSpeed( ) Sets the speed of playback
SetTerminate( ) Sets Terminate on Failure on or off for the specified command
StartApp( ) Starts up an application
StopWatch( ) Allows you to track the time between predefined intervals
StrLen( ) Get the length of the string
StrLeft( ) Convert string to all lowercase
StrLTrim( ) Remove leading whitespace characters
StrMid( ) Get text from the middle of the string
StrRight( ) Get text from the end of the string
StrRTrim( ) Remove trailing whitespace characters
StrRight( ) Get text from the end of the string
StrUpper( ) Convert string to all uppercase
SubString( ) Extracts a portion of a string
TimeStamp( ) Writes the current date and time to the log file
UserMessage( ) Displays a message to the user and waits for a response with an optional timeout
WaitFileExists( ) Waits until the specified file exists
WaitImage( ) Waits until the stored image of a portion of the screen matches or doesn’t match the same region of the screen
WaitInfo( ) Waits until an internal detail of a window or control matches the specified value
WaitPageDone( ) Wait until the specified page is done loading. This enables HighTest to stay synchronized with the browser.
WaitTime( ) Waits until a specified time in 24-hour format
WaitWindow( ) Waits until the specified window is found
WriteFile( ) Writes a string of text to a file

Tour: Previous Page 1 2 3 4 5 6 7 8 9 10 Next Page