Forum Discussion

amithsid's avatar
amithsid
Contributor
12 years ago
Solved

WPF Combobox

How to perform a ClickItem("text") action on a WPF Combobox, Instead of using Index?
  • tristaanogre's avatar
    7 years ago

    Because contentText may include a variety of objects with the same text.  It's the text version of the content of the HTML tag and all it's children.  So, when you "find" using the content text, it will return the first one found... which is probably the Link itself and not the child panel.  

     

    Also, you are using "Find" twice... basically, telling the code to search for the object... and then search for it again.  A better way would be doing the Find and then assigning the result of the find to a variable and using that for your reference.  Something like

    var myObject

    myObject = Sys.Process('myapp').Find(blah, blah, yada)

    if (myObject.Exists) then

    Log.Message(myObject.Parent.className)

     

    One better... woud be to map your objects using NameMapping and then you wouldn't need to code for the "find".