robotium之无name、ID仅有desc定位

场景如图:

没有name和ID,群里问了,也没人搭理我,自己试验了下,发现这个法子可用,直接贴代码:

    Activity act = solo.getCurrentActivity();
    int identifier = act.getResources().getIdentifier("More options", "content-desc", act.getPackageName());
    solo.clickOnImageButton(identifier);
原文地址:https://www.cnblogs.com/longronglang/p/6498516.html