Forum Discussion

heidi_n's avatar
heidi_n
Regular Contributor
8 years ago

Help with "Zero-sized Window" error?

Hi,

 

I'm getting a "Zero-sized Window" error on this line:  homePageObjects.getPrimaryMenuSearchOutput().Click();

 

Any advice?

 

/*
  *Navigate from Main Menu to Module
*/
var homePageObjects = require("Home_Page_Objects");

function primaryMenuNavigateTo2(moduleName)
{
  //Highlights, then Clicks Ellipsis
  Sys.Highlightobject(Aliases.browser.pageXXXX.panelMainform1.panelMainformUnipagecontrol11.panelTabbar.panelMainformUninavigationmenu10);
  
  homePageObjects.getPrimaryMenuNavigationDropDown().Click();
  
  homePageObjects.getPrimaryMenuSearchbox().SetText(moduleName);
  
  //Highlights, then Clicks Output
  Sys.HighlightObject(Aliases.browser.pageXXXX.panel.panel);
  
  homePageObjects.getPrimaryMenuSearchOutput().Click();
  //Aliases.browser.pageXXXX.panel.panel.Click();
}

//Hits Select in PO Receipts Pick List

function selectPOReceipt() {
  Aliases.browser.pageXXXXTab1.panelHyperpick0.panelHyperpick1.panelHyperpickPanel20.panelHyperpickPnlbuttons0.linkHyperpickBtnselect0.textnodeHyperpickBtnselect0Btnin.Click();
}
  • Zero sized window usually means that the object in question is present but has height and width of zero each at the time the "Click" operation is attempted.  Looking at your code, there's an action that is happening before that code.  My guess is that the automation code is moving faster than the application can render your components.  This is what we call a "timing issue". Apparently, something that is supposed to bring that window up in your application is not finished processing yet.  You'll need to add some sort of "Wait" methodology before your call to make sure that the appropriate stuff is rendered.  It could either be in the code you have already posted or somewhere within the object you're importing.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Zero sized window usually means that the object in question is present but has height and width of zero each at the time the "Click" operation is attempted.  Looking at your code, there's an action that is happening before that code.  My guess is that the automation code is moving faster than the application can render your components.  This is what we call a "timing issue". Apparently, something that is supposed to bring that window up in your application is not finished processing yet.  You'll need to add some sort of "Wait" methodology before your call to make sure that the appropriate stuff is rendered.  It could either be in the code you have already posted or somewhere within the object you're importing.