IfSyntax Object

Applies to TestComplete 14.40, last modified on April 22, 2021

Description

IfSyntax objects are syntax elements that correspond to conditional (if...then...else or if...then) statements. For example:

JavaScript, JScript

if (! Success)
  Log.Error("Checkpoint failed.");

Python

if not Success:
  Log.Error("Checkpoint failed.")

VBScript

If (Not Success) Then
  Call Log.Error("Checkpoint failed.")
End If

DelphiScript

if not Success then
  Log.Error('Checkpoint failed.');

C++Script, C#Script

if (! Success)
  Log["Error"]("Checkpoint failed.");

You can create a IfSyntax object instance using the Syntax.CreateIf method.

The IfSyntax object provides properties to specify the condition to be tested and the statements to be executed if condition evaluates to True and False.

Members

Example

For examples of using the IfSyntax object, see Generating Conditional Statements.

See Also

Syntax Object
CreateIf Method
Script Extensions
Generating Conditional Statements

Highlight search results