Distinguishing multiple objects in SWT app.

Mar 25, 2009 at 4:30 PM
Hi Vivek, et al,

   I am doing a POC of White for my company and am so far impressed with the capabilities White provides.  However, I have encountered an issue that could be very problematic for which I need some advice.
   My application under test contains, in many places, multiple objects of the same type (for example, two trees objects), which differ only by ApplicationId.  However, this value changes each time I launch the application because (as I understand it) my application is a Java SWT app.  All other fields under Identification (as seen by UISpy) are the same (RuntimeID is taken from ApplicationId, Name is blank).  Each object is buried in its own hierarchy of pane objects, each without a meaningfull identifier of its own, so creating a CustomUI does not seem possible.
   I have tried getting the collection of all Tree items in my app:
                       Core.UIItems.IUIItem[] winAllTrees = window.GetMultiple(SearchCriteria.ByControlType(ControlType.Tree));
   but this only returns the first tree object it finds (am I doing something wrong?).
   I then tried following your suggestion for identifying the object ByPosition using the ApplicationId for the instance I am running in order to generate the WindowsItemMap xml file,
                     Window winTree = application.GetWindow(SearchCriteria.ByAutomationId("71212"), Core.Factory.InitializeOption.NoCache);
      but this could not find the object.
  
   Any advice on how to overcome this issue would be appreciated.

   Thank you.

Wegsta
Mar 31, 2009 at 10:22 AM
Bumping up this issue, as without a solution around this problem, I will not be able to use White as my company's automation tool.
Mar 31, 2009 at 6:20 PM
If you are willing to modify the source, then check out this discusion http://white.codeplex.com/Thread/View.aspx?ThreadId=36953, which provides the fix for GetMultiple.
Coordinator
Apr 7, 2009 at 5:49 PM
in such cases you should add index search to search criteria