zoukankan      html  css  js  c++  java
  • Robotium学习笔记一

    一、 重签名问题
    1、从手机Pull所需的apk通过压缩工具删除META-INF目录
    2、通过以下命令行进行签名
    >jarsigner -keystore "C:Documents and Settingsey.androiddebug.keystore" -storepass android -keypass android D:Mms.apk androiddebugkey
    >zipalign 4 D:Mms.apk D:debugMms.apk
     
    3、Push签名后的文件到手机上
    二、只有APK程序的测试
    Demo如下
    package com.phone.test;


    import com.jayway.android.robotium.solo.Solo;


    import android.annotation.SuppressLint;
    import android.test.ActivityInstrumentationTestCase2;


    public class CallTest extends ActivityInstrumentationTestCase2 {


    private static final String LAUNCHER_ACTIVITY_FULL_CLASSNAME = "com.android.mms.ui.ConversationList";
    private static String PACKAGENAME = "com.android.mms";





    private static Class<?> launcherActivityClass;
    static {
    try {
    launcherActivityClass = Class
    .forName(LAUNCHER_ACTIVITY_FULL_CLASSNAME);
    } catch (ClassNotFoundException e) {
    throw new RuntimeException(e);
    }
    }


    @SuppressWarnings("unchecked")
    public CallTest() throws ClassNotFoundException {
    super(PACKAGENAME,launcherActivityClass);
    }


    private Solo solo;


    @Override
    protected void setUp() throws Exception {
    solo = new Solo(getInstrumentation(), getActivity());
    }


    public void testSms() {
    solo.clickOnText("新信息");
    solo.typeText(0, "10086");
    solo.sleep(2000);
    solo.clickOnEditText(1);
    solo.sleep(500);
    solo.goBack();
    solo.typeText(1, "test");
    solo.sleep(2000);
    solo.typeText(1, "test");
    solo.sleep(1000);
    solo.clickOnButton("发送");
    solo.sleep(2000);
    }


    @Override
    public void tearDown() throws Exception {
    solo.finishOpenedActivities();


    }


    }
    存在以下问题
     TypeText无法输入内容,正在查找解决办法。

  • 相关阅读:
    任务十六:零基础JavaScript编码(四)
    任务十五:零基础JavaScript编码(三)
    JavaScript中innerHTML与innerText,createTextNode的区别
    JavaScript中的appendChild()方法
    任务十四:零基础JavaScript编码(二)
    JavaScript中sort()方法
    JavaScript中filter()方法
    Mongodb----整理
    爬虫----破解极验滑动验证码
    Flask----目录结构
  • 原文地址:https://www.cnblogs.com/riskyer/p/3359834.html
Copyright © 2011-2022 走看看