Instruments crashing when using a criteria finding multiple objects

Using Appium 1.3.3; IOS 8.1.1, iPad 2, XCode 6
I am testing a screen which contains a UIAStaticText with name=“Show Me” and another element (not sure what, but a different type) with the same name. What happens, if I am using the following search criteria, the instruments are crashing, it seems because I find more than one object.

@IOSFindBy(name="Show Me")
MobileElement showme;

However, if I change the annotation to an unique criteria, the instruments does not crash anymore.

@IOSFindBy(xpath="//UIAStaticText[@name='Show Me']")
MobileElement showme;

This is something new, it wasn’t crashing with XCode 5 and older Appium

@vicusbass - Yep its hapenning for me when trying to find multiple objects using above config u specified.

@vicusbass and @SrinivasanSekar

Please provide a failure stacktrace.

It is strange because when it find more than one element it should return the first in the list. Without the stacktrace I cannot define the reason.

Hey Sergey, here’s a snippet from Appium logs. It’s crashing somehow before finding the object

appium_logs.txt (17.8 KB)

Thanks!

Are you catch NoSuchElementException on the java side? If it is… Does the locator

@IOSFindBy(name=“Show Me”)

works with xCode 5.x and appium 1.3.3? If it works - it is all right. :smile: Locators can be changed from one OS version to another (iOS as well as Android). So, if you wanna run test against iOS7.x and iOS 8.x

@iOSFindAll({
@IOSFindBy(name=“Show Me”)
})
MobileElement showme;

But, I don’t recommend you to use id because of

If there is another exception, it is possible that there is a server-side problem :frowning:

If it is…
Please show me Java stack trace.If it is possible please send me your app in a private message.

Ok, I’m seeing

info: → POST /wd/hub/session/bc4ee079-d7cc-4d2f-8d57-c7a7d025ca01/elements {“using”:“xpath”,“value”:“//UIAButton[@name=‘Signed in successfully’]”}
info: [debug] Waiting up to 0ms for condition
info: [debug] Pushing command to appium work queue: “au.mainApp().getTreeForXML()”
info: [debug] Sending command to instruments: au.mainApp().getTreeForXML()
info: [IOS_SYSLOG_ROW ] Nov 28 15:42:08 Daniel-Maiers-iPad ReportCrash[2070] : Saved report to /var/mobile/Library/Logs/CrashReporter/KnoTextbooks_2014-11-28-154207_Daniel-Maiers-iPad.ips

info: [debug] Responding to client with error: {“status”:13,“value”:{“message”:“Instruments died while responding to command, please check appium logs”,“name”:“UnknownError”,“origValue”:“Instruments died while responding to command, please check appium logs”},“sessionId”:null}

and I don’t like this :angry: . As I see there is something on the server side.

Also, please tell me what are you doing with this element (e.g. click, sendKeys and so on). If it is possible let me see the test code sample.

Hm, it’s working fine with an iPad mini, IOS 7.1
What could it be?

It’s crashing when identifying the object I think.
The test method is…

public boolean verifyClickMe(){
		return clickMe.isDisplayed();
	}

Ok! I have to repeat my previous questions.

@iOSFindAll({
@IOSFindBy(name=“Show Me”)
@IOSFindBy(xpath=“//UIAStaticText[@name=‘Show Me’]”)
})
MobileElement showme;

will solve your problem because it is possible that locator for iOS 8.1 differs from 7.1 and it is ok.

I suspect that there is a server-side problem otherwise. Then