Capturing the Command Line of a Process running in the Task Manager
I don't know if this test is possible but I would like to ask the experts if it can be done.
Using TestComplete, is there a way to capture the command line of a process that appears in the Task Manager.
When a certain task (double click on a link) in the web application is called, I would like to verify the process for that task has the correct command line and then copy it to the log result. The process remains visible in the task manager for about 10 seconds before it gets cleared.
Is there a Javascript method that will do this without launching the task manager?
Thank you !!!
One way to do that is using PowerShell
gwmi win32_process | select commandline, name | format-list
I am sure you can massage the data a little better and use a filter to just find "httpd.exe".
The simplest way is to use the builtin functions.
let n = "TestComplete"; let p = Sys.Find("ProcessName", n); p.Exists ? Log.Message(p.CommandLine) : Log.Message("Process " + n + " not found !");
Or if the process to check is always the same :
Sys.Process("TestComplete").Exists ? Log.Message(Sys.Process("TestComplete").CommandLine) : Log.Message("Process not found !");