Forum Discussion

yship's avatar
yship
Occasional Contributor
12 years ago

After right clicking and deleting an item from a dropdown menu, TestComplete stalls

Hi everyone,

Sorry for the confusing title but it's a bit of a strange problem.



In my test I open a dropdown menu (wpf comboBox) right click one of the items, and press delete.

The script is :  



Sys.Process("TestedApp").FindChild("Name", "*ComboBoxItem*" + ItemTitle + "*" ,100).ClickR();

Sys.Process("TestedApp").FindChild("Name", "*ComboBoxItem*" + ItemTitle + "*" ,100).PopupMenu.Click("Delete")

//A "are you sure you want to delete ItemTitle confirmation message appears here and disables the main application window.

//The test stalls for a few minutes here.

Log.Message("test passed");



after clicking delete, the delete confirmation message pops up, and TestComplete stalls for a few minutes with the message "Waiting for WPFObject("ComboBoxItem", "ItemTitle", 6)" before continuing to the Log.Message line.



I don't understand why it keeps looking for the item in the dropdown menu after deleting. is it some kind of hidden feature in the popupmenu / findchild methods?



The same happens when I try to run a recorded test.



Thanks ahead,

Y. Shippin

3 Replies

  • aqAnt's avatar
    aqAnt
    SmartBear Alumni (Retired)

    Hello,


    I suggest that you delete an item in your control in the following way:



    // ...

    PropArray = new Array("ClrClassName", "Content");

    ValuesArray = new Array("ComboBoxItem", "ItemTitle"); 

    var w = Sys.Process("TestedApp").FindChild(PropArray, ValuesArray, 20);


    if (w.Exists)

    {

      w.ClickR();

      w.PopupMenu.Click("Delete");

    }

    // ...



    Once the Delete context menu item is selected, please make sure that TestComplete handles the confirmation message properly before accessing the main window's objects.

  • yship's avatar
    yship
    Occasional Contributor
    I'm afraid this returns the same results...

    TestComplete is stalling on the line :   w.PopupMenu.Click("Delete");

    with the message: "Waiting for WPFObject("ComboBoxItem", "TestItem1", 12)"

    After the delete button was clicked.



    Here is the code used :



    var itemTitle= "TestTitle";

    Sys.Process("VS Forensics").FindChild("Name", "*testedComboBox", 100).Click();

    PropArray = new Array("ClrClassName", "Content");

    ValuesArray = new Array("ComboBoxItem", itemTitle);

    Sys.Process("tested application").Refresh();

    var w = Sys.Process("tested application").FindChild(PropArray, ValuesArray, 20);



    if (w.Exists)

    {

      w.ClickR();

      w.PopupMenu.Click("Delete");

      Log.Message("Passed")

    }


  • aqAnt's avatar
    aqAnt
    SmartBear Alumni (Retired)

    Hello,


    I suggest that you rerecord the actions to click the Delete context menu item, add the FindChild method call of the combo-box object (instead of the Process object) if needed and check how it works.