Forum Discussion

GordonD's avatar
Occasional Contributor
6 years ago

ComboBox item selected ok but get an error anyway

I have a test with a ComboBox "ClickItem" operation to select a ComboBox item, with this description: "Selects the 4 item of the 'ComboBox' combo box". The 4th item is always selected correctly, but ...
  • Marsha_R's avatar
    6 years ago

    You can use Point and Fix in ObjectSpy to get the combo box.  Let's see what that shows.

  • GordonD's avatar
    6 years ago

    I solved this issue by using a script function (as suggested by Alex at Smartbear) to call the ComboBox's native method (SelectItemWithValue) instead of the TC method ClickItem that's added when recording the test.  I had trouble finding the ComboBox with ObjectSpy to use as the object path in the script, but I found it using Point and Fix as suggested by Martha (I marked it as the solution, since it was the closest).  That was necessary because the ComboBox only exists while the dropdown is open, and it closes when you click elsewhere, e.g. for the ObjectSpy drag.


    Alex explained that the TC ClickItem method, which I had used for the ComboBox item selection, first executes the click, then verifies that it went ok.  But the ComboBox disappears in the object tree as soon as the selection is made, so it hangs while trying to verify.