jybot no more working after using Sikuli IDE

Asked by Daniel

Hi there,

I'm trying to create a simple test case using Sikulix and Robot Framework. My issue is, that any time I start the Sikuli IDE, my jybot.bat won't execute my test cases anymore.

My set up is the following:
- sikulix-1.1.0 (installed in C:\Apps\sikulix-1.1.0 using sikulixsetup-1.1.0.jar, options 1 and 2 were chosen)
- jython2.7.0 (installed in C:\Apps\jython2.7.0, using jython-installer-2.7.0.jar, added .\bin folder to user's PATH env. var.)
- robotframework-2.9.2 (downloaded and extracted tar.gz, installed by running "jython setup.py install")

I have then created the following Sikuli script, saved as a directory "simple.sikuli".

from sikuli import *

class Application():

    def foo(self):
        click("start_menu_bt.png")

if __name__ == "__main__":
 app = Application()
 app.foo()

Within that directory, I've also created a "robot.txt" that looks like the following:

***Settings***
Library simple.Application WITH NAME Application

***Test Cases***
Test Case 1
 Foo

Now, when I run the script using jybot from the command line, everything is fine:

C:\Dev\simple.sikuli>jybottest.bat robot.txt
==============================================================================
Robot
==============================================================================
Test Case 1 | PASS |
------------------------------------------------------------------------------
Robot | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
Output: C:\Dev\simple.sikuli\results\output.xml
Log: C:\Dev\simple.sikuli\results\log.html
Report: C:\Dev\simple.sikuli\results\report.html

However, if I now start the Sikulix IDE and run exactly the same command again, I'll get the following:

C:\Dev\simple.sikuli>jybottest.bat robot.txt

C:\Dev\simple.sikuli>

So basically nothing appears to happen. By doing some trial and error, I've noticed that it has somehow to do with the sikuli import statement at the beginning of the script:
from sikuli import *

If I remove this line, this will be the output, which makes absolutely sense of course:

C:\Dev\simple.sikuli>jybottest.bat robot.txt
==============================================================================
Robot
==============================================================================
Test Case 1 | FAIL |
NameError: global name 'click' is not defined
------------------------------------------------------------------------------
Robot | FAIL |
1 critical test, 0 passed, 1 failed
1 test total, 0 passed, 1 failed
==============================================================================
Output: C:\Dev\simple.sikuli\results\output.xml
Log: C:\Dev\simple.sikuli\results\log.html
Report: C:\Dev\simple.sikuli\results\report.html

If I add the line again, the problem occurs again and I won't have any output.
As a workaround, I can run sikulixsetup-1.1.0.jar again and simply install it with option 2 (Pack 2) active only. After this, I can run my script again using jybot. As soon as I start the Sikulix IDE again however, the problem occurs again.

As this is pretty annoying, I thought someone might have a hint what could be causing this issue. Apparently there is some kind of initialization done when the IDE is started, which messes around with my setup. But I'm kind of lost where to start digging.

Thanks in advance, I appreciate any help!

-- Daniel

Question information

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

I do not support these special situations any more with versions prior to 1.1.1

So give version 1.1.1 a try with your setup.

Or even switch to the now built-in support for RFW:
http://sikulix-2014.readthedocs.io/en/latest/scenarios.html#using-robotframework

Revision history for this message
Daniel (postgotmail) said :
#2

Hi Raimund,

Thanks for your quick response!

Sorry, I wasn't aware that I'm not using the latest version. I've just upgraded to version 1.1.1 using the following nightly build:
sikulixsetup-1.1.1-20160719.184310-68-forsetup.jar

The problem however remains the same. I've tried using the built-in RFW like you suggested, but I'm encountering issues here as well. Running the sample script from the docs within the IDE throws the following error:

[error] JythonSupport: exec: returns: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Apps\sikulix-1.1.1\sikulix.jar\Lib\sikuli\SikuliImporter.py", line 45, in load_module
File "C:\Apps\sikulix-1.1.1\sikulix.jar\Lib\sikuli\SikuliImporter.py", line 34, in _load_module
File "C:\Dev\robot.sikuli\robot.py", line 1, in <module>
runScript("""
NameError: !!WHILE IMPORTING!! name 'runScript' is not defined

[error] JythonSupport: exec: returns: Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'robot' is not defined

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

You should not name your stuff robot.py, because this overwrites the RFW module.

Revision history for this message
Daniel (postgotmail) said :
#4

D'oh! Forgot to remove/clean my %appdata%\Sikulix directory before installing v1.1.1.
After that, everything is fine now. Thanks for your support Raimund!

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

LOL, I did not dare, to ask about that ;-)