Forum Discussion

jmcwhinney's avatar
jmcwhinney
Contributor
10 years ago

'The execution timeout has expired' within 1 second during a .WaitProperty("Exists",true,5000). How?

My script runs fine on my development PC, but when I schedule it using TestExecute on a different PC, it seems to fail randomly.

 

Most recently, it has failed within 1 second of the test item.

Looking at the log, the test item started at 11:01:54 and Ended at 11:01:55, suggesting that it failed within one second.

 

When I look at the call stack it tells me line # 3 which is:

 

Aliases.browser.BrowserWindow.FrameTab.tabpage.ShellDocObjectView.browser.JavaPluginControlWindow.frame1.panel1.RootPane.null_layeredPane.null_contentPane.DockableHolderPanel.MainDockingContainer.DefaultDockingManager_DockedHiddenSlidingContainer.DockedHiddenContainer.ContainerContainer.DockedFrameContainer.Panel.ContainerContainer.ContainerContainer2.Workspace.ContainerContainer.FrameContainer.tssoc1500m000.RootPane.null_layeredPane.null_contentPane.Workbook_Frame_1.RootPane.null_layeredPane.null_contentPane.DefaultERPForm.Panel.Panel.ToolBar.ToolbarButton.WaitProperty("Exists",true,5000)){

 

If I am telling it to look for this object for 5 seconds, how is it failing after only 1 second???

 

Thanks!

- James


  • jmcwhinney wrote:

    Is it possible that ................that there is a timeout passed via the command line??

    Or maybe it could be something that is getting passed from QAComplete... hmmm...

     

     


    That seems to have been the issue....  I had the default timeout of 30 set in QAcomplete where I was calling the test..

    Cheers,

    - James

  • Ryan_Moran's avatar
    Ryan_Moran
    Valued Contributor

    The WaitProperty method, and it's specified timeout, only applies to the object you specified (ToolbarButton).

    If any parent object associated does not exist then the WaitProperty method does not apply.

     

    Ex:

    Sys.Process("someprocess").WinFormsObject("someform").WinFormsObject("somecontrol").WaitProperty("Exists", true, 5000);

    Will fail if "someform" does not exist.

     

    Waiting for each parent object...

     

    Sys.Process("someprocess").WaitProperty("Exists", true, 5000);

    Sys.Process("someprocess").WinFormsObject("someform").WaitProperty("Exists", true, 5000);

    Sys.Process("someprocess").WinFormsObject("someform").WinFormsObject("somecontrol").WaitProperty("Exists", true, 5000);

     

    Check out this article on "Waiting For Web Pages".

    • jmcwhinney's avatar
      jmcwhinney
      Contributor

      Thanks Ryan,

       

      As you can see from my code, my objects have a very long list of parents, and it would not be realistic to write code to traverse the entire tree, waiting for each parent to exist before looking at its children.

       

      Surely there must be some builtin function to do this for me?

       

      Thanks again for the quick response,

      Cheers,

      - James

      • Ryan_Moran's avatar
        Ryan_Moran
        Valued Contributor

        "my objects have a very long list of parents"

        Indeed. That is why I gave you the link to: Waiting For Web Pages

        At the very least you may want to check that the page exists, and that the toolbar on which the button resides exists.

        If you want a very simple solution then add a delay.

        If you want a more dynamic approach I would suggest searching for the object within a loop with either .Find or .FindChild methods.