blog已经转移至github,大家请访问 http://qaseven.github.io/
01
package
com.example.testapk;
02
03
import
android.test.ActivityInstrumentationTestCase2;
04
05
com.jayway.android.robotium.solo.Solo;
06
07
@SuppressWarnings
({
"unchecked"
,
"rawtypes"
})
08
public
class
Test
extends
ActivityInstrumentationTestCase2 {
09
private
static
final
String LAUNCHER_ACTIVITY_FULL_CLASSNAME =
"com.calculator.Main"
;
10
Class launcherActivityClass;
11
{
12
try
13
launcherActivityClass = Class
14
.forName(LAUNCHER_ACTIVITY_FULL_CLASSNAME);
15
}
catch
(ClassNotFoundException e) {
16
throw
new
RuntimeException(e);
17
18
19
20
Test()
throws
ClassNotFoundException {
21
super
(launcherActivityClass);
22
23
24
Solo solo;
25
26
@Override
27
protected
void
setUp()
Exception {
28
solo =
Solo(getInstrumentation(), getActivity());
29
30
31
testDisplayBlackBox() {
32
solo.enterText(
0
"10"
);
33
1
"20"
34
solo.clickOnButton(
"Multiply"
35
assertTrue(solo.searchText(
"200"
));
36
37
38
39
tearDown()
40
solo.finishOpenedActivities();
41
42
posted on 2014-05-15 21:16 顺其自然EVO 阅读(2341) 评论(1) 编辑 收藏 所属分类: android
有些地方将的不详细啊,能具体说明一下instrumentation配置吗 回复 更多评论
Powered by: BlogJava Copyright © 顺其自然EVO