How can i use id to do action on an object of an android using Robotium tool?

北城余情 提交于 2019-12-25 11:54:56

问题


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


回答1:


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




回答2:


Method clickOnImageButton takes parameter as index, not id, so you should use method, which Renas has mentioned.



来源:https://stackoverflow.com/questions/19424408/how-can-i-use-id-to-do-action-on-an-object-of-an-android-using-robotium-tool

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!