How to send chinese letters in sikuli to launch a app?

Asked by balu

Hi,

    I am trying to automate a "chinese" android app through a emulator. In emulator i need to type "优酷" characters. Then that app will be Launched.

   If I use the above chinese characters in Sikuli,Its throws following error:

C:\RFW>jybot.bat android_apps_test_suite_Phase-5.robot
[ ERROR ] Error in file 'C:\RFW\android_apps_test_suite_Phase-5.robot': Importin
g test library 'calc.Calculator' failed: SyntaxError: Non-ASCII character in fil
e 'C:\RFW\andrapps.sikuli\calc.py', but no encoding declared; see http://www.pyt
hon.org/peps/pep-0263.html for details
Traceback (most recent call last):
  None
PYTHONPATH:
  C:\RFW\andrapps.sikuli
  C:\RFW\robot\libraries
  C:\RFW
  C:\RFW\sikulixapi.jar\Lib
  C:\RFW\Lib
  C:\RFW\jython-standalone-2.7-b3.jar\Lib
  __classpath__
  __pyclasspath__/
  .
CLASSPATH:
  C:\RFW\jython-standalone-2.7-b3.jar
  C:\RFW\sikulixapi.jar
==============================================================================
android apps test suite Phase-5
==============================================================================
testcase1 | FAIL |
No keyword with name 'startBluestack' found.
------------------------------------------------------------------------------
android apps test suite Phase-5 | FAIL |
1 critical test, 0 passed, 1 failed
1 test total, 0 passed, 1 failed
==============================================================================
Output: C:\RFW\output.xml
Log: C:\RFW\log.html
Report: C:\RFW\report.html

C:\RFW>

Please guide me to fix this issue.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

according to the mentioned pep, you have to add the line
# -*- coding: utf-8 -*-

as first line to your script
(this is done automatically, when the script is run with SikuliX, but you are using RFW/Jython to do that)

but type will not work anyway:
see faq 933

Revision history for this message
balu (balu-networks7) said :
#2

Hi RaiMan,

     Thanks for your answer.

     Now I am not getting this PEP related error after adding "# -*- coding: utf-8 -*-" line at first line of my script.

     But still paste() is not working. Following is my code.

 def clickSearchtypeYouku(self):
  find("3_search_apps.png")
  click("3_search_apps.png")
  paste("优酷")

  If I try to do this manually , its working with "ctrl v" keys. (I am copying "优酷" and pasting with "ctrl v")

  Could you please help me to resolve this issue.

Thanks.
Balu.

Revision history for this message
Best RaiMan (raimund-hocke) said :
#3
Revision history for this message
balu (balu-networks7) said :
#4

Thanks RaiMan, that solved my question.