Uiautomator Input Chinese

Source: Internet
Author: User

has been in the English test environment, including the mobile phone is also in English, the app is also in English, involving less than the Chinese input method of things. But now I'm writing a Chinese app, so I need to enter Chinese. See the following online solutions:

Download Https://github.com/sumio/uiautomator-unicode-input-helper Source code

Install utf7ime and change the default IME
    • Import Utf7Ime/ directory into your Eclipse workspace. You can import by File -> Import... -> Existing Android Code Into Workspace .
    • Build Utf7Ime Project and install it on the Your android-powered device (or emulator) for UI testing.
    • Launch Settings App in the device.
    • Open Language & input .
    • Switch on the UTF7 IME for UI Testing checkbox belonging to KEYBOARD & INPUT METHODS category.
    • Tap Default belonging to KEYBOARD & INPUT METHODS category.
    • The change of the default IME to Utf7ime by selecting UTF7 IME for UI Testing .
Copy the helper library to your Uiautomator project

Copy helper-library/src/* to <your uiaotomator project>/src/ .

The main idea is to import the Utf7ime project into eclipse after the download, build the Android project, generate the utf7ime.apk, install it into the test machine, and set the phone language as "UTF7 IME for UI testing";

Copy the source code under helper-library/src/* to the/src/of your Uiautomator test project.

That's what I'm doing here, just wrapping UTF7IMEHELPER.E () in the Commonhelper.java file, and then calling:

Then you can type in Chinese.

But here's the problem: After entering Chinese, click Enter to perform the search, but there is no keyboard present under the current UTF7 IME for UI testing IME, so you cannot click the ENTER key.

In order to solve this problem, I think of the solution is: to input Chinese, the input method into the UTF7 IME for UI testing, after input, then the input method to change back, so that the keyboard bounced out, and then click Enter, so that you can achieve the search.

Then there is another problem, how to implement fast switching input method: http://www.cnblogs.com/yajing-zh/p/5125317.html

Uiautomator Input Chinese

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.