This is a Browser Action API.
_callServer allows Sahi to execute any server side code.
_callServer(cmd, qs)
The parameters are:
Below is an implementation of writing debug messages to the console.
Create this class:
package net.sf.sahi.ext;
import net.sf.sahi.request.HttpRequest;
public class Debug {
public void toOut(HttpRequest request) {
String msg = request.getParameter("msg");
System.out.println(msg);
}
}
Add it to Sahi’s classpath:
Look at Adding jars to Sahi’s classpath
Call this from your script:
_callServer("net.sf.sahi.ext.Debug_toOut", "msg=SomeMessage");
This will write “SomeMessage” on the console where sahi.bat/sahi.sh was started.