Tset-Noitamotua / Sikuli-and-Robot-Framework-Integration

Windows 7 / 8.1 + Sikuli 1.1.0 compatible version of source for the great tuturial from Mike´s blog
http://blog.mykhailo.com/2011/02/how-to-sikuli-and-robot-framework.html
10 stars 5 forks source link

Why recommending 32-Bit??? --- a running setup on Windows 8 + Java 8 64-Bit #8

Closed RaiMan closed 9 years ago

RaiMan commented 9 years ago

I do not see any need to restrict to 32-Bit.

I have a valid setup running on Windows 8.1 with

  1. Java 8 64-Bit
  2. Python 2.7 (used the 64-Bit installer)
  3. RobotFrameWork 2.8.7 (installed in Python using the 64-Bit installer)
  4. Jython 2.7b3 (installed using the install jar) (but the standalone jar might be used as well)
  5. sikulixapi.jar (version 1.1.0)

when run in the Jython environment (using SikuliX features), the bitness does not matter, since RFW and Jython run on the same JVM and sikulixapi.jar uses the fitting libraries according on the bitness of the used Java.

I think it is a good choice, to use Python and RFW installed in Python in the first place, no matter wether you plan to work with Sikuli features or not, since RFW is basically developed with C-Python and some features might not be available to be run with Jython.

According to this I have chosen the above setup to run a RFW test using a SikuliX custom library (like calc.sikuli here). This setup, should work on all systems (Windows, Mac and Linux):

Java classpath (environment CLASSPATH= ) should contain pointers to

sikulixapi.jar
jython.jar

Jython path (environment JYTHONPATH= ) should contain a pointer to

sikulixapi.jar/Lib

with these provisions this would run a RFW test (all on one line):

java org.python.util.jython 
     <PythonInstallation>/Lib/site-packages/robot/run.py 
     --pythonpath <someLibrary.sikuli> 
     <someRFWtest.txt>

one might add any valid -X/-D Java parameters and any valid -x/--xyz RFW parameters.

this is the command file I am currently using on Windows to run this example:

@echo off
setlocal
set HERE=%~dp0
set ROBOT_HOME=c:\Python27\Lib\site-packages\
set JYTHON_HOME=c:\jython27\
set SIKULIX_HOME=C:\Users\RaiMan\Documents\GitHub\SikuliX-2014\Setup\target\Setup\

set CLASSPATH=%JYTHON_HOME%jython.jar;%SIKULIX_HOME%sikulixapi.jar;%CLASSPATH%
set JYTHONPATH=%SIKULIX_HOME%sikulixapi.jar\Lib

java org.python.util.jython ^
        %ROBOT_HOME%robot\run.py ^
        --pythonpath=%HERE%calc.sikuli ^
        %*
endlocal
Tset-Noitamotua commented 9 years ago

When I first started experimenting with the Robot Framework and Jython I had some isssues with 64-bit ... of course that could have been because of my inexperience or because I mixed up 64-bit with 32-bit.

I will remove the recommendation. But that one should avoid mixing 32 and 64 bit it still true, isn´t it?

RaiMan commented 9 years ago

This is generally only relevant on Windows and in most cases only with respect to the installers and/or with Python, that has native libraries (hence it cannot be used with Java and we have Jython for that).

So if we talk about the chain Java - Jython (+ SikuliX) - RobotFramework, there can never be a mix of bitness, since only the used Java version is either 32 or 64 Bit. For Jython and RFW this does not matter and SikuliX version 1.1.0+ on the fly always uses the library set corresponding to the used Java version.

So talking about bitness at all on this level of evaluation is more confusing, than helpful.