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.
Distributed mode, scripts synchronization problem
Hi,
i am new to Sahi Pro, currently evaluating it as a tool for automated web testing. I am quite impressed with it's capabilities and usage so far.
As mentioned in other thread, i am executing Sahi tests via Ant task (in.co.sahi.ant.DAntRunner) equivalent to drun job. Here's a situation: Sahi client takes care and synchronizes test scripts to defined server node, in example below represented by ${node1.host} and ${node1.port} variables. That works beautifully. However for some reason it also attempts to synchronize with localhost:9999 and fails.
Excerpt of Ant script:
See corresponding LOG output below, notice Connection refused exception and lengthy stacktrace:
Here comes my question, how do I prevent DAntRunner from attempting to synchronize with localhost:9999? I didn't define anywhere Sahi should do that. That behavior is undesired as it polutes all test logs with misleading java exception. I believe this is a bug and Sahi is not expected to behave like that. Described situation is permanently reproducible on Sahi 5.1.1 evaluation.
Cheers,
Tomas
i am new to Sahi Pro, currently evaluating it as a tool for automated web testing. I am quite impressed with it's capabilities and usage so far.
As mentioned in other thread, i am executing Sahi tests via Ant task (in.co.sahi.ant.DAntRunner) equivalent to drun job. Here's a situation: Sahi client takes care and synchronizes test scripts to defined server node, in example below represented by ${node1.host} and ${node1.port} variables. That works beautifully. However for some reason it also attempts to synchronize with localhost:9999 and fails.
Excerpt of Ant script:
<sahi suite="${tempdest}/${suite.script.name}"
userdefinedid="${suite.userdefinedid}"
browserType="${suite.browserType}"
baseurl="${suite.baseurl}"
sahihost="${node1.host}"
sahiport="${node1.port}"
failureproperty="sahi.failed"
haltonfailure="false"
singlesession="true"
threads="1"
originalSuitePath="${sourceshort}/${suite.script.name}">
<report type="html"/>
<report type="xml"/>
<report type="junit"/>
<sync originFolder="${sourcelong}" destFolder="${tempdest}" ignorePattern=".*(svn|copied).*"/>
<node host="${node1.host}" port="${node1.port}"/>
</sahi>
See corresponding LOG output below, notice Connection refused exception and lengthy stacktrace:
build 03-IV-2014 17:27:33 runbrowsertests:
build 03-IV-2014 17:27:33 [echo] Running browser tests
build 03-IV-2014 17:27:33 [echo] ==================
build 03-IV-2014 17:27:34 [sahi] IV 03, 2014 5:27:34 ODP. in.co.sahi.distributed.DSync syncNodes
build 03-IV-2014 17:27:34 [sahi] INFO: nodes=192.168.2.31:9999
build 03-IV-2014 17:27:34 [sahi] IV 03, 2014 5:27:34 ODP. in.co.sahi.distributed.DSync syncNodes
build 03-IV-2014 17:27:34 [sahi] INFO: destFolder=temp/scripts/2014_04_03_17_27_33
build 03-IV-2014 17:27:34 [sahi] IV 03, 2014 5:27:34 ODP. in.co.sahi.distributed.DSync syncNodes
build 03-IV-2014 17:27:34 [sahi] INFO: originFolder=userdata/scripts/
build 03-IV-2014 17:27:34 [sahi] IV 03, 2014 5:27:34 ODP. in.co.sahi.distributed.DSync syncNodes
build 03-IV-2014 17:27:34 [sahi] INFO: ignorePattern=.*(svn|copied).*
build 03-IV-2014 17:27:34 [sahi] IV 03, 2014 5:27:34 ODP. net.sf.sahi.util.ZipUtils zip
build 03-IV-2014 17:27:34 [sahi] INFO: BasePath=/opt/atlassian/bamboo-home/xml-data/build-dir/QD-ATU-JOB1/userdata/scripts
build 03-IV-2014 17:27:34 [sahi] IV 03, 2014 5:27:34 ODP. in.co.sahi.distributed.DSync syncNodes
build 03-IV-2014 17:27:34 [sahi] INFO: 192.168.2.31:9999
build 03-IV-2014 17:27:34 [sahi] IV 03, 2014 5:27:34 ODP. in.co.sahi.distributed.DSync sync
build 03-IV-2014 17:27:34 [sahi] INFO: http://192.168.2.31:9999/_s_/dyn/pro/Synchronizer_saveFile?destFolder=temp%2Fscripts%2F2014_04_03_17_27_33
build 03-IV-2014 17:27:34 [sahi] IV 03, 2014 5:27:34 ODP. in.co.sahi.distributed.DSync sync
build 03-IV-2014 17:27:34 [sahi] INFO: 200
build 03-IV-2014 17:27:34 [sahi] IV 03, 2014 5:27:34 ODP. in.co.sahi.distributed.DSync sync
build 03-IV-2014 17:27:34 [sahi] INFO: http://localhost:9999/_s_/dyn/pro/Synchronizer_saveFile?destFolder=temp%2Fscripts%2F2014_04_03_17_27_33
build 03-IV-2014 17:27:34 [sahi] java.net.ConnectException: Connection refused
build 03-IV-2014 17:27:34 [sahi] at java.net.PlainSocketImpl.socketConnect(Native Method)
build 03-IV-2014 17:27:34 [sahi] at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
build 03-IV-2014 17:27:34 [sahi] at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
build 03-IV-2014 17:27:34 [sahi] at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
build 03-IV-2014 17:27:34 [sahi] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
build 03-IV-2014 17:27:34 [sahi] at java.net.Socket.connect(Socket.java:579)
build 03-IV-2014 17:27:34 [sahi] at java.net.Socket.connect(Socket.java:528)
build 03-IV-2014 17:27:34 [sahi] at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
build 03-IV-2014 17:27:34 [sahi] at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
build 03-IV-2014 17:27:34 [sahi] at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
build 03-IV-2014 17:27:34 [sahi] at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
build 03-IV-2014 17:27:34 [sahi] at sun.net.www.http.HttpClient.New(HttpClient.java:308)
build 03-IV-2014 17:27:34 [sahi] at sun.net.www.http.HttpClient.New(HttpClient.java:326)
build 03-IV-2014 17:27:34 [sahi] at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:996)
build 03-IV-2014 17:27:34 [sahi] at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:932)
build 03-IV-2014 17:27:34 [sahi] at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:850)
build 03-IV-2014 17:27:34 [sahi] at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1091)
build 03-IV-2014 17:27:34 [sahi] at in.co.sahi.distributed.DSync.sync(DSync.java:68)
build 03-IV-2014 17:27:34 [sahi] at in.co.sahi.distributed.DSync.syncNodes(DSync.java:52)
build 03-IV-2014 17:27:34 [sahi] at in.co.sahi.distributed.DSync.syncNodes(DSync.java:28)
build 03-IV-2014 17:27:34 [sahi] at in.co.sahi.ant.DAntSync.execute(DAntSync.java:22)
build 03-IV-2014 17:27:34 [sahi] at in.co.sahi.ant.DAntRunner.execute(DAntRunner.java:22)
build 03-IV-2014 17:27:34 [sahi] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
build 03-IV-2014 17:27:34 [sahi] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
build 03-IV-2014 17:27:34 [sahi] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
build 03-IV-2014 17:27:34 [sahi] at java.lang.reflect.Method.invoke(Method.java:606)
build 03-IV-2014 17:27:34 [sahi] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
build 03-IV-2014 17:27:34 [sahi] at org.apache.tools.ant.Task.perform(Task.java:348)
...
build 03-IV-2014 17:27:34 [sahi] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
build 03-IV-2014 17:28:42 [echo] ==================
build 03-IV-2014 17:28:42 [echo] Browser tests finished
build 03-IV-2014 17:28:42
build 03-IV-2014 17:28:42 failsahi:
build 03-IV-2014 17:28:42
build 03-IV-2014 17:28:42 BUILD SUCCESSFUL
build 03-IV-2014 17:28:42 Total time: 1 minute 9 seconds
Here comes my question, how do I prevent DAntRunner from attempting to synchronize with localhost:9999? I didn't define anywhere Sahi should do that. That behavior is undesired as it polutes all test logs with misleading java exception. I believe this is a bug and Sahi is not expected to behave like that. Described situation is permanently reproducible on Sahi 5.1.1 evaluation.
Cheers,
Tomas
Best Answer
-
Hi Narayan,
Yes, that is perfectly right. In my case localhost represents a server like Jenkins@Linux with no Sahi, no web browsers, no graphical environment. All it does is it uses ant-sahi.jar to distribute testing job onto dedicated remote machine(s) with proper Sahi Pro installed. No one is listening at localhost:9999.Sahi is NOT running on localhost, and you are executing scripts on another machine by calling drun from localhost. Is that right?
I will send e-mail to Sahi support as you suggested.
Thanks.
Tomas
Answers
Sahi is NOT running on localhost, and you are executing scripts on another machine by calling drun from localhost. Is that right?
Could you please post this on support at sahi.co.in email address? Our support team will look into it and get back to you. It does look like a bug.
Thanks,
Narayan