18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Call Java Code from Sahi script
Call java code from Sahi scripts (Steps followed) :
1. Created folder name called Jarfiles in sahi path(c:\sahi).
2. Copied Class file of java code, and created Jar file.
3. In sahi.bat “ set SAHI_EXT_CLASS_PATH=%SAHI_HOME%\Jarfiles\jarex.jar” code added.
[and also tried by coping jarex.jar file to extlib folder and SAHI_EXT_CLASS_PATH=%SAHI_HOME%\ extlib \jarex.jar]
4. I am calling java code “var strJava = Packages.Testing.Excel.CreateExcel();”
5. I am getting error “Cannot call property CreateExcel in object [JavaPackage Testing.Excel]. It is not a function, it is "object". “
Kindly provide solution for this problem.
1. Created folder name called Jarfiles in sahi path(c:\sahi).
2. Copied Class file of java code, and created Jar file.
3. In sahi.bat “ set SAHI_EXT_CLASS_PATH=%SAHI_HOME%\Jarfiles\jarex.jar” code added.
[and also tried by coping jarex.jar file to extlib folder and SAHI_EXT_CLASS_PATH=%SAHI_HOME%\ extlib \jarex.jar]
4. I am calling java code “var strJava = Packages.Testing.Excel.CreateExcel();”
5. I am getting error “Cannot call property CreateExcel in object [JavaPackage Testing.Excel]. It is not a function, it is "object". “
Kindly provide solution for this problem.
Comments
To create a new object do this:
could you help me out?