我无法使用操作栏图像移动到应用程序中的下一个屏幕
我是 Robotium 测试的新手。我遇到了一个问题:我们有发布一些主题的功能。我们的应用程序中没有移动到下一个屏幕的按钮,仅生成带有“下一步”选项的操作栏。 请问,您能帮我如何单击此“下一步”选项以移至下一个屏幕吗?
这是我的测试:
solo.clickOnView(solo.getView(R.id.part_tab_post));
solo.enterText(0, "Listing new from Julina");
solo.enterText(1, "description from Julina");
//solo.getView(R.id.actionbar_post); - 但这没有帮助
这是包含与操作栏相关的行的代码:
private void initActionBar() {
actionBarPostListing = (ActionBar) findViewById(R.id.actionbar_post);
actionBarPostListing.setTitle(R.string.post_listing);
actionBarPostListing.addAction(new ActionPostListingNext());
}
/** Action to next button on the Post a Listing actionbar.*/
private class ActionPostListingNext extends AbstractAction {
public ActionPostListingNext() {
super(R.drawable.btn_states_action_next);
}
I'm new in Robotium testing. And I encountered with a problem: we have the functionality to post some theme. We don't have buttons in the application to move to the next screen, only generated actionbar with Next option.
Please, can you help me how can I click on this Next option to move to the next screen?
Here is my test:
solo.clickOnView(solo.getView(R.id.part_tab_post));
solo.enterText(0, "Listing new from Julina");
solo.enterText(1, "description from Julina");
// solo.getView(R.id.actionbar_post); - but this doesn't help
Here is the code which includes lines related to actionbar:
private void initActionBar() {
actionBarPostListing = (ActionBar) findViewById(R.id.actionbar_post);
actionBarPostListing.setTitle(R.string.post_listing);
actionBarPostListing.addAction(new ActionPostListingNext());
}
/** Action to next button on the Post a Listing actionbar.*/
private class ActionPostListingNext extends AbstractAction {
public ActionPostListingNext() {
super(R.drawable.btn_states_action_next);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚也遇到了这个问题,我必须使用标准的android框架来让它像这样工作:
然后你可以使用robotium输入你的文本
I've just encounter this problem also and I had to use the standard android framework to get this to work like so:
Then you can enter your text with robotium