Forum Discussion

joe_2's avatar
joe_2
Contributor
10 years ago
Solved

Anyone know why the name of an object might be different one time?

Most of my tests rely heavily on the FindChild function.  When I can, I use button text, or other properties to find by, but often I'm reduced to using the object's name.



Recently I've run into errors in which the name of an object will be different than it has been before.



I'm talking about stuff like a window that's normally named

'WinFormsObject("AcquireXray")'

suddenly changing to

'Window("WindowsForms10.Window.8.app.0.2bf8098_r13_ad1", "", 1)'

in mid-test-run.  

The test is repeatedly opening and closing the relevant forms.

It's right, and then suddenly it's wrong and the test can't find the required object, because the form it's supposed to be a child of doesn't exist.



Also, when I do search by ButtonText, this no longer works with the 'renamed' form, because a winformsobject button has a ButtonText field, but a Window(<whatever>) object does not.



Anyone know why I might suddenly be seeing this?

Is it a problem with TestComplete's routines that map objects for the object browser, or is it more likely to be a problem with the latest iteration of my program failing to name stuff correctly?  I'm at a loss.



Oh.. I'm running TC10 with a test suite that was started under 9 and then updated when 10 came out, in case that's relevant.
  • Finally figured out what was going on with this.

    The application under test was dynamically building a right click menu with items present in a particular folder.

    It was not supposed to be leaving anything in that folder for more than 30 days... and it had not cleared the folder in over a year.

    Instead of ten or twenty items, there were several hundred, and the routine to build the menu was taking a long time.

    This delay eventually exceeded the wait times set in TestComplete, and started affecting performance.

     

    The path to this bug was indirect and somewhat misleading, but TestComplete did eventually lead me to it.

     

3 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)
    Hi Joseph,

     


    It looks like TestComplete doesn't have enough time to recognize the objects properly. Perhaps, some complex actions take place in your app. Try increasing the value of the "Method invoke timeout" project options (set it to more than 30000ms). Please read the "Project Properties - General Open Applications Options" article for details.


     


    Does it help?

  • Tried increasing the timeout.  Didn't help.

    The window is unresponsive for several seconds after opening, though, so I'm thinking you might not be off base about it being too busy.



    I worked around the issue with a brute force method...

    If it opens a wrongly named window, I close the window and reopen it.  Repeatedly if necessary.  Until I get the correctly named window.  Then I proceed with the test.



    It's not elegant, and it puts a bunch of extra key presses in my log whenever the error occurs, but it at least keeps the test from failing.
    • joe_2's avatar
      joe_2
      Contributor

      Finally figured out what was going on with this.

      The application under test was dynamically building a right click menu with items present in a particular folder.

      It was not supposed to be leaving anything in that folder for more than 30 days... and it had not cleared the folder in over a year.

      Instead of ten or twenty items, there were several hundred, and the routine to build the menu was taking a long time.

      This delay eventually exceeded the wait times set in TestComplete, and started affecting performance.

       

      The path to this bug was indirect and somewhat misleading, but TestComplete did eventually lead me to it.