Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ sahipro.com with your query.

Unable to run sahi suit using ANT

Whenever I try to run the sahi suit using ant, the console appears and the browser opens. Also navigates to the base url set in the xml file. But the browser closes after that and BUILD FAILED is shown in the console. Under that 2 specific line numbers in the xml file are also shown. How can I solve this problem?

Answers

  • It has always worked for me. If you are on windows, download the Ant latest binary package and extract the contents to say c:\apache-ant-1.9.4 . You should now have C:\apache-ant-1.9.4\bin and other directories. Add Ant C:\apache-ant-1.9.4\bin; to the PATH (system path)
    Check Ant configuration -
    1. Open command prompt - type ant -v
    C:\Users\iwx>ant -v
    Apache Ant(TM) version 1.9.4 compiled on April 29 2014
    Trying the default build file: build.xml
    Buildfile: build.xml does not exist!
    Build failed
    2. cd to your sahi home directory
    3. type command - ant -f demo.xml

    It should start the server and tests should run.
  • Make sure you start the sahi server before using ant -f demo.xml
    This seems to be an issue with the new release. You can modify the demo.xml to add dependency task like start sahi server and later stop sahi server.
  • Fix for demo.xml

    <target name="start" description="starts proxy">
    <java classname="net.sf.sahi.Proxy" fork="true">
    <!--<env key="MOZ_NO_REMOTE" value="1"/>-->
    <classpath location="./lib/sahi.jar">
    <pathelement location="./extlib/rhino/js.jar"/>
    <pathelement location="./extlib/apc/commons-codec-1.3.jar"/>
    <fileset dir="./extlib" includes="*.jar"/>
    </classpath>
    <arg value="." id="basePath"/>
    <arg value="./userdata" id="userdataPath"/>
    </java>
    </target>
  • vladvlad Members
    What about the generated line
    <taskdef name="sahi" classname="net.sf.sahi.ant.RunSahiTask" classpath="lib/ant-sahi.jar"/>

    - should it also stay there or should it be deleted?
Sign In or Register to comment.