Forum Discussion

william_roe's avatar
william_roe
Super Contributor
8 years ago
Solved

'The window was destroyed during method execution' When Using the SetText and Keys in TC 11.31

We are once again attempting to move to TC 11.31 and are unable to move past this error. The current value in the grid filter textbox must be cleared (currently using SetText) before inputting the new value (using the Keys method). The Enter key must used to trigger the grid filtering from the textbox. The following KeyWord test, which worked fine in TC 11.20, is throwing 'The window was destroyed during method execution' error. What gives?

 

 

The 'Additional Info' tab provides the following: 

 

The window with the handle 0x00000000 does not exist.
Most likely, this error occurred because the tested object (window or control) or its parent object was deleted or recreated during the method call or before it. For instance, the window could be destroyed or recreated after you stored the object reference to a variable and before you called the object method through this variable.
If the object is recreated, then to avoid the error, check the object's Exists property before calling the method, and if the object does not exist, obtain a reference to the new object.

Tested object:
Aliases.browser.CribMaster.PrimaryWrapper.Main.sectionResults.SiteProfileGrid.frame.section.tableSplresizing.cell.panelSplresizing0Cc.tableGridviewSiteprofile.cell.panel.panel.tableGridviewSiteprofileDxheader.cell.tableGridviewSiteprofileDxfredit.cell.SiteIDFilter
()

 

 

  • Rolling back to 11.20 has resolved the issue. Support is looking into the problem with 11.31.

7 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Are there triggers or scripts that execute on the browser when the edit field is cleared or changed?  The error you're getting basically says that the handle to the object has changed between one step and the other and, therefore, it cannot be found.  That will usually happen if there's a page refresh, a component change, or something during the course of the script

    • william_roe's avatar
      william_roe
      Super Contributor

      There are events which are triggered but the code hasn't changed since upgrading from 11.20. The error only happens in TC 11.31.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        It could very well be that TC 11.31 is running more efficiently and so is actually executing the tests a bit faster, perhaps catching the objects before they are recreated.  

        Since there are events that fire upon certain changes, I would suggest a best practice would be to use WaitNNN methods for different interactive steps in order to ensure that the object is ready for input before you attempt to use it.

  • william_roe's avatar
    william_roe
    Super Contributor

    Rolling back to 11.20 has resolved the issue. Support is looking into the problem with 11.31.