How do you minimize TestComplete after execution begins?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2010
01:48 AM
01-29-2010
01:48 AM
How do you minimize TestComplete after execution begins?
At the start of my script I am using a user form to enter runtime parameters. I selected the option to minimize TC during execution, but the user form makes TC reappear. I have been unable to find a command to programmatically minimize TC after the form is hidden.
Thanks
JL
5 REPLIES 5
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2010
08:17 PM
01-30-2010
08:17 PM
Hi 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...
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2010
01:52 AM
01-31-2010
01:52 AM
Thanks Giri, that worked great except for the single quotes on the *, but I caught that right away.
Jeff
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2010
09:41 AM
03-29-2010
09:41 AM
Hi!
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
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2010
10:56 PM
03-29-2010
10:56 PM
Hi Steve,
Try this (DelphiScript) instead of your try block:
p := Sys.WaitProcess('TestComplete')
if (p.Exists) then
p.Window('TfrmTCMainForm', '*', 1).Minimize();
Try this (DelphiScript) instead of your try block:
p := Sys.WaitProcess('TestComplete')
if (p.Exists) then
p.Window('TfrmTCMainForm', '*', 1).Minimize();
Regards,
/Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
/Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2010
12:45 PM
03-31-2010
12:45 PM
Alexi,
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
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
