Tutorial Icon
QF-Test Tutorial version vidéo

Tutoriel en version vidéo: Nous vous guidons pas à pas à travers QF-Test...

Selected Packages and Procedures

We will now have a closer look at a number of selected packages and procedures from the standard library.

The Run log Package

The qfs.run-log package contains procedures, which writes specified messages into the run log. This package has been introduced to give testers without scripting-knowledge the opportunity to write messages into the run log.

Here is the list of the most important procedures within this package:

  • logError Write a given error message into the run log.
  • logWarning Write a given warning message into the run log.
  • logMessage Write a given message into the run log.

The Run log.Screenshots Package

The qfs.run-log.screenshots package contains procedures, which write images into the run log and some helper methods.

Some important procedures within this package are:

  • getMonitorCount Return the total number of monitors.
  • logScreenshot Write a screenshot of the whole screen into the run log.
  • logImageOfComponent Write an image of a given component into the run log.
  • logScreenshotOfMonitor Write a screenshot of a given monitor into the run log.

The Shellutils Package

The qfs.shellutils package contains procedures to support most common shell-commands.

Some important procedures within this package are:

  • copy Copy a given file or directory to a specified target.
  • deleteFile Delete a given file.
  • exists Check for existence of a given file or directory.
  • getBasename Return only the file name of a full file name.
  • getParentdirectory Return only the directory name of the full file name.
  • mkdir Create a given directory. It also creates non-existing directories in path.
  • move Move a file of directory.
  • touch Create a specified file.
  • removeDirectory Remove a specified directory.

The Utils Package

The qfs.utils package contains procedures, which covers common helper-functionality during test-development.

Some important procedures within this package are:

  • getDate Return a string containing the date. Default is the current date. (Other dates can be configured.)
  • getTime Return a string containing the time. Default is the current time. (Other timestamps can be configured.)
  • logMemory Log current memory use.
  • printVariable Print the content of a given variable to the console.
  • printMessage Print a given message to the console.
  • writeMessageIntoFile Write a given string into a given file.

The Database Package

The qfs.database package contains procedures to execute SQL commands on a database.

Please note that the database driver must be in the class path, i.e. the respective jar file in the qftest plugin directory, before launching QF-Test.

To get more information about the connection-mechanism to your database, please ask your developers or see www.connectionstrings.com.

Some important procedures within this package are:

  • executeSelectStatement Execute a given SQL-Select-Statement. It stores the result in a global variable "resultRows" on the Jython variable stack and thus accessible from Jython scripts. Additionally, it stores the result in a group variable with the default name 'resultGroup', which can be accessed directy by QF-Test nodes.
  • executeStatement Execute a given SQL-command. Here any SQL command can be specified.

The Check Package

The qfs.check package contains procedures to do checks.

Some important procedures within this package are:

  • checkEnabledStatus Check, whether a component is enabled or disabled. It writes an error into the run log, if failing.
  • checkSelectedStatus Check, whether a component is selected or not. It writes an error into the run log, if failing.
  • checkText Check the text of a component. It writes an error into the run log, if failing.

The Databinder Package

The qfs.databinder package contains procedures for execution within a "Data driver" node which bind data for iteration.

Some important procedures within this package are:

  • bindList Create and register a databinder that binds a list of values to a variable. Variables are separated by whitespace or by a given separator character.
  • bindSets Create and register a databinder that binds a list of value-sets to a set of variables. Value-sets are separated by line breaks. Variables within a value-set are separated by whitespace or by a given separator character.