lavender_bj1 发表于 2011-8-1 15:02:57

[Android Robotium]挂断电话用什么函数?

Android2.2,2.3。
public void test_callout() throws Exception {
      solo.clickOnText("Phone");
      solo.enterText(0, "10086");
      solo.sendKey(9);//Call   
      solo.sleep(10000);//wait 10s
      solo.xxx
}
solo.xxx尝试了以下都不行。怎么办?
solo.clickOnText("End"); //The text: End is not found!
solo.clickOnButton("End");//The text: End is not found!
solo.clickOnImageButton(1);//There is no ImageButton with index 1
solo.clickOnImage(1);//There is no ImageView with index 1
solo.clickOnScreen(100,100);//Click can not be completed! Something is in the way e.g. the keyboard.
solo.clickOnMenuItem("End call");//Can not complete action!
solo.sendKey(10);//EndCall//Can not complete action!
solo.goBack();//没反应
solo.goBackToActivity("DialtactsActivity");//没反应
System.out.println("Current view is "+solo.getViews().get(0).toString());//java.lang.NullPointerException
solo.clickOnView(solo.getViews().get(0));//View is null and can therefore not be clicked!
System.out.println("Current text is "+solo.getText(0).toString());//No TextView with index 0 is found!

xiang0522 发表于 2011-8-2 11:10:24

不懂,帮顶。

yacey 发表于 2011-8-11 16:46:09

我也是初学阶段,帮不到什么忙,给顶一下
页: [1]
查看完整版本: [Android Robotium]挂断电话用什么函数?