Ask a Question

How to resolve this error Window was destroyed during method execution'.??

rishi_1
Occasional Contributor

How to resolve this error Window was destroyed during method execution'.??

Every time I click on yes button to close a dialog I get 'Window was destroyed during method execution'







The error message is:



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.





Please suggest me a generic solution to resolve this error.
12 REPLIES 12
TanyaYatskovska
SmartBear Alumni (Retired)


Hi Rishi,


 


We need to know more about the issue:


1. What button are you clicking?


2. Do you get the error only when executing your test in TestComplete?


3. What TestComplete version are you using?


 

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



mugheessiddiqui
Contributor

I had also faced same issue several time, and TestObj.Refresh() resolved that problem. Add Refresh() call before performing any action on object.
rameshkumar_tho
New Contributor

When I am trying to open an URL in chrome using



Sys.Browser("chrome").ToUrl("www.google.com")



I am getting the following JScript runtime error

"Cannot find the window with handle 0"



Environment:

Win7

TC 9.31

Chrome 32.0



Can anyone help me in resolving this issue.



Thanks

Ramesh
Thanks Ramesh Kumar Tholasimham
AlexKaras
Community Hero

Hi Ramesh,



The reason is incompatibility between Chrome 32 and TestComplete 9.31.

Possible solution is to either downdrade Chrome to the version 30 supported by TC 9.31 (don't forget to disable Chrome's autoupdate by renaming the <programFiles>\Google\Update folder before starting Chrome for the first time ! ) or to upgrade to TC 10 and install the corresponding patch from the http://support.smartbear.com/downloads/testcomplete/chrome-patches/ page.
Regards,
  /Alex [Community Hero]
____
[Community Heroes] 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 Heroes]
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 Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
rameshkumar_tho
New Contributor

Thank you Alexei Karas.



I uninstalled and installed Chrome and the issue resolved. I am still on Chrome 32. Now I dont find the issue which I have mentioned above.



But now, I am facing another issue when using Keys.

Example:: Sys.Browser("chrome").Page("*").Keys("ramesh");

Error::

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.



Can you please help me out in resolving this issue.

Thank you

Ramesh






Thanks Ramesh Kumar Tholasimham
rameshkumar_tho
New Contributor

Team,



I am waiting for reply. Some one please respond.

Thank you
Thanks Ramesh Kumar Tholasimham
AlexKaras
Community Hero

Hi,



I'm not sure what are you waiting for...

TC 9.31 is not compatible with Chrome 32.

TC 10 can work with Chrome 32 after applying a patch from the link mentioned above.
Regards,
  /Alex [Community Hero]
____
[Community Heroes] 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 Heroes]
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 Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
rameshkumar_tho
New Contributor

Thanks Alexei Karas. Will install Test Complete 10 on my machine. Does TestComplete 9.31 license work for version 10? Or do we need to purchase a separate License for Test Complete 10?
Thanks Ramesh Kumar Tholasimham
AlexKaras
Community Hero

Hi Ramesh,



The licenses are different, but both versions can be installed on the same machine.

If you had an active maintenence subscription, your TC9 license might have been upgraded to version 10. The best option is to check this on your customer portal (https://my.smartbear.com/).
Regards,
  /Alex [Community Hero]
____
[Community Heroes] 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 Heroes]
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 Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
cancel
Showing results for 
Search instead for 
Did you mean: