Remark :
1, utf7ime official website download need to increase the modification part of the file, so attached address: http://download.csdn.net/detail/victoria_vicky/8799851, can be directly imported into eclipse use
2, src:http://download.csdn.net/detail/victoria_vicky/8799973
3, the future may be used
First, install Input method
1. Download Utf7ime.rar, unzip to local folder
2. Import to eclipse:file->import->general->existing Projects into Workspace->next->select Root directory- >browse utf7ime decompression address before selecting->finish
3. Eclipse: Right-click Utf7ime Project->run as->android application, install to local phone
4, phone settings (in Xiaomi 2S for example): Settings, language and input method, keyboard and IME, will be modified by default to the UTF7 IME for UI testing
Second, the test project to add the corresponding code
1. Copy all the files in SRC to the test project SRC and import them into the specific test project as shown in
2, the following is a small example of my use of writing
PackageCom.beixun.test;importJava.io.ioexception;importJp.jun_nama.test.utf7ime.helper.Utf7ImeHelper; importAndroid.os.remoteexception;importCom.android.uiautomator.core.uidevice;importCom.android.uiautomator.core.uiobject;importCom.android.uiautomator.core.uiobjectnotfoundexception;importCom.android.uiautomator.core.uiselector;importCom.android.uiautomator.testrunner.uiautomatortestcase;public class Test extendsuiautomatortestcase {//input userName and Password,then login the APP public void test () throwsInterruptedexception, RemoteException, uiobjectnotfoundexception{Findandopenapp (); LoginAPP (UTF7IMEHELPER.E ("Hello") , UTF7IMEHELPER.E ("111111")); }//open Beixun APP private void Findandopenapp () throwsUiobjectnotfoundexception, Interruptedexception, remoteexception{uidevice device=Getuidevice (); if (!Device.isscreenon ()) {//wake up screenDevice.wakeup (); Device.isscreenon (); Asserttrue ("screen can not wake up", Device.isscreenon ()); Unlock screen Getuidevice (). Swipe (532, 1870, 555, 402,5); }//press on Home buttonGetuidevice (). Presshome (); Open Beixun App Try{runtime.getruntime (). EXEC ("AM start-n com.luyankeji.beixun/. Loginactivity "); } catch(IOException e) {//TODO auto-generated catch blockE.printstacktrace (); }}//login Beixun APP private void Loginapp (String username,string Password) throwsUiobjectnotfoundexception, interruptedexception{//input userName UiObject etusername=new UiObject (New Uiselector (). ClassName ("Android.widget.EditText"). Text ("Please enter your account or mobile number"))); Assertequals ("Please enter account or mobile number", Etusername.gettext ()); Etusername.click (); Etusername.cleartextfield (); Etusername.settext (UserName); Thread.Sleep,//input password UiObject ll4=new UiObject (New Uiselector (). ClassName (" Android.widget.LinearLayout "). Index (3)); UiObject Etpassword=ll4.getchild (New Uiselector () className ("Android.widget.EditText"); Asserttrue (" Etpassword can not been found ", etpassword.exists ()); Etpassword.click (); Etpassword.cleartextfield (); Etpassword.settext (Password); Thread.Sleep (+);//click on login button UiObject btloginbutton=new UiObject (New Uiselector (). ClassName (" Android.widget.Button "). Text (" login ")); Assertequals ("Landing", Btloginbutton.gettext ()); Btloginbutton.clickandwaitfornewwindow (); Thread.Sleep (+); System.out.println ("Login beixunapp Success"); }
3, add the principle of knowledge
1, in Uiautomator, **.settext ("* *"), usually used to fill the text, but SetText ("") can only accept ASCII code;
2, Utf7ime can convert the input Unicode encoded string into ASCII code, settext accept ASCII code and then through Utf7ime this input method to convert to Unicode code output;
3. Unicode is a character encoding scheme developed by international organizations that can accommodate all the words and symbols in the world.
"Uiautomator" Input Chinese (Input method installation + test code)