EzProcess
EzProcess represents the underlying process of the application under test. Generally used to create an instance of EzRoot
Syntax
public class EzProcess : IDisposable
Constructors
| Name |
Input |
Description |
| EzProcess(string processFullPath, string processName) |
string, string |
Creates a new instance of EzProcess based on the process path and the process name passed in |
Properties
| Name |
Type |
Description |
| Process |
Process |
Represents the underlying System.Diagnostics.Process behind this instance of EzProcess |
| ProcessId |
int |
The underlying processId of the application as it would appear in task manager, for example |
| ProcessPath |
string |
The path within the operating's folder structure to the exceutable that was launched to spawn this process |
| ProcessName |
string |
The name of the current process |
| Arguments |
string |
Arguments associated with the process that are passed to the executable on startup |
Methods
| Name |
Return Type |
Description |
| StartProcess() |
void |
Starts the process |
| TerminateExistingInstances() |
void |
Terminates all existing instances of the current process. Uses Process.Kill() method under the hood |
| Dispose() |
void |
Kills and disposes of the underlying process |
Samples and Usage
The EzProcess class provides a way to start up the process that will be under test
Sample:
const string calculatorPath = C:\\Windows\\System32\\calc.exe";
using (EzProcess process = new EzProcess(calculatorPath, "Calculator"))
{
process.StartProcess();
}