Forum Discussion

testertesting's avatar
testertesting
Occasional Contributor
5 years ago

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

Hi,

 

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! 🙂

    • testertesting's avatar
      testertesting
      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.

      • testertesting's avatar
        testertesting
        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.