Unable to run unit test script from command line.

Asked by Stephen

Hello,

I have been trying to run a unit test script I've built in Sikuli using the command line. I've also tried to create a bat file to do the same thing but have failed.

I've read the documentation on running from the command line but nothing I have tried works. I'm running Windows XP and have tried a number of combinations including:

"C:\Program Files\Sikuli X\Sikuli-IDE.bat" -r -t Simple.sikuli
"C:\Program Files\Sikuli X\Sikuli-IDE.bat" -t Simple.sikuli
"C:\Program Files\Sikuli X\Sikuli-IDE.bat" -r Simple.sikuli -t

The error I get back is:

[error] Missing argument for option: r
Exception in thread "main" java.lang.NullPointerException
at org.sikuli.ide.SikuliIDE.main<Sikuli.IDE.java:920>

I have Sikuli rc3 installed. Is there something I am missing?

Thanks.

Question information

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

If it is a unit test script, that runs in the unit test view of the IDE, on command line you have to use:

"C:\Program Files\Sikuli X\Sikuli-IDE.bat" -t Simple.sikuli

being in the directory, where Simple.sikuli lives.

If it does not work, have a look at faq 1766.

Revision history for this message
Stephen (stlennon21) said :
#2

I've still been unable to run the unit test script from the command line.

Does the command line work when the Sikuli script is a unit test? I do not have Eclipse or junit installed on my machine. Is that an issue?

Thanks.

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

You may send me your stuff zipped together in one file to my mail at https://launchpad.net/~raimund-hocke
On command line say "set", which outputs your environment settings. Copy and paste this into the mail.
I will have a look at it.

Revision history for this message
Stephen (stlennon21) said :
#4

Here you go. I hope it is helpful.

C:\>set
ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\stlennon\Application Data
ASMROOT=C:\TNGSD\SD
CAI_CAFT=C:\Program Files\CA\SC\CAM
CAI_MSQ=C:\Program Files\CA\SC\CAM
CAI_MSQ_NOWV=y
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=R
ComSpec=C:\WINDOWS\system32\cmd.exe
CSAM_LOGGER_CONF=C:\Program Files\CA\SC\Csam\SockAdapter\\cfg\logger.cfg
CSAM_SOCKADAPTER=C:\Program Files\CA\SC\Csam\SockAdapter\
devmgr_show_nonpresent_devices=1
ETPKIHOME=C:\PROGRA~1\CA\SC\\ETPKI
FP_NO_HOST_CHECK=NO
GCS_LETTER_PATH=C:\GCSApp\Docs\
HOMEDRIVE=O:
HOMEPATH=\
HOMESHARE=\\R\homedir\stlennon
II_AIM_LETTERS=F:\SOFTWARE\AIM\STDLTR
II_AIM_TEMPLATES=F:\SOFTWARE\AIM\TEMPLATE
II_System=C:\Oping
Include=c:\oping\ingres\files;c:\Program files\microsoft visual studio\VC98\incl
ude
JAVA_EXE="java"
LIB=c:\oping\ingres\lib;c:\oping\ingres\lib;c:\program files\microsoft visual st
udio\VC98\lib
Location=D
LOGONSERVER=\\D
NUMBER_OF_PROCESSORS=2
OS=Windows_NT
Path=C:\PROGRA~1\CA\SC\\ETPKI\lib;C:\Oping\ingres\bin;C:\Oping\ingres\utility;C:
\Program Files\CA\DCS\CAWIN\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\
Wbem;C:\CA_APPSW;C:\TNGSD\BIN;C:\Oping;C:\oping\ingres\bin;c:\Program Files\Inte
l\DMIX;C:\Program Files\CA\DSM\bin;C:\PROGRA~1\CA\SC\CAM\bin;c:\itpapp\dll;c:\pr
ogram files\microsoft visual studio\vc98\bin;c:\program files\microsoft visual s
tudio\common\msdev98\Bin;c:\program files\microsoft visual studio\common\tools\w
innt;c:\program files\microsoft visual studio\common\tools;C:\Program Files\CA\S
C\Csam\SockAdapter\\bin;C:\Program Files\Sikuli X\libs;C:\Program Files\Java\jre
6\\bin;C:\Program Files\Sikuli X\libs;C:\Program Files\Sikuli X\libs;C:\Program
Files\Sikuli X\libs;c:\Program Files\Sikuli X\libs
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 2, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0f02
ProgramFiles=C:\Program Files
PROMPT=$P$G
R_SHLIB_LD_LIBRARY_PATH=C:\PROGRA~1\CA\SC\\ETPKI\lib
SDROOT=C:\Program Files\CA\DSM\SD
SESSIONNAME=Console
SIKULI_HOME=C:\Program Files\Sikuli X\
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\DOCUME~1\stlennon\LOCALS~1\Temp
Term_Ingres=IBMPC
TMP=C:\DOCUME~1\stlennon\LOCALS~1\Temp
TUXDIR=C:\tux_ws
UserDN=stlennon,OU=ITSer,OU=ICTL,OU=R Users,DC=RDomain,DC=ie
USERDNSDOMAIN=RDOMAIN.IE
USERDOMAIN=RDOMAIN
USERNAME=stlennon
USERPROFILE=C:\Documents and Settings\stlennon
UserUnit=ICTL_ITSer
windir=C:\WINDOWS

C:\>

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

Besides the fact, that c:\Program Files\Sikuli X\libs is in the path more than once and C:\Program Files\Java\jre6\\bin twice (which means, that you did at least 2 installs, and the first one was not uninstalled usin Windows Software uninstall.)

So your environment looks ok.

So how does your script look like?

What have you tried?

What are the symptoms?

Revision history for this message
Stephen (stlennon21) said :
#6

Hi,

I have just tried to run my script from the command line and it has now worked!!

I am using the same command in the command line as I was before. This time though I tried a different script. I guess I had something in the other script that was wrong. Although it did run in the Sikuli IDE.

"C:\Program Files\Sikuli X\Sikuli-IDE.bat" -t SampleFour.sikuli

Thanks for your help.