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.
Sahi Playback Giving Me Nullpointer Exception !!! Please Help
I tried to use the playback method, all the steps are recorded in the scripts but when i tried to play it back, It gives me the following error..Can anybody please help me...i am really trying to use the comprehensive features of Sahi, which looks very promising to me..thank you
java.lang.NullPointerException
at net.sf.sahi.command.Player.stop(Player.java:55)
at net.sf.sahi.command.Player.stop(Player.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.sf.sahi.command.CommandExecuter.execute(CommandExecuter.java:53)
at net.sf.sahi.LocalRequestProcessor.getLocalResponse(LocalRequestProces
sor.java:42)
at net.sf.sahi.ProxyProcessor.processLocally(ProxyProcessor.java:199)
at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:71)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at net.sf.sahi.command.Player.stop(Player.java:55)
at net.sf.sahi.command.Player.stop(Player.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.sf.sahi.command.CommandExecuter.execute(CommandExecuter.java:53)
at net.sf.sahi.LocalRequestProcessor.getLocalResponse(LocalRequestProces
sor.java:42)
at net.sf.sahi.ProxyProcessor.processLocally(ProxyProcessor.java:199)
at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:71)
at java.lang.Thread.run(Unknown Source)
Comments
Script Below:
_setValue(_textbox("q"), "google");
_click(_submit("Google Search"));
but same thing..when i try to play it back..command promt gives me a null pointer exception and sahi controller says : Success - Stop Playback
In the "Playback" tab, click the "View Logs" link.
Click the link for the log of the test run with errors. See any red line items in there?
1. What the usage of "Assert" in the recording controller .. i mean .. i could have just clicked on specific link or buttons i need
2. Can i use any high level instruction..for example -> using loop or inherit/import/use scripts (to overcome rewriting) or compare function (regular expression) within the scripts..
Please Let me know
1. You can use "Assert" to make sure expected text, buttons, <divs>, <spans>, images, etc... are there on the page.
a. With the Sahi Controller open, hold down the "CTRL" key and mouseover an element like an image or a link or something.
b. Notice how the "Accessor:" and "Alternative:" fields get populated
c. Click the "Test" button. The assert statements are evaluated and you get a response stating either "true" or "false".
d. Click "Append to Script" to have the asserts added to the script you are recording.
2. Yes. All of them.
a. Loops: http://sahi.co.in/w/Script/
b. Inherit/import/use: http://sahi.co.in/w/_include
c. RegEx: Use the JavaScript object -> http://www.w3schools.com/js/js_obj_regexp.asp
error: THIS IS THE ERROR SAHI Log PROVIDED ME
Error loading script. Firefox may point to the exact line. ReferenceError: _include is not defined() with some js error which i couldnt post * New Members can not post links, images or email addresses until they become more active.
ALL I TRIED TO DO IS VERY SIMPLE
testLogin.sah ->
_include("adminLogin.sah");
login_admin("username");
adminLogin.sah ->
function login_admin($username)
{
_setValue(_textbox("username"),$username);
_click(_submit("Login"));
_click(_link("Orgs"));
}
Both the files are in the same directory..and i even tried with file path ( _include($filepath)); where $filepath contained the absolute location of the file but its the same issue... _inlude is not defined ...
Thanks for all of the valuable inputs from StringyLow and Narayan...It really helping me guyz
Try giving the absolute path in the _include() statement itself. We can have some more idea about the error if could view the entire error log.
And for the second problem Try using the _keyPress() function. The key code for ENTER is 13 if i am not wrong. But Narayan can throw some more light on how to use the key code directly in the _keyPress() function as i tried that but in vain.
Regards,
Pankaj.
I have installed Sahi / Java onto a second machine in my work place, and on my home PC.
Sahi installed and ran brilliantly on my home PC and on my first installation.
However on my second installation I am experiencing a problem where
It just doesn't appear to be setting the start page correctly. If in the Sahi controller, on the playback tab I select my file, hit the set button, and then try and view the parsed file, it displays the message
Do you have any suggestions.
all i had to do is create the event as ENTER key is pressed..HTML element is form and i tried the code below:
_keyPress(document.form,'ENTER'); //as its only one key to be pressed
HTML looks like this :
<form method='get' action='SU.pm'>
Enter the username below then hit enter:
<br/>
<br/>
<input type='text' name='username' value=''/>
</form>
can anybody suggest me something to resolve the issue..please..thank you