Well, i can launch slimerjs by specifying the path of the slimer.bat file : C:\bin\slimerjs\slimerjs.bat and then execute my file.
But if i modify casperjs file (in bin\ ) and modify the default exec for slimer :
'env_varname': 'SLIMERJS_EXECUTABLE',
'default_exec' : 'C:\bin\slimerjs\slimerjs.bat'
when i execute the casper command :
casperjs --engine=slimerjs test.js
It doesn't work, the path to slimerjs.bat seems to be ignored.
I tried this too : https://github.com/laurentj/slimerjs/blob/master/BUILD.md
But the slimerjs.exe alone isn't sufficient, i need to have application.ini and omni.ja in the current folder where i'm executing my tests, and i don't want to add some files in every folders.
What i want is just to execute slimerjs in casperjs with the engine property, whatever is the folder where i am, like in phantomjs so i need to set an absolute path (or relative path from root).
I don't want to be in the slimerjs.bat folder and specify the folder or js test i want to execute like that : casperjs test C:/bin/try/test.js --engine=slimerjs.
Here one similar issue : https://github.com/n1k0/casperjs/issues/591
Edit (thanks to Darren Cook for his answer) for more details :
set PATH=%PATH%;C:\\bin\\slimerjs
If i set a Windows PATH for slimer, when i execute casperjs test --engine=slimerjs test.js, i have this message :
But adding the two files in the test.js folder solves the problem.
So i think i have to modify the slimerjs bat file, to set the :callexec path from the slimerjs.bat folder, not the current test.js folder.
Here :
:callexec
if ["%HIDE_ERRORS%"]==[""] (
%SLIMERJSLAUNCHER% -app "%SLIMERDIR%application.ini" %PROFILE% -attach-console -no-remote %__SLIMER_ARGS%
) ELSE (
%SLIMERJSLAUNCHER% -app "%SLIMERDIR%application.ini" %PROFILE% -attach-console -no-remote %__SLIMER_ARGS% 2>NUL
)
with :
SET SLIMERDIR=%~dp0
The problem is that i'm not familiar with this syntax (batch file), it might be already correct and the problem doesn't come from here.
But what i observe is that it seems to look for application.ini and omni.ja from the current folder, not the slimerjs folder.
PS : second idea doesn't work but now i know it comes from slimerjs.
EDIT:
REM % ~ d[rive] p[ath] 0[script name] is the absolute path to this bat file, without quotes, always.
REM ~ strips quotes from the argument
So the path seems to be good, and in fact it works with slimerjs alone : slimerjs test.js works great and it doesn't ask for application.ini. So it's the combination of the two which doesn't work.
When you launch it with the casper command, the path is different (current folder) , and application.ini isn't recognized any more.