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.
Ant with IE8
OS: Windows 7
Browser: IE8
Sahi Build: 2012-06-06 16:16:14?
Problem:
When I run test a test suite through Ant it will not execute IE8 properly. It will, however, run Chrome just fine with no errors. IE8 Test cases run fine through the Controller or through the TestRunner (ONLY with Controller up, not sure if this is intended).
Ant:
Properties File:
asdf=http but apparently being brand new I can't post links and it gets considered as a link so sorry about that.
The error I get is when IE tests begins to execute the IE8 Browser pops up but never opens to a page, it opens to a:
HTTP 404 Not Found: URL or Document not found (dns_unresolved_hostname)
HTTP 404: Your requested host "sahi.example.com" could not be resolved by DNS. The document at the specified URL does not exist.
Any thoughts on this?
Thanks,
Browser: IE8
Sahi Build: 2012-06-06 16:16:14?
Problem:
When I run test a test suite through Ant it will not execute IE8 properly. It will, however, run Chrome just fine with no errors. IE8 Test cases run fine through the Controller or through the TestRunner (ONLY with Controller up, not sure if this is intended).
Ant:
<project name="Sahi_Plugin" default="all">
<property file="Sahi_Plugin.properties"/>
<taskdef name="sahi" classname="net.sf.sahi.ant.RunSahiTask" classpath="${sahidir}/lib/ant-sahi.jar"/>
<target name="run-ff-tests">
<sahi suite="${suite}"
browser="${ff-exe}"
baseurl="${baseurl}"
sahihost="localhost"
sahiport="9999"
failureproperty="sahi.failed"
haltonfailure="false"
browserProcessName="firefox.exe"
browseroption="-profile ${basedir}/userdata/browser/ff/profiles/sahi$threadNo -no-remote"
threads="3">
<report type="html"/>
<report type="junit" logdir="${junit-log-dir}"/>
<createissue tool="jira"/>
</sahi>
</target>
<target name="run-c-tests">
<sahi suite="${suite}"
browser="${c-exe}"
baseurl="${baseurl}"
sahihost="localhost"
sahiport="9999"
failureproperty="sahi.failed"
haltonfailure="false"
browserProcessName="chrome.exe"
browseroption="--user-data-dir=C:\SahiPro\userdata\browser\chrome\profiles\sahi0 --proxy-server=localhost:9999 --disable-popup-blocking --always-authorize-plugins"
threads="1">
<report type="html"/>
<report type="junit" logdir="${junit-log-dir}"/>
<createissue tool="jira"/>
</sahi>
</target>
<target name="run-ie-tests">
<antcall target="proxyon"/>
<sahi suite="${suite}"
browser="${ie-exe}"
baseurl="${baseurl}"
sahihost="localhost"
sahiport="9999"
failureproperty="sahi.failed"
haltonfailure="false"
browseroption="-nomerge"
browserProcessName="iexplore.exe"
threads="1">
<report type="html"/>
<report type="junit" logdir="${junit-log-dir}"/>
<createissue tool="jira"/>
</sahi>
<antcall target="proxyoff"/>
</target>
<target name="all">
<parallel>
<sequential>
<waitfor maxwait="15" maxwaitunit="second" checkevery="100">
<http url="${server-ping-url}"/>
</waitfor>
<echo message="Sahi Server Running...."/>
<antcall target="sahi-tests"/>
</sequential>
<antcall target="startsahi"/>
</parallel>
</target>
<!-- <target name="sahi-tests" depends="run-c-tests, run-ie-tests, stopsahi, failsahi"> -->
<target name="sahi-tests" depends="run-ie-tests, stopsahi, failsahi">
</target>
<target name="failsahi" if="sahi.failed">
<fail message="Sahi tests failed!"/>
</target>
<target name="startsahi" description="starts proxy">
<java classname="net.sf.sahi.Proxy" fork="true">
<!--<env key="MOZ_NO_REMOTE" value="1"/>-->
<classpath location="${sahidir}/lib/sahi.jar">
<pathelement location="${sahidir}/extlib/rhino/js.jar"/>
<pathelement location="${sahidir}/extlib/apc/commons-codec-1.3.jar"/>
<pathelement location="${sahidir}/extlib/db/h2.jar"/>
<pathelement location="${sahidir}/extlib/license/truelicense.jar"/>
<pathelement location="${sahidir}/extlib/license/truexml.jar"/>
<fileset dir="${sahidir}/extlib/poi" includes="*.jar"/>
</classpath>
<arg value="${sahidir}" id="basePath"/>
<arg value="${sahidir}/userdata" id="userdataPath"/>
</java>
</target>
<target name="stopsahi" description="stop sahi server">
<sahi stop="true" sahihost="localhost" sahiport="9999"/>
</target>
<target name="proxyon">
<exec executable="${sahidir}/tools/toggle_IE_proxy.exe">
<arg value="enable"/>
</exec>
</target>
<target name="proxyoff">
<exec executable="${sahidir}/tools/toggle_IE_proxy.exe">
<arg value="disable"/>
</exec>
</target>
</project>
Properties File:
sahidir=C:\SahiPro
ie-exe=C:\Program Files\Internet Explorer\iexplore.exe
ff-exe=C:\Program Files\Mozilla Firefox\firefox.exe
c-exe=C:\Users\removed\AppData\Local\Google\Chrome\Application\chrome.exe
suite=${sahidir}/userdata/scripts/PLUGIN.suite
baseurl=some URL
junit-log-dir=${sahidir}/logs/junit/
server-ping-url=asdf://localhost:9999/demo/index.htm
asdf=http but apparently being brand new I can't post links and it gets considered as a link so sorry about that.
The error I get is when IE tests begins to execute the IE8 Browser pops up but never opens to a page, it opens to a:
HTTP 404 Not Found: URL or Document not found (dns_unresolved_hostname)
HTTP 404: Your requested host "sahi.example.com" could not be resolved by DNS. The document at the specified URL does not exist.
Any thoughts on this?
Thanks,
Comments
When I run IE8 tests using the Sahi Controller, if you check the IE8 browsers proxy settings you see that they are set to localhost:9999 for both http/secure. However, when I look at the browser for the ant that gets kicked off, it has no proxies set.
Seems like somehow the settings are not being done the same from Ant to Sah Controller?
Automatically Detect Settings is unchecked (as it should be)
Use Automatic Configuration Script (This is checked and it SHOULD NOT BE)
Proxy Server --> Advanced --> localhost:9999 for http/secure are not set appropriately.
Whenever I run the test cases through the controller all of this works as expected though. Am I missing commands?
Whether this is correct or not, I am unsure of.
You are using the older version of the Sahi target which explicitly specifies the browser process name etc. The current way is to pass the browserType which in turn is defined in sahi/userdata/config/browser_types.xml file
The modified target would look like this:
Your browser_types.xml would have an entry like this:
The useSystemProxy takes care of toggling proxy.
Hope that helps.
Regards,
Narayan