Hack the World!

プログラミングや,ネットワークに関する話題を取り扱っています.知識をつけて,優雅にお仕事するのを目指しています.

UI Automator Testについて調べてみた(その2)

幾つか追加情報、修正情報が出てきたので書きます。

■リリース時期

8月にNext Release とか言ってるので、どうやらKey Lime Pie からになりそうです。

https://groups.google.com/forum/?fromgroups=#!search/UIAutomator/android-platform/KSranAzKUsI/0cmiYI6Pgj0J

ADTr21もfinal が近い様なので、リリースが間近という感じでしょうか。
# とりあえずは、dump でアプリの解析が容易になるだけかもですが


■ビルド方法

前回はAndroid のフルビルドが必要とか来ましたが、ui automator 用のビルドオプションが有るようです。

ビルドは以下のように行うことになりそうです。


cd ${DROIDROOT}/
source ./build/envsetup.sh

make android_uiautomator
mmm frameworks/testing/uiautomator/samples/

■UI Automator の使い方(クラスの役割)

https://groups.google.com/forum/?fromgroups=#!search/UIAutomator/android-platform/KSranAzKUsI/0cmiYI6Pgj0J


UiCollection - Used to enumerate a container's UI elements for the purpose of verification.
UiDevice - Provides access to device wide states. Also provides methods to simulate pressing hardware buttons such as DPad or the soft buttons such as Home and Menu.
UiObject - UiObject is designed to be a representation of displayed UI element. This help tests define a single UiObject say for * an "OK" or tool-bar button and use it across many activities.
UiScrollable - Represents Scrollable widgets.
UiSelector - This class provides the mechanism for tests to describe the UI elements they intend to target.

                                                                                  • -

次回は、実際のテストの書き方あたりに手を伸ばしたいと考えています。