UIAutomator-如何单击菜单项 [英] UIAutomator - How to click the menu item

查看:160
本文介绍了UIAutomator-如何单击菜单项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用UI Automator自动转到android手机中的设置,并使用"getUiDevice().pressMenu();"单击了菜单.及其带有3个子菜单项的打开菜单,我想通过使用名称或索引或ID单击第二个菜单,请帮助如何在Android UIAutomator中单击子菜单?

I have automated go to setting in android phone using UI Automator and i clicked the menu using "getUiDevice().pressMenu();" and its opened menu with 3 sub menu item and i want to click the second menu by using name or index or id , please help how to click the sub menu in Android UIAutomator ?

推荐答案

使用clazz方法有效

Use clazz method is working

 UiObject2 item = mDevice.findObject(By.clazz("android.widget.ListView"));

这篇关于UIAutomator-如何单击菜单项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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