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.
Build Script Error
Buildfile:
\Test\Test_workspace\SahiDemo.xml
sahitests:
start-web:
proxyon:
[java] Sahi properties file =
\Test\Test_workspace\sahi.properties
[java] Sahi user properties file =
\Test\Test_workspace\config\userdata.properties
[java] java.net.BindException: Address already in use: JVM_Bind
[java] at java.net.PlainSocketImpl.socketBind(Native Method)
[java] at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
[java] at java.net.ServerSocket.bind(ServerSocket.java:319)
[java] at java.net.ServerSocket.<init>(ServerSocket.java:185)
[java] at java.net.ServerSocket.<init>(ServerSocket.java:97)
[java] at net.sf.sahi.WebServer.startProxy(WebServer.java:53)
[java] at net.sf.sahi.WebServer.main(WebServer.java:44)
BUILD FAILED
\Test\Test_workspace\SahiDemo.xml:23: sahi doesn't support the "port" attribute
sahitests:
start-web:
proxyon:
[java] Sahi properties file =
[java] Sahi user properties file =
[java] java.net.BindException: Address already in use: JVM_Bind
[java] at java.net.PlainSocketImpl.socketBind(Native Method)
[java] at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
[java] at java.net.ServerSocket.bind(ServerSocket.java:319)
[java] at java.net.ServerSocket.<init>(ServerSocket.java:185)
[java] at java.net.ServerSocket.<init>(ServerSocket.java:97)
[java] at net.sf.sahi.WebServer.startProxy(WebServer.java:53)
[java] at net.sf.sahi.WebServer.main(WebServer.java:44)
BUILD FAILED
Comments
Can you post your target too?
Regards,
Narayan
<project name="Test" default="sahitests">
<taskdef name="sahi" classname="net.sf.sahi.ant.RunSahiTask" classpath="C:/Sahi/lib/ant-sahi.jar"/>
<target name="sahitests" description="start the server and run sahi tests">
<parallel>
<sequential>
<waitfor maxwait="3" maxwaitunit="minute" checkevery="100">
<http url="http://MyMachine:portno/Test/Login.jsp"/>
</waitfor>
<antcall target="proxyon"/>
<sahi suite = "C:\Sahi\userdata\scripts\MyTest.suite"
browser = "C:\\Program Files\\Internet Explorer\\iexplore.exe"
baseurl = "http://MyMachine:portno/Test/Login.jsp"
sahiHost = "localhost"
port = "9999"
failureproperty="sahi.failed"
haltonfailure="false"
threads="1"
/>
<antcall target="proxyoff"/>
<antcall target="stop-web"/>
<antcall target="failsahi"/>
</sequential>
<antcall target="start-web"/>
</parallel>
</target>
<target name="failsahi" if="sahi.failed">
<fail message="Sahi tests failed!"/>
</target>
<target name="start-web" description="starts web">
<java classname="net.sf.sahi.WebServer" fork="true" dir="bin" >
<classpath location="C:\Sahi\lib\sahi.jar"/>
</java>
</target>
<target name="stop-web" description="stop web server">
<get dest="stopserver.htm" src="http://localhost:9999/dyn/stopserver" ignoreerrors="true" />
<delete file="stopserver.htm"/>
</target>
<target name="sahireport" description="show report">
<exec command="C:\\Program Files\\Internet Explorer\\iexplore.exe file:///C:/Sahi/logs/playback/"/>
</target>
<target name="start" description="starts proxy">
<java classname="net.sf.sahi.Proxy" fork="true" dir="bin">
<classpath location="C:/Sahi/lib/sahi.jar"/>
</java>
</target>
<target name="proxyon">
<exec executable="C:/Sahi/tools/toggle_IE_proxy.exe">
<arg value="enable"/>
</exec>
</target>
<target name="proxyoff">
<exec executable="C:/Sahi/tools/toggle_IE_proxy.exe">
<arg value="disable"/>
</exec>
</target>
</project>