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.
java.lang.nullpointer exception
I have the latest version of java installed on my machine.
I'm getting the following message when I'm running sahi.bat
C:\>cd sahi_20091130
C:\sahi_20091130>cd sahi
C:\sahi_20091130\sahi>cd bin
C:\sahi_20091130\sahi\bin>sahi.bat
SAHI_HOME: ..
SAHI_USERDATA_DIR: ..\userdata
SAHI_EXT_CLASS_PATH:
Sahi properties file = C:\sahi_20091130\sahi\config\sahi.properties
Sahi user properties file = C:\sahi_20091130\sahi\userdata\config\userdata.prope
rties
>>>> Sahi started. Listening on port: 9999
>>>> Configure your browser to use this server and port as its proxy
>>>> Browse any page and CTRL-ALT-DblClick on the page to bring up the Sahi Cont
roller
Sahi OS properties file = C:\sahi_20091130\sahi\config\os.properties
Exception in thread "Thread-0" java.lang.NullPointerException
at net.sf.sahi.util.Diagnostics.run(Diagnostics.java:13)
at java.lang.Thread.run(Unknown Source)
I do not know why I'm getting the null pointer exception?
I'm getting the following message when I'm running sahi.bat
C:\>cd sahi_20091130
C:\sahi_20091130>cd sahi
C:\sahi_20091130\sahi>cd bin
C:\sahi_20091130\sahi\bin>sahi.bat
SAHI_HOME: ..
SAHI_USERDATA_DIR: ..\userdata
SAHI_EXT_CLASS_PATH:
Sahi properties file = C:\sahi_20091130\sahi\config\sahi.properties
Sahi user properties file = C:\sahi_20091130\sahi\userdata\config\userdata.prope
rties
>>>> Sahi started. Listening on port: 9999
>>>> Configure your browser to use this server and port as its proxy
>>>> Browse any page and CTRL-ALT-DblClick on the page to bring up the Sahi Cont
roller
Sahi OS properties file = C:\sahi_20091130\sahi\config\os.properties
Exception in thread "Thread-0" java.lang.NullPointerException
at net.sf.sahi.util.Diagnostics.run(Diagnostics.java:13)
at java.lang.Thread.run(Unknown Source)
I do not know why I'm getting the null pointer exception?
Comments
I do not think this exception will bother your Sahi usage. The diagnostics information is fetched for the info tab on the Sahi controller. Basically to help debug whether some dependencies are available on your system. If things are working properly, don't worry about this error.
Btw, if Sahi is otherwise working properly, could you please post the information on your info tab?
It will help us diagnose the problem more easily.
Regards,
Narayan
I am running Windows Vista Business, and Firefox 3.5.7
After starting the sahi proxy and configuring the Firefox browser, I cannot open the sahi controller window, CTL + ALT double click gives no result.
Mean while, Try editing the os.properties file located at <sahi-base-path>/config directory,
Insert the below line,
Windows\ Vista=xp
after the line
Windows\ 2003=xp
and restart the sahi proxy.
We are still figuring out, what is causing this problem. You can expect a fix for this in the coming release.
Thanks,
Venky.
I tried doing to changes to os.properties file
the output changed to
C:\Users\document\Documents\Downloads\sahi_20091130\sahi\bin>sahi.bat
SAHI_HOME: ..
SAHI_USERDATA_DIR: ..\userdata
SAHI_EXT_CLASS_PATH:
Sahi properties file = C:\Users\document\Documents\Downloads\sahi_20091130\sahi\
config\sahi.properties
Sahi user properties file = C:\Users\document\Documents\Downloads\sahi_20091130\
sahi\userdata\config\userdata.properties
>>>> Sahi started. Listening on port: 9999
>>>> Configure your browser to use this server and port as its proxy
>>>> Browse any page and CTRL-ALT-DblClick on the page to bring up the Sahi Controller
Sahi OS properties file = C:\Users\document\Documents\Downloads\sahi_20091130\sahi\config\os.properties
keytool command may not be correct: Cannot run program "keytool": CreateProcess error=2, The system cannot find the file specified
Also, could not double click with Cntl+Alt to launch the Sahi Controller. however used <server>:9999 to get to the site launcher. Subsequently entered the site under test address, (also on local host). this launched the Sahi Controller but the info tab contains no info about any of the items. Browser, Operating System, and Java. It containse v3 for Sahi -> Version.
thanks,
ajay.
The error and nullpointer do not affect functionality of Sahi. That part of the code is primarily for diagnostics which are displayed on the info tab of Controller.
You should have a look at this link, if your controller is not showing up: Help! The Sahi Controller does not come up
Regards,
Narayan
I start Sahi via the start_sahi batch file, it results in the same text originally reported by sahitya.16. I didn't bother changing my properties file as Narayan said that shouldn't matter. I then started Internet Explorer (version 8) and set up the proxies as described in the instructions.
Alt-dbl click didn't bring up the sahi controller, so instead I wrote in the address localhost and 9000 in the web browser, and was prompted to enter a site address. I chose the address of a local newspaper. Both the sahi controller and the website come up. So far so good.
As Ajay reports above, no information at all under the "Info" tab except that I am running Sahi V3.
I enter a script name and press "Record". There is no visible change to the controller window. I go to the IE window, surf around a little, click on links, etc. But no script turns up in the sahi controller window. I try normal clicks, ctrl-click (opens new tab in browser) and even links that open new browser windows. Nothing happens in the Sahi controller window that I can see.
In the end I press the "Stop" button for the macro recording, and then a popup appears with the title "Message from webpage", a yellow triangle containing an exclamation mark and the text "[object Error]". After clicking on "OK" there is still appears to be nothing happening in the Sahi controller window.
Regards,
Alan
Are you accessing your server using localhost? Use the server name instead. As said in my previous post, please have a look at the specified URL. Also try on firefox if possible.
Of course, correct me if my localhost assumption is incorrect.
The diagnostics is independent of Sahi's functionality. Please do not worry about the info tab or the diagnostics messages.
Regards,
Narayan
First I noticed Sahi now works when I try a normal http address. But not for https.
Then I read through the help that you have for https and SSL sites. After setting the SSL proxy in Firefox, creating the sahi_example_com file that was missing, navigating to the SSLmanager and adding exceptions for sahi_example_com then I could access regular https sites.
I have to create an exception file for each https site we want to test, but the instructions for that work fine.
Sahi works on Windows 7. There was a problem in the diagnostics part which failed for OSes that were not specified in os.properties. The diagnostics does not affect Sahi's regular use.
This has been fixed and should be available in the coming release.
Regards,
Narayan