Forum Discussion

JennyH11's avatar
JennyH11
Frequent Contributor
7 years ago

Attempt to perform an action on a zero-sized window

Hi

 

I'm having some difficulty in getting a keyword test to interact with a menu item in a web page.

 

I'm trying to click the object to Logout of the application at the end of a test but it's not able to be found. Yet, it's visible when the test is running, there are no windows overlapping etc and it isn't inside a sub menu of any kind. I've run through this page to try and isolate a cause but none found : https://support.smartbear.com/testcomplete/docs/testing-with/exploring-apps/messages/cannot-highlight-object-on-screen.html?q=cannot%20highlight%20this%20object%20on%20screen.

 

I've tried numerous ways to get this to work including, re-recording the click action, adding a checkpoint in before hand on the object (this has worked for me prev), I've also tried using different operations like Call Object Method & If Object but I'm out of ideas.

 

Additional info from the log is here:

 

The window size is (0, 0); the screen rectangle: the left top corner is (0, 66), the right bottom corner is (0, 66).

 

Tested object:
Aliases.browser.pagePersonaldata.panelPgccrewpersonaldata.panelPgccrewpersonaldata.panelPgccrewpersonaldata.panelPgccrewpersonaldata.linkCrewPersonalData
(Sys.Browser('chrome').Page('http://localhost:8082/PersonalData').Panel('CrewInformations').Panel('cbpInformations').Panel('CrewPersonalData_ViewPageControl').Panel('pgcCrewPersonalData').Link(13))

 

 

Any help would be really appreciated.

 

Thanks!

Jenny

2 Replies

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      The topic that dmiscannon linked in is your best bet.  I frequently get that in my log files for tests where I attempt to click on something before it is ready to be clicked on. One of our web applications doesn't actually "destroy" modal forms when they go away, it simply sets the height and width to zero.  So, the form is always present and "Exists" is always true.  It is, also, technically always visible.  So, when we want to detect if the form is on screen, we check the "Width" property.  If it is greater than zero, we then can act against it.  We use the "WaitProperty" method in a loop.  While Width is zero, we keep looping until either the width changes or we hit a maximum time out.  You might want to consider implementing something like that.