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.

Store Test Logs in Different Places

spchinspchin Members
edited November -1 in Sahi - Open Source
So I am creating a web portal from which a user can run a series of different tests and view the results. The number of tests is growing increasingly large, which leads me to wonder if there is a way to store the results from different suites in different places? I looked through the configuration file but didn't find anything. Is this possible to do within Sahi?

Comments

  • spchinspchin Members
    Anyone?
  • Go to Sahi/config directory

    Open sahi.properties

    Change
    logs.dir="Write Path where you want to store log file"
  • narayannarayan Administrators
    When you run a suite, you can specify the logdir.
    If you are using ant, specify the logDir like this:
            <sahi suite="../userdata/scripts/demo/demo.suite"
                  browserType="ie"
                  baseurl="http://${urlbase}/demo/"
                  sahihost="localhost"
                  sahiport="9999"
                  failureproperty="sahi.failed"
                  haltonfailure="false"
                  threads="6"
                    >
                <report type="html" logdir="myPath"/>
            </sahi>
    

    If you are using testrunner.bat, modify the logDir variable in that batch file.

    If you are running it as a URL, add a "&logDir=myPath" to the Suite url

    Hope that helps.

    Regards,
    Narayan
  • spchinspchin Members
    edited July 2011
    Thank you for the help narayan. I am using the Java Testrunner class in the testrunner.bat file. Is the LogDir variable you are referring to called -junitLog?

    This is the syntax I have at the end of the java line:

    -junitLog true -junitLogDir C:\Users\spchin\sahi\userdata\logs\Fiscal

    This outputs an XML log file to the directory specified, but is there any way to have it output the HTML log instead?
  • TheeranTheeran Members
    Hi spchin,

    The Testrunner class's parameters are explained below:

    -junitLog-->Enable or disable junit logs.
    -junitLogDir-->Path to junit log dir.

    The syntax you have used is right. This generates junit based logs.

    If you need HTML logs, use

    -htmlLogDir <Path to Log Directory>

    It is not necessary to enable -htmlLog,since it is enabled by default.

    The various parameters that can be used in Testrunner class is documented here. Just go through it.


    hope this would help you.

    Regards,
    Theeran.
  • spchinspchin Members
    I got the HTML logs to work, thank you for the help!
This discussion has been closed.