Robot framework and sikuli

Asked by Ben

Hi,
I'm a beginner using sikuli and i found a lot of people talking about robotframework. For my case i want to know if it's possible to create a library with all the sikuli commands so after i don't have to write a sikuli script for all my tests because i have a lot of test to write. i also found in github a SikuliLibary that can be automatically downloaded using the pip command so far when i try to import it, it doesn't work.

So please if anyone can advise me about this possibility to have a library for sikuli commands.

Question information

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

are you talking about this?
https://github.com/rainmanwy/robotframework-SikuliLibrary

if yes, looks promising.

What are the problems you are getting in detail?

Revision history for this message
Ben (boukhari-benaissa) said :
#2

Hi RaiMan,
Yes it's really that library that i'm talking about the problems in detail are:

Actually that was my first problem then i upgraded Robotframework and ride 'rainmanwy' told me that
--------------------------------------------------------------------------------
Traceback (most recent call last):
Importing test library 'SikuliLibrary' failed: ImportError: No module named Process
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\robotide\lib\robot\utils\importer.py", line 143, in _import
    return __import__(name, fromlist=fromlist)
  File "C:\Python27\lib\site-packages\SikuliLibrary\__init__.py", line 7, in <module>
    from sikuli import SikuliLibrary
  File "C:\Python27\lib\site-packages\SikuliLibrary\sikuli.py", line 17, in <module>
    from robot.libraries.Process import Process
PYTHONPATH:
  C:\Python27\lib\site-packages\robot\libraries
  C:\Python27\Scripts
  C:\Python27\lib\site-packages\setuptools-20.6.7-py2.7.egg
  C:\Python27\scripts
  C:\Python27\Lib\site-packages\SikuliLibrary
  C:\windows\system32\python27.zip
  C:\Python27\DLLs
  C:\Python27\lib
  C:\Python27\lib\plat-win
  C:\Python27\lib\lib-tk
  C:\Python27
  C:\Python27\lib\site-packages
  C:\Python27\lib\site-packages\wx-2.8-msw-unicode
  C:\Python27\lib\site-packages\robotide\spec
  .
  File "C:\Python27\lib\site-packages\robotide\spec\librarymanager.py", line 81, in _fetch_keywords
    return get_import_result(path, library_args)
  File "C:\Python27\lib\site-packages\robotide\spec\libraryfetcher.py", line 20, in get_import_result
    lib = robotapi.TestLibrary(path, args)
  File "C:\Python27\lib\site-packages\robotide\lib\robot\running\testlibraries.py", line 46, in TestLibrary
    return_source=True)
  File "C:\Python27\lib\site-packages\robotide\lib\robot\utils\importer.py", line 67, in import_class_or_module
    self._raise_import_failed(name, err)
  File "C:\Python27\lib\site-packages\robotide\lib\robot\utils\importer.py", line 103, in _raise_import_failed
    raise DataError('\n'.join(msg))
------------------------------------------------------------------------------------------

And that's the state now :

------------------------------------------------------------------------------------------
20160412 09:36:36.708 [WARN]: Importing test library "BuiltIn" failed

Traceback (most recent call last):
Importing test library 'robot.libraries.BuiltIn' failed: ImportError: cannot import name CommandLineMonitor
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\robotide\lib\robot\utils\importer.py", line 143, in _import
    return __import__(name, fromlist=fromlist)
  File "C:\Python27\lib\site-packages\robot\__init__.py", line 44, in <module>
    from output import Output, CommandLineMonitor, LOGGER
PYTHONPATH:
  C:\Python27\lib\site-packages
  C:\Python27\Scripts
  C:\Python27\lib\site-packages\setuptools-20.6.7-py2.7.egg
  C:\Python27\scripts
  C:\Python27\Lib\site-packages\SikuliLibrary
  C:\Python27\Lib\site-packages\robotframework_SikuliLibrary-0.1.4-py2.7.egg-info
  C:\windows\system32\python27.zip
  C:\Python27\DLLs
  C:\Python27\lib
  C:\Python27\lib\plat-win
  C:\Python27\lib\lib-tk
  C:\Python27
  C:\Python27\lib\site-packages\wx-2.8-msw-unicode
  C:\Python27\lib\site-packages\robotide\spec
  File "C:\Python27\lib\site-packages\robotide\spec\librarymanager.py", line 81, in _fetch_keywords
    return get_import_result(path, library_args)
  File "C:\Python27\lib\site-packages\robotide\spec\libraryfetcher.py", line 20, in get_import_result
    lib = robotapi.TestLibrary(path, args)
  File "C:\Python27\lib\site-packages\robotide\lib\robot\running\testlibraries.py", line 46, in TestLibrary
    return_source=True)
  File "C:\Python27\lib\site-packages\robotide\lib\robot\utils\importer.py", line 67, in import_class_or_module
    self._raise_import_failed(name, err)
  File "C:\Python27\lib\site-packages\robotide\lib\robot\utils\importer.py", line 103, in _raise_import_failed
    raise DataError('\n'.join(msg))
----------------------------------------------------------------------------------------------------------------------------------

I Also have this now every time i open ride :

20160412 09:36:36.818 [INFO]: <h3>
  Robot Framework installation not found!
</h3>
<p>Starting from RIDE 1.5, Robot Framework standard libraries are no longer included in RIDE installation. In order to have intellisense features work with Robot Framework standard libraries, it must be installed separately. See the <a href="http://robotframework.org">official website</a> for installation instructions.</p>

20160412 09:36:36.833 [INFO]: Started RIDE 1.5.2.1 using python version 2.7.11 with wx version 2.8.12.1 in win32.

THANK YOU RaiMan.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

Since you are using RIDE, I suppose you are running in C-Python context (2.7).

But SikuliLibrary is written for use in a Sikuli context, which in turn cannot be used with Python.

The used Python interpreter with SikuliX in any case must be Jython (either the one bundled with SikuliX or seperately installed).

So you have to redesign your development and scriptrun environment to be useable with SikuliX.

Can you help with this problem?

Provide an answer of your own, or ask Ben for more information if necessary.

To post a message you must log in.