Forum Discussion

DurgaPrasad's avatar
DurgaPrasad
Occasional Contributor
11 years ago

Issue in TestComplete 10.0 which is not coming n TestComplete 8.7

Hi,



We have recently updated our TestComplete from TestComplete 8.7 to 10.0.531.

In one of our Test Case we are getting the "object does not exist. see Additional Information" error in TestComplete 10.0



In Additional Information we have the following information as

"You are trying to call the "WinFormsObject" method or property of the "WinFormsObject("Our Application")" object that does not exist."





5 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    While, 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 language

    MyAppProcess = 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.




  • Can 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.
  • DurgaPrasad's avatar
    DurgaPrasad
    Occasional Contributor
    Hi 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_Moran's avatar
    Ryan_Moran
    Valued Contributor
    Robert 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.
  • DurgaPrasad's avatar
    DurgaPrasad
    Occasional Contributor
    Hi 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