Forum Discussion

danalu's avatar
danalu
Contributor
7 years ago

ClickItem works when record but fail when replay on Javax.swing.tree

i encounter a very weird and urgent problem, when i use record script :


def Test2():
tree = Aliases.Horizon.AbstractShowViewAction_ContentAssistDialog2.RootPane.null_layeredPane.MenuBar.Panel.ScrollPane.Viewport.Tree
tree.ExpandItem("null|Add View:|Algo Trading")
tree.CollapseItem("null|Add View:|Algo Trading")
tree.ExpandItem("null|Add View:|Algo Trading")
tree.ClickItem("null|Add View:|Algo Trading|Backtesting")
tree.ExpandItem("null|Add View:|Algo Trading|Backtesting")
tree.ClickItem("null|Add View:|Algo Trading|Backtesting|Backtest Manager")
tree.ClickItem("null|Add View:|Algo Trading|Backtesting|Sessions Replayer")

 

i can see ClickItem work well, but when i try replay it, it fails:

error:

The test run has stopped because the "Stop on Error" setting is enabled. 

Possible reasons:

1. The application stopped responding.

2. The application was compiled incorrectly (see the Open Applications topic in the help system).

3. An error occurred in TestComplete/TestExecute.

Technical information: 527 0x80070057 (The parameter is incorrect.) .

Tested object: Aliases.Horizon.AbstractShowViewAction_ContentAssistDialog2.RootPane.null_layeredPane.MenuBar.Panel.ScrollPane.Viewport.Tree (Sys.Process("java", 2).SwingObject("AbstractShowViewAction$ContentAssistDialog", "", -1, 4).SwingObject("JRootPane", "", 0).SwingObject("null.layeredPane").SwingObject("JMenuBar", "", 0).SwingObject("JPanel", "", 0).SwingObject("JScrollPane", "", 0).SwingObject("JViewport", "", 0).SwingObject("JTree", "", 0))

 
 
and i am sure before, it works !! i try to reinstall Test Complete, but doesn't work.. but test application not change at all. but case can't run.

1 Reply

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    My guess is this... that there's a timing issue going on here somewhere... recording and playback have a flaw in many automated tools, that being that the automation almost ALWAYS plays back faster than the application can keep up.  So, what might be happingin is all these commands are happening too fast for the application and so, when  a "ClickItem" call is made the application may not be ready for it.

     

    Examine what you're testing... after you do something like "ExpandItem" or "CollapseItem", is there something going on in the application that you may need to wait for, like a form to open, or load, or an option to be present on screen?  If so, invesitgating putting in commands on WaitProperty or WaitAliasChild or something to that effect and wait for the application to "catch up" before going on to the next test step.