steveha
steveha

Reputation: 76695

Android UiAutomator: does UiObject have a .getClassName() method?

According to the documentation, the UiObject class has a method function .getClassName() that should return the className property of the UI object. Link:

http://developer.android.com/tools/help/uiautomator/UiObject.html#getClassName()

However, when I try to build my UIAutomator tests, the build fails with this error message:

[javac] /Users/shastings/devel/my_project/tests/src/com/dts/test/ui/MyTest.java:55: cannot find symbol
[javac] symbol  : method getClassName()
[javac] location: class com.android.uiautomator.core.UiObject
[javac]         name = o.getClassName();
[javac]                 ^
[javac] 1 error

Other method functions such as .getVisibleBounds() work fine, and anyway the error message confirms that o is an instance of UiObject.

P.S. I just updated my SDK to the latest and this still happens.

Upvotes: 0

Views: 757

Answers (1)

Anders
Anders

Reputation: 429

getClassName() was added in API level 18 (Android 4.3). Are you sure you are building with that version?

Upvotes: 1

Related Questions