Description
Use the Process Action operation to perform various actions over a process running in the operating system or obtain the process properties.
When you add an operation to the keyword test, you specify the desired process and the method or property that will be called for this process. Using these methods and properties you can, for instance, terminate the process, get its type (x86 or x64), obtain the memory usage information and perform other actions.
Operation Result
The operation returns the same value, which the called method or property returns. For information on how to obtain the result value, see Checking Operation Result.
Scripting Analogue
The operation is a keyword test analogue to the process
object and its methods and properties.
Child Operations
The operation cannot have child operations.
Operation Parameters
The operation uses the following parameters:
- The name and index of the process, with which the operation will work.
- The name of the method or property to be called.
- The method’s (or property’s) parameters.
When you add the operation to your keyword test, TestComplete displays a wizard that lets you specify all the parameters of the operation. To modify parameters of an operation that is already added to the test, you use special dialogs and in-place editors that are analogues to the wizard’s pages.
Specifying parameters when adding the operation
The wizard, that TestComplete displays when you are adding the operation to your test, contains the following pages:
Select Process
On this page you can specify the process with which the operation will work.
If the desired process is running in the operating system, then select the Select existing process option button and choose the process you need from the list that is shown below this option button. Note that by default the list does not display system processes. To view them, select the Show system processes check box.
If the desired process does not exist at the moment, or if you do not want to select the process from the list by some reason, you can specify the process by its name and index. To do this, choose the Enter process details option button and then type the name and index of the needed process into the Name and Index boxes correspondingly.
The name of the process is the name of the process executable minus the path and extension. For instance, if you test the C:\MyFolder\MyApp.exe application, you should specify MyApp rather than the fully-qualified name of the executable.
Index specifies the number of the application instances among other processes that were launched by the same executable. For instance, if you have several instances of MyApp running in the system, then to work with the instance that was launched second, enter 2 into the Index box.
Specify Method or Property
On this page you can choose the method or property of the selected process. The operation will call this method (or property) to perform an action over the process or obtain information about it. For detailed information about methods and properties, see description of the process
object.
Operation Parameters
On this page you specify the parameters of the method (or property) that will be called by the operation. For information on the parameters, see the method (or property) description. If the method or property is provided by TestComplete, you can find the description by searching for the method (or property) name in TestComplete help.
For more information on setting the values on the page, see Specifying Operation Parameters.
Modifying Parameters
To modify parameters of the operation, you can use the wizard that is displayed when adding the operation to keyword tests. To invoke this wizard, double-click the operation in the Keyword Test editor.
An alternative approach to modifying operation parameters is to use the in-place editors and dialogs provided by the Keyword Test editor. These editors and dialogs are analogues to the wizard’s pages.
To specify another process:
-
Select the operation in the test.
-
Click within the
Item
cell twice (not a double-click), or select the cell and press F2. This will activate the in-place editor. -
Click the ellipsis button within the in-place editor. This will invoke the Select Process dialog that is similar to the Select Process page of the Operation Properties wizard (see above).
-
Use the Select Process dialog to specify the desired process. Click OK to close the dialog.
-
Press Enter to apply the changes and close the in-place editor. Press Esc to discard the changes.
To choose another method or property to be called by the operation:
-
Select the operation in the test.
-
Click within the
Operation
cell twice (not a double-click), or select the cell and press F2. This will activate the in-place editor. -
Select the desired property or method from the drop-down list.
-
Press Enter to apply the changes and close the in-place editor. Press Esc to discard the changes.
To specify the method or property parameters:
-
Select the operation in the test.
-
Click within the
Value
cell twice (not a double-click), or select the cell and press F2. This will activate the in-place editor. -
Click the ellipsis button of the in-place editor. This will invoke the Operation Parameters dialog, in which you can specify the parameters. For detailed information on the parameters, see description of the method or property, to which the parameters belong.
-
Click OK in the dialog to save the changes.
-
Press Enter to apply the changes and close the in-place editor. Press Esc to discard the changes.
See Also
Test Actions Category
Specifying Operation Parameters
Checking Operation Result
Process Object
Call Object Method Operation