Forum Discussion
5 Replies
Sort By
- giriprasasd100Occasional ContributorHi Jeff,You can minimize TestComplete window by writing a small line of code.When you browse through the object browser in TestComplete, you can find its main window object from Sys.Process() tree...---> Sys.Process("TestComplete").Window("TfrmTCMainForm", '*', 1)Once you get this object u can minimize or maximize the window as you wish.Since you are using forms, you need to write the following code in to Form's OnHide event:---> Sys.Process("TestComplete").Window("TfrmTCMainForm", '*', 1).Minimize()Hope it helps you...
- jlucasNew Contributor
Thanks Giri, that worked great except for the single quotes on the *, but I caught that right away.
Jeff
- stevereissOccasional ContributorHi!
I ran into the same problem with a User Form bringing TestComplete back to its restored state. The code works fine in TC, but will fail if the suite is run in TestExecute because the process name ('TestComplete') will NOT be found.
I've tried to use a Try..Except block and Log.LockEvents / Log.UnlockEvents :
try
Log.LockEvents(); (* turn OFF logging *)
Sys.Process('TestComplete').Window('TfrmTCMainForm', '*', 1).Minimize();
Log.UnlockEvents(); (* turn ON logging *)
except
end;
This will still trigger an error condition when run in TestExecute....
Is there some other way to have a special case for TestExecute so there
will not be an Error in the logs due to this condition?
Thanks!
Steve - AlexKarasChampion Level 3Hi Steve,
Try this (DelphiScript) instead of your try block:
p := Sys.WaitProcess('TestComplete')
if (p.Exists) then
p.Window('TfrmTCMainForm', '*', 1).Minimize(); - stevereissOccasional ContributorAlexi,
Thank you for the reply! The WaitProcess() call was the exact thing that I was missing... The call to process() was NOT the way to go for this task.
Thanks again!
Steve
Related Content
- 3 years ago
- 2 years ago
Recent Discussions
- 2 days ago