18 January 2026:


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.

Exception if startURL is not accessible?

simmerlsimmerl Members
edited November -1 in Sahi - Open Source
Hello,

my sahi test cases all contain a try...catch...finally-block to hande all exceptions like broken links etc....

But if the page given as startURL is not accessible at all, the sahi log contains

Starting script
Could not connect to the web server.
java.net.ConnectException: Connection timed out: connect
at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at net.sf.sahi.RemoteRequestProcessor.processHttp(RemoteRequestProcessor.java:128)
at net.sf.sahi.RemoteRequestProcessor.processHttp(RemoteRequestProcessor.java:83)
at net.sf.sahi.ProxyProcessor.processAsProxy(ProxyProcessor.java:149)
at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:93)
at java.lang.Thread.run(Unknown Source)

but the test ends OK. Shouldn't Sahi throw an exception even if the startURL is not reachable?

Thanks & Regards,

Simon
Sign In or Register to comment.