Assuming you code is generated by recording (or is similar) then I would suspect the "cacheing" nature of the higher level UI Controls. The application may draw one UI Control containing the first 123
and draw another UI Control for the second 123
. These controls look identical but are different and have different window-ids (or handles or whatever). One of the UI Controls in
WpfListItem uIResult = this.UIAUT.UITier1List.UITier2ListBox.UITier3ListItem;
probably refers to the UI Control of the first 123
even though it is no longer on display. I suspect UITier3ListItem
or its child controls; if it were ...1...
or ...2...
then I would expect a failure message rather than zero matches.