31
Exceptions

There are quite a lot of exceptions that can be thrown during the execution of a test. This chapter lists the exceptions in hierarchical order, shows the typical error messages and gives a short explanation.

If you want to work with those exceptions in scripts, please take a look into section 37.9.

TestException

This is the base class of all exceptions that can be thrown during a test run. The actual exception thrown should almost always be of a derived class. A 'Catch' with the 'Exception class' set to TestException will catch all possible exceptions. Just like in Java you should normally not use such a 'Catch' since it may hide unexpected Exceptions.

ComponentNotFoundException

This exception is thrown whenever the target component for an event or a check cannot be determined. Failure of a 'Wait for component to appear' will also cause a ComponentNotFoundException unless the node's 'Wait for absence' attribute is set.

Base class: TestException

Message: The target component could not be determined.

DocumentNotLoadedException

This exception is a variant of ComponentNotFoundException and thrown specifically if a 'Wait for document to load' node fails.

Base class: ComponentNotFoundException

Message: The target document was not loaded (anew).

ComponentFoundException

This is the opposite of a ComponentNotFoundException, thrown by a 'Wait for component to appear' with the 'Wait for absence' attribute set.

Base class: TestException

Message: The target component does exist.

ModalDialogException

This exception is thrown when an event is blocked by a modal dialog. See the option Check for modal dialogs for details.

Base class: TestException

Message: A modal dialog blocked this event. (plus information about the dialog)

ComponentCannotGetFocusException

Note This exception is obsolete and should not occur anymore.

This exception is thrown when the target component for a 'Key event' or 'Text input' is a text component that cannot get the keyboard focus for some reason. With JDK 1.4 the event cannot be delivered to the component in that case.

Base class: TestException

Message: The target component cannot get the keyboard focus.

DisabledComponentException

This exception is thrown when the target component for a 'Mouse event', 'Key event' or 'Text input' is not enabled. In that case the event would be silently ignored, very likely leading to unexpected results during furhter execution of the test.

For backwards compatibility this kind of exception can be suppressed by deactivating the option Throw DisabledComponentException.

Base class: TestException

Message: The target component is disabled and cannot receive events.

DisabledComponentStepException

This exception is thrown when the target component for a 'Mouse event', 'Key event' or 'Text input' is disabled under 'Windows and components'.

Base class: TestException

Message: The target component is disabled under 'Windows and components', so it cannot receive events.

BusyPaneException

This exception is thrown when the target component for a 'Mouse event', 'Key event' or 'Text input' is covered by a GlassPane with a "busy" mouse cursor. The option Wait for 'busy' GlassPane (ms) determines how long QF-Test will wait for the GlassPane to disappear before the exception is actually triggered.

Base class: TestException

Message: The target component is covered by a 'busy' GlassPane.

InvisibleDnDTargetException

This exception is thrown when the location in the target component for a 'Mouse event' of type DRAG_FROM, DRAG_OVER or DROP_TO for a Drag&Drop operation is invisible and cannot be made visible by scrolling the target component.

Base class: TestException

Message: The target location for the Drag&Drop operation could not be made visible.

DeadlockTimeoutException

This exception is thrown when the SUT does not react for a given amount of time which is defined in the option Deadlock detection (s).

Base class: TestException

Message: The previous operation timed out. It is very likely that the client '...' went into a deadlock.

VariableException

This exception is never thrown itself but is the base class for exceptions thrown in the context of variable expansion.

Base class: TestException

BadVariableSyntaxException

This exception is thrown when a value that is to be expanded doesn't follow a proper variable syntax (e.g. no closing brace).

Base class: VariableException

Message: Invalid variable syntax: '...'

MissingPropertiesException

This exception is thrown when no properties or ResourceBundle are available for the id of a property or resource looked up with ${id:prop} (see 'Load resources' and 'Load properties').

Base class: VariableException

Message: No properties or resources are available under the name '...'.

MissingPropertyException

This exception is thrown when a property looked up with ${id:property} is not available (see 'Load resources' and 'Load properties').

Base class: VariableException

Message: There is no property or resource named '...'.

RecursiveVariableException

This exception is thrown when the expansion of a variable expression leads to recursive variable lookup, e.g. if you set the variable named x to $(y) and the variable named y to $(x) and then try to expand the value $(x).

Base class: VariableException

Message: The variable '...' could not be expanded since it lead to recursive lookup.

UnboundVariableException

This exception is thrown when a variable for a value that is to be expanded doesn't exist.

Base class: VariableException

Message: The variable '...' is not bound.

VariableNumberException

This exception is thrown when a variable expansion for a numeric attributes results in something other than a number.

Base class: VariableException

Message: The value '...' is not a valid number.

BadExpressionException

This exception is thrown when evaluating a $[...] expression fails (see section 7.6).

Base class: ScriptException

Message: The expression '...' is invalid.

BadTestException

This exception is thrown when evaluating the 'Condition' of an 'If' or 'Elseif' node fails.

Base class: ScriptException

Message: The expression '...' is not a valid test.

BadRegexpException

This exception is thrown whenever converting a String to a regular expression (see section 36.4) fails, e.g. for 'Item' or 'Check text' nodes.

Base class: TestException

Message: The value '...' is not a valid regular expression.

BadRangeException

This exception is thrown when the syntax of the 'Iteration ranges' for a 'Data binder' node has invalid syntax or specifies an index outside the valid data range.

Base class: TestException

Message: Invalid iteration range syntax: '...'.
Invalid iteration range index: '...'.

CannotExecuteException

This exception is thrown when execution of a process from a 'Start SUT client', 'Start Java SUT client' or 'Start process' node fails.

Base class: TestException

Message: An error occurred while starting process '...'. Please check the process and PATH settings.

InvalidDirectoryException

This exception is thrown when the 'Directory' attribute of a 'Start SUT client' node refers to a non-existent directory.

Base class: TestException

Message: The directory '...' doesn't exist.

CheckFailedException

This exception is thrown when a check node with activated 'Throw exception on failure' attribute fails.

Base class: TestException

Message: The check for client '...' failed. Expected: '...'. Got: '...'.

CheckNotSupportedException

As explained in the section about checks, each check can handle only a limited set of target components. This exception is thrown when the target component is not suitable for a check.

Base class: TestException

Message: This kind of check is not possible for a component of class '...'.

OperationNotSupportedException

This exception is thrown when an operation like 'Fetch text' is not supported for the designated target component.

Base class: TestException

Message: This operation is not possible for a component of class '...'.

BadComponentException

This exception is thrown, when a component for an event is not suitable, i.e. a non-window for a 'Window event'.

Base class: TestException

Message: The component of class '...' is not a window.

IndexFormatException

This exception is thrown when an invalid index format for a sub-item is encountered (see section 6.3).

Base class: TestException

Message: The value '...' is not a valid string index/number/regexp.

IndexFoundException

This exception is thrown when a sub-item is found during execution of a 'Wait for component to appear' node that looks for the absence of the item.

Base class: ComponentFoundException

Message: The item for index '...' was found.

IndexNotFoundException

This exception is thrown when no sub-item can be located for a given index.

Base class: ComponentNotFoundException

Message: No item was found for index '...'.

IndexRequiredException

This exception is thrown when no sub-item index is provided for an operation that requires one, e.g. a 'Check text' on a JTree.

Base class: TestException

Message: This operation requires an index.

UnexpectedIndexException

This exception is thrown when a sub-item index is provided for an operation that does not require one, e.g. a 'Check items' on a JTree.

Base class: TestException

Message: This operation doesn't support an index for a component of class '...'.

ClientNotConnectedException

This exception is thrown when the target client for an operation is not connected. It differs from a NoSuchClientException in that there is an active process for that name but no RMI connection.

Base class: TestException

Message: Client '...' is not connected.

NoSuchClientException

This exception is thrown when the target client for an operation does not exist.

Base class: TestException

Message: Client '...' doesn't exist.

DuplicateClientException

This exception is thrown if an attempt is made to run more than one client simultaneously under the same name.

Base class: TestException

Message: A client named '...' has already been started.

UnexpectedClientException

This exception is thrown when an unexpected exception is thrown in the SUT during the replay of an event. Unless it is due to a bug in QF-Test, it indicates a problem in the SUT.

Base class: TestException

Message: Unexpected exception in client '...'.

ClientNotTerminatedException

This exception is thrown when a 'Wait for process to terminate' node is executed and the process doesn't terminate.

Base class: TestException

Message: The process '...' did not terminate.

UnexpectedExitCodeException

This exception is thrown when the exit code of a terminated client doesn't match the expected value in a 'Wait for process to terminate' node's 'Expected exit code' attribute.

Base class: TestException

Message: Exit code mismatch.

BadExitCodeException

This exception is thrown when the 'Expected exit code' attribute of a 'Wait for process to terminate' node doesn't match the specification and cannot be parsed.

Base class: TestException

Message: Illegal exit code '...'. Please use '==', '!=', '<' or '>' followed by a number.

ComponentIdMismatchException

This exception is thrown when the 'Component id' attribute of a node points to a node that is not a 'Window', 'Component' or 'Item'.

Base class: TestException

Message: The node '...' with the id '...' is not a component.

UnresolvedComponentIdException

This exception is thrown when the target of the 'Component id' attribute of a node cannot be determined.

Base class: TestException

Message: There is no node with the id '...'.

TestNotFoundException

This exception is thrown when the 'Test' for a 'Test call' cannot be determined.

Base class: TestException

Message: The test '...' does not exist.

DependencyNotFoundException

This exception is thrown when the 'Dependency' for a 'Dependency reference' cannot be determined.

Base class: TestException

Message: The depencency '...' does not exist.

ProcedureNotFoundException

This exception is thrown when the 'Procedure' for a 'Procedure call' cannot be determined.

Base class: TestException

Message: The procedure '...' does not exist.

StackOverflowException

This exception is thrown when the nesting of 'Procedure calls' gets too deep, hinting to a problem with endless recursion. See also the option Call stack size.

Base class: TestException

Message: Too many nested procedure calls.

UserException

This exception is thrown explicitly by a 'Throw' node.

Base class: TestException

Message: The 'Exception message' of the 'Throw' node.

CannotRethrowException

This exception is thrown when an attempt is made to rethrow an exception with a 'Rethrow' node but no exception was caught by a 'Catch' node.

Base class: TestException

Message: Rethrowing a caught exception can be done only from inside a Catch node.

ScriptException

This exception is thrown when the execution of a script from a 'Server script' or 'SUT script' fails.

Base class: TestException

Message: The script failed with the following message:...

BreakException

This is not a standard TestException and cannot be caught by a 'Catch' node. It is thrown by a 'Break' node in order to break out of a loop. From a script, raising a BreakException will have the same effect. If thrown outside of a loop, a BreakException will cause the error below.

Base class: TestException

Message: A Break was triggered outside a loop.

ReturnException

This is not a standard TestException and cannot be caught by a 'Catch' node. It is thrown by a 'Return' node in order to return from a 'Procedure'. From a script, raising a ReturnException will have the same effect. If thrown outside of a 'Procedure', a ReturnException will cause the error below.

Base class: TestException

Message: A Return was triggered outside a procedure.

TestOutOfMemoryException

This is a special exception that is thrown when QF-Test determines that it is running out of memory during test execution. The exception causes the test to abort immediately and cannot be caught because once QF-Test has run out of memory there is little it can do to handle it. QF-Test tries to keep a little reserve memory so it will at least try to save the run-log.