如何使用 id 使用 Robotium 工具对 android 的对象执行操作? [英] How can i use id to do action on an object of an android using Robotium tool?

查看:43
本文介绍了如何使用 id 使用 Robotium 工具对 android 的对象执行操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用 id 在 android 应用程序中单击对象,但是当我输入 solo.clickOnImageButton(R.id.action_menu_search);它显示错误,action_menu_search 无法解析或不是字段.我如何使用对象的 id 来点击它.

I tried to use id to click on the object in an android application but when i enter solo.clickOnImageButton(R.id.action_menu_search); It is showing an error, that action_menu_search cannot be resolved or not a field. How can i use the id of an object to click on the same.

先谢谢你,带着敬意,大卫·盖勒

Thank you in advance, With regards, David Gayler

推荐答案

Use solo.clickOnView(solo.getView(int id));

Use solo.clickOnView(solo.getView(int id));

这篇关于如何使用 id 使用 Robotium 工具对 android 的对象执行操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆