android - (Robotium) Action bar up/home button click -
i use robotium library junit test android application. wrote tests works well. when try write test native actionbar's up/home button click, failed.
my test code simple:
solo solo = new solo(getinstrumentation(), getactivity()); ... solo.clickonactionbarhomebutton(); // expected click up/home button of actionbar
i expected above code click up/home button of native actionbar, failed, nothing happening on action bar. why??
p.s. using android 4.2.1 device.
i use function:
public void clickonactionbarhomebutton(solo solo) { view homeview = solo.getview(build.version.sdk_int >= build.version_codes.honeycomb ? android.r.id.home : r.id.home); solo.clickonview(homeview); }
maybe it's not perfect decision, works.
Comments
Post a Comment