The Process method returns a
Process object by its application name and index. If the process is not found, the method returns an empty object and posts the message “The process … was not found” to the test log. You can call
Exists to determine whether the returned object is a process in the system. To obtain the process object without posting any messages to the test log, use
Usually, there are several application processes running in the system. Each of them runs an application with a unique name, but there can be several instances of the application running at the same time. They will have the same application name but different process indexes. The first instance will have index 1, the second, 2, etc. If ProcessIndex is omitted, it is regarded as 1. If you obtain several processes with the same name and the process with the lowest index is terminated, the indexes of other processes will be decreased by one.
Once you obtain the process object, you can test its UI. If the application is an Open Application, you can use the
Process object to access application objects, their methods and properties.
|TestObj||A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section|
|ProcessIndex||[in]||Optional||Integer||Default value: 1|
The method is applied to the following object:
To view this method in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.
The method has the following parameters:
Specifies the name of the process you want to get.
Specifies the index of the process you want to get.
Process object that provides access to the specified application.
The following example demonstrates how to use the
Process method in scripts:
var p = Sys.Process("Notepad");
p = Sys.Process("Notepad")
Set p = Sys.Process("Notepad")
p := Sys.Process('Notepad');
var p = Sys["Process"]("Notepad")