Showing results for 
Search instead for 
Did you mean: 

"action on zero-sized window" error performing action on object for the second time.

Occasional Contributor

"action on zero-sized window" error performing action on object for the second time.



I have seen a lot of "action on zero-sized window" errors online, but non that fits my specific case.


There are only a few controls in the WinForms app I am testing that cause this to happen. It seems to happen if I map a control once, and then map it again later on in the test. The mapping code is the same each time it happens. 


I am wondering is there any way of disposing of the object that I'm mapping the control to, so that next time it comes around to do the same thing, it is like the first time it's doing it?


I have tried Refresh(), RefreshMappingInfo() does not apply to my test, and I've also added a big delay to ensure that it's not my script running faster than the controls are rendering.


Any help would be greatly appreciated.


NOTE: I don't have this problem if the app I'm testing is closed and then reopened before the second time it maps the control. 


Thanks! Sorry I can't give any more info. IT's a tough one to describe! 🙂

Community Hero

Why are you mapping the control every time you see it?  If the name changes just a little, you can look at using wildcards to let the name mapping match a range of values and then you won't need to do that mapping every time.

Occasional Contributor

Apologies, I am using incorrect terminology. I should avoid the word "mapping".


What I am doing is clicking on a control, moving on to the next test without restarting the application being tested, and then attempting to click on the control again. I am not mapping this control, I am using FindChild to access it both times. The second time I attempt to click it I get the following:



When I inspect the control in ObjectBrowser, it exists, but it has a ControlIndex and ControlIndexInGroup of -1.

It also has a Height and Width of zero, as well as ScreenLeft and ScreenWidth of zero.

Occasional Contributor

To add a bit more context, see the screenshot below. The Object Browser shows that the object is not showing the same way as before.



Community Hero

Outside of TestComplete, what happens if you walk through those exact same steps manually?

Community Manager

Thank you Marsha!

Hi @testertesting please let us know if you solved the issue. Otherwise, it looks like Marsha is waiting for more details from you, and the Community would be happy to continue the investigation!

Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
New Here?
Join us and watch the welcome video:
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

Get properties of a web page element

See replies!

Compare images using the Region Checkpoint

See replies!

Compare HTML table with Excel file and correct data in Excel file


How to execute remote test and obtain results via Test Runner REST API

Top Kudoed Authors