This project is read-only.

Consider adding IUIItemContainer.Get(SearchCriteria) overload

Aug 11, 2008 at 3:23 PM
I'm coming across an issue testing the stock OpenFileDialog that comes with WinForms.  In Windows Vista, the Open button is actually a split/dropdown button that a "Show Previous Versions" option, which shows up as either a ControlType.Pane or ControlType.Button (not sure why, but it can come up as either, probably depending on whether it's focused?).  In XP, it's just a plain button (ControlType.Button).  In either case, the AutomationId is always "1" in UISpy.

With White, I can't (easily) just say "get UI element with AutomationId='1'" without caring what type it is, and Click() it, because I also have to implicitly indicate a ByControlType() criterion in my SearchCriteria.  So, I think an overload of IUIItemContainer.Get with the following signature would be useful:

UIItem IUIItemContainer.Get(SearchCriteria)

Currently, for this particular case, I'm instead using the AutomationElement to do a AutomationIdProperty search using AutomationElement.FindFirst(...).
Aug 11, 2008 at 8:01 PM
I think you have valid point here. This is something which is not present in white. Thanks for bringing this up. I hope you would see this in 0.18 release.
Nov 9, 2008 at 1:08 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.