RunRoutineEx Method

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

Description

Use the RunRoutineEx method to command TestComplete to execute the specified script routine. The method does not pause the program execution until the execution of the specified script routine is over. If the method cannot initiate the routine execution, an error occurs. You can handle it using the means of the scripting language you use (see Handling Exceptions in Scripts).

Declaration

IntegrationObj.RunRoutineEx(ProjectNameUnitNameRoutineNameParameters)

IntegrationObj An expression, variable or parameter that specifies a reference to an Integration object
ProjectName [in]    Required    String    
UnitName [in]    Required    String    
RoutineName [in]    Required    String    
Parameters [in]    Required    Variant array    
Result None

Applies To

The method is applied to the following object:

Parameters

The method has the following parameters:

ProjectName

Specifies the name of the project where the desired routine belongs.

UnitName

Specifies the name of the script unit containing the desired routine.

RoutineName

Specifies the name of the desired script routine.

Parameters

Specifies a Variant-compatible array of the values to be passed to the called script routine as parameters.

Result Value

None.

Remarks

  • Call this method only if TestComplete is not running any tests, else, an error will occur. To check whether TestComplete is running tests, use the IsRunning property.

  • The RunRoutineEx method does not pause the program’s execution until the routine's execution is over. To wait until the routine’s execution finishes, you can call the IsRunning property in a loop. See Working With TestComplete via COM - Overview for more information.

  • To obtain the value of the called script routine, use RoutineResult property after the script run is over.

  • If your C# code is sending custom objects as parameters to the RunRoutineEx method, the assembly should be configured to make the objects visible to COM (in other words, its Make assembly COM-Visible property must be enabled).

Example

For an example of how to use the RunRoutine method, see the Calling Script Routines via COM topic.

See Also

Working With TestComplete via COM - Overview
Calling Script Routines via COM
RunRoutine Method
RoutineResult Property
RunProjectSuite Method
RunProject Method
RunProjectItem Method
RunProjectTestItem Method
Halt Method
Stop Method
GetLastResultDescription Method

Highlight search results