Forum Discussion

djadhav's avatar
djadhav
Regular Contributor
10 years ago

Saw error message "There was an attempt to perform an action on a zero-sized window."

What does this error mean? I have done extensive coding and work with TestComplete on multiple websites but I'm seeinf this for the first time.



"There was an attempt to perform an action on a zero-sized window."



Basically I'm clicking a link on a webpage. This error occurs during that step.
  • Hello,

      This can happen when the name mapping entry points to an HTML element that has it's height or width attribute set to zero. TestComplete cannot click on it, because it does not occupy any space on the screen. Web developers will often set the height of a <DIV> tag or other element to zero instead of setting it's visible property to false. Your name mapping may also be targeting the wrong element. You should use the object spy on the item that should be clicked, and verify that it's properties in the application match the ones that you defined in the name mapping properties for that object.



    Thanks,

    Rick



    SmartBear Customer Care
    • cristina88's avatar
      cristina88
      Occasional Contributor

      I received the same error about zero sized window, did a spy on the object (I could highlight the object fine) and height and width were in the properties with numbers, so they weren't blank. I ended up having 2 buttons of the same name and the first one was failing, so once I removed it, my button worked and the error was fixed on my end.  

  • djadhav's avatar
    djadhav
    Regular Contributor
    I have done the debugging. When I select the link using the Object Spy at the breakpoint, it shows the correct alias and immediately when I step through the command (Aliases.myLink.Click), it gives this error.
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Dhiraj,


     


    Will adding the RefreshMappingInfo method before clicking an object help?


    You can find more information about this method in this article.


     

  • djadhav's avatar
    djadhav
    Regular Contributor
    Did not help... Same error.

    In fact I tried another link on the same navigation menu and trying to click that gave me the same error as well
  • djadhav's avatar
    djadhav
    Regular Contributor
    The same error is generated when I use Record and Playback option.

    When I record, the script generated has a namemapping for the link.

    During playback, while clicking the same link, the error gets generated.
  • Hi,

     

    Probably the properties taken for mapping the object are same as of some other object in the object tree. You can manually check the properties of your mapped object (link) in "NameMapping" tab and can add "VisibleOnScreen" prop to differentiate between the two. You can also change the parent obj to more specific obj before clicking your link.

    Also you can try remapping that object and choose the properties manually.

     

    I hope adding VisibleOnScreen property would help in this case.

     

    Regards 

    Osaid

    • cristina88's avatar
      cristina88
      Occasional Contributor

      Thanks I appreciate the info! I'll keep that in mind shall I need it next time. :)

  • mailnsuresh's avatar
    mailnsuresh
    Occasional Contributor

    In the runtime, highlight the object before performing click.

    Use Call Sys.Highlightobject(obj)

     

    This gives you an idea as to what object exactly testcomplete is trying to do.

     

  • salley's avatar
    salley
    Frequent Contributor

    Hello,

    i'm facing the similar issue, no luck tried all the options mentioned in this post, , 

    thanks