Forum Discussion
5 Replies
Sort By
- tristaanogreEsteemed ContributorWhile, technically, it should work, the code you have posted is not exactly how I would recommend it. You have two wait commands present and so there's the possiblity that one or the other will end up with a "Does not exist" error that will cascade.
Sys.WaitProcess("ApplicationName",2000,1).WaitWinFormsObject("ApplicationName",2000).WinFormsObject("MdiClient", "");
I would change your code to the following. Note this is Pseudo code, not necessarily in a particular languageMyAppProcess = Sys.WaitProcess("ApplicationName", 2000, 1)
If MyAppProcess.Exists then begin
MyFormObject = MyAppProcess.WaitWinFormsObject("ApplicationName", 2000)
if MyFormObject.Exists then
MyMDIClient = MyFormObject.WinFormsObject("MdiClient","")
else
Log.Warning("My Form object does not exist")
end
else
Log.Warning("The process does not exists")
The idea is that you test for exist each time you call a "Wait" method. - lnd_amaralContributorCan you show us the code where's the problem?
First, you can check if the desktop module is installed. You can check this openning the setup of TestComplete, click in "Modify" and see if the Desktop module is checked. If yes, ignore this. If not, install this module and try to run your script and verify if the problem still happens. - DurgaPrasadOccasional ContributorHi Leonardo,
We are working on desktop applications only and option is checked as desktop only in TestComplete installation
The following is the line of code
Sys.WaitProcess("ApplicationName",2000,1).WaitWinFormsObject("ApplicationName",2000).WinFormsObject("MdiClient", ""); - Ryan_MoranValued ContributorRobert is correct. You must check the exists property of each parent object prior to checking the exists property of the child object. The wait methods you have specified will not work as you are expecting.
- DurgaPrasadOccasional ContributorHi Robert,
i have updated code as the same but still the issue repeats in TC 10.0.
This isn't appear in TC 8.7
Related Content
Recent Discussions
- 2 days agoGane195