Cant execute test via command line

Asked by Jon

Very new to Sikuli but I have managed to write some basic tests using GUI. I now would like to experiment running tests automatically via commmand line, ie DOS prompt via BATch script(s).

Using -r option nothing seems to execute. When I modify BAT file to just run below, it correctly starts Sikuli.

Sikuli-IDE

So why when simply adding "-r <filename>.sikuli does nothing appear to run or work. I have even moved *.sikuli into same DIR as where Sikuli is installed, ie Program Files\Sikuli X\

I saw another blog whereby I have updated .bat file since was issues running in windows.

I have also updated my %PATH% to include C:\Program Files\Sikuli X

I am running on XP.

Any help would be very much appreciated.

Jon

Question information

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

Did you make your tests to run in the unit test view of Sikuli IDE?

If yes, use the -t option together with Sikuli-IDE.bat

If you really want to further invest in testing using Sikuli: look faq 1804

BTW: do not put your Sikuli scripts into the Sikuli program folder. This is user stuff and has to be somewhere in your private folders.

On command line go to the folder where your .sikuli is saved and say
Sikuli-IDE.bat -t your-script.sikuli

Revision history for this message
Jon (jon-croft) said :
#2

Hi RaiMan,
  Unsure what you mean by making tests to run in unit test view.

All I have merely done so far is create a very simple script which opens IE, goes to a specific URL, and login. When I run the script from GUI all fine and dandy.

I have tried your command above but after executing pauses for a second and then it goes to new prompt.

I just found a -s option (print stderr errors), which when I execute shows me below in DOS window :-

[info] local: en_US.

But window just hangs and does nothing. Must be a config error of some sort.

Revision history for this message
j (j-the-k) said :
#3

I have experienced a problem in windows that I did not have with linux:
In windows, I had to run the script being in the directory of the test, whereas in linux it did not matter from which directory I executed the script.
An example:
This did NOT work on my windows:
C:\> C:\Programs\SikuliX\sikuli-ide.bat -r C:\someDirectory\myscript.sikuli
But this worked fine (changed into directory that contains the testfile):
C:\> cd someDirectory
C:\someDirectory\> C:\Programs\SikuliX\sikuli-ide.bat -r myscript.sikuli

I do not know if this is the same problem as you have, I just wanted to mention that on windows it depends where you call your script from, you should keept that in mind.

Revision history for this message
Jon (jon-croft) said :
#4

Thankyou very much j (j-the-k), working a treat now ;-). I will have to keep this in mind in future.