ApTest Manager documentation: API: VariableSet

VariableSet

NAME

VariableSet - class representing sets of session variables

AUTHOR

Steven J. McDowall <sjm@aptest.com>

COPYRIGHT

Copyright 2002-2006 Applied Testing and Technology, Inc. All Rights Reserved.

SYNOPSIS

use VariableSet;

# create a new VariableSet object
my $variables = new VariableSet;

# read the set from a file
$variables->fromFile( Config::SITE::VariableFile);

The VariableSet object is a handy container object used to track/read/manipulate a suite's variable definitions into a memory data structure.

FILE FORMAT

The format of a variable definition file is a whitespace separated collection of fields, one record per row, with the first row of the file being a definition of the field names. In this case, the fields in the file are:

NAME
the name of the variable
TYPE
the type of the variable: one of text, textbox, single, multiple, derived, or separator
FLAGS
a comma separated list of options for this variable. Flags vary by type, and are documented in the ApTest Manager User's Guide.
SIZE
the size of the input field when presenting to the user
PROMPT
the prompt to use when asking for a value from the user
VALUES
a comma separated list of potential values for this variable (if it is a single or multiple), and a default value to use for text or textbox. If it is a comma separated list, items starting with an asterisk are "defaults" for the item.

METHODS

new - create a new, unpopulated variable set object

$set = new VariableSet(fileName);

Creates a new VariableSet object, optionally reading in the base definition from a file.

returns a reference to the VariableSet object.

release - release the variable set

$set->release();

This method undefines the data structures associated with the variable set.

toFile - output the "compiled" variable set structure

$set->toFile( filename ) ;

print - print the contents of the variable set

$set->print();

fromFile - read in the variable definitions from a file..

$set->fromFile(fileName);

loadAccountDefaults - reads in, evals, and sets default values from a file.

$set->loadAccountDefaults( vendor ) ;

addHeader - adds a new header entry into the set and marks it as the current header for future variable adds.

$set->addHeader() ;

getVarByName - find and return a Variable object given its id

$set->getVarByName( id ) ;

suiteDir - accessor for test suite root

$set->suiteDir();
$set->suiteDir(suite);

Gets/sets the path to the test suite data root.

visibleList - return a list of visible fields

@vlist = $vars->visibleList( includeSpecials ) ;

includeSpecials is a boolean that defaults to false. If true, then the reserved atm special session variables are also included.

Copyright © 2000-2006 Applied Testing and Technology, Inc. All rights reserved.