简体   繁体   English

如何在Android上使用Robotium测试从列表中删除项目

[英]How to Test removing item from the list using Robotium on Android

I have a list of items in my app. 我的应用程式中有项目清单。 I would like to write a test case to remove an item from the list onLongClick. 我想编写一个测试用例,从onLongClick列表中删除一个项目。 I used robotium method: 我使用机器人方法:

clickLongInList()

but it's not working properly how can I test removing items in a different way? 但是它不能正常工作,如何测试以其他方式删除项目?

When you Long Click on item inside List, 当您长按列表中的项目时,

i suppose that "there is menu exists that have option for delete" 我想“存在菜单中有删除选项”

if this menu exists then clickLongOnText(); 如果该菜单存在,则单击LongOnText(); will open menu [which contains delete option] and clickOnText("Delete"); 将打开菜单[包含删除选项]并单击OnText(“ Delete”); this will delete your item from list. 这将从列表中删除您的项目。

i hope this will help you. 我希望这能帮到您。 Thanks. 谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM