UIAElements don't honor equality

Originator:Jason.Kozemczak
Number:rdar://12163459 Date Originated:08/23/2012
Status:Open Resolved:
Product:Developer Tools Product Version:4.3
Classification:Serious Bug Reproducible:Yes
 
Summary:

When interating a UIAElements subelements (via `.elements()`), comparing an element to itself returns false. This makes various classes of assertions essentially impossible, nor is it good engineering practice.

Steps to Reproduce:

Create any simple iOS app (I created a SingleView App with 3 buttons). run the app in the Automation Instrument with the following script:

```
var elements = UIATarget.localTarget().frontMostApp().mainWindow().elements();
for (var i = 0; i < elements.length; i++) {
	var el1 = elements[i];
	var el2 = elements[i];
	var equals = (el1 == el2);
	UIALogger.logMessage(el1.label() + " is equal to " + el2.label() + " ? " + equals);
}
```

Expected Results:

The elements should all be equal to themselves

Actual Results:

None of the elements are equal to themselves (????)

Notes:

No additional notes.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!