---
title: "[Android]robotium typeText与enterText区别"
author: "MyEyeOfJava"
date: "2014-11-21T17:17:12Z"
tags: []
categories: ["操作系统"]
slug: "android-robotium-typetext-entertext"
draft: false
lastmod: "2014-11-21T17:17:12Z"
id: 2159005
url: "https://myeyeofjava.iteye.com/blog/2159005"
---

solo.typeText和solo.enterText方法都可以对EditeText进行测试，达到的测试目的是一样的。存在几点不同：

1、实现上，typeText方法是robotium框架调用系统Instrumentation类里面的sendStringSync方法来实现的；enterText是调用TextView里面setText方法来实现的。

2、显示上，typeText在测试过程中能看到输入的痕迹；enterText则没有输入痕迹。

so 使用typeText的时候没办法输入中文。

 

附件是一个测试工程。