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.

Can't find the Execution time in logs ,,any other way to find it

shobhitshobhit Members
edited November -1 in Sahi - Open Source
I cannot find the execution time for the particular testcase in text logs ,,can you please tell me where to find it

Comments

  • I have never seen that txt log updated with any info. In case you don't know, just go to your Sahi log folder ("...\sahi\userdata\logs\playback") and look at your logs (html docs). When you open these files, you should see the starting and stopping time for your executed scripts.
    I don't know any other easy way of doing this (unless you use some performance test tools)
  • narayannarayan Administrators
    You can do this:

    var $start = new Date();
    // Your steps
    var $period = new Date() - $start;
    _log("Time taken for script is: " + $period)
  • Thanks Narayan. This is much better now :- )
    Can this be done in a batch mode as well?
  • Well i am a big fan of sahi .... I have blogged on many of selenium sites
  • Edit the batch file to contain the following entries,

    echo [%date% %time%] starting

    :: batch file code

    echo [%date% %time%] ending
  • Hi Venky,
    Thanks for your reply.
    I used your input in my batch file but the first and last lines (that I added) fails with the below error message from the log file. Everything else in the batch passes.
    =======
    Starting script
    JSERROR
    Script did not start within 130 seconds. at Feb 26, 2010 12:57:19 PM
    Stopping script
    =========
    Here is a sample code from one of my simple batch file. Basically, there are 2 scripts in this batch file.
    =======
    echo [%date% %time%] starting
    FB_3515.sah http://www.xxxx.net/v4cgi/login.pl
    FB_2733.sah http://www.xxxx.net/v4cgi/login.pl
    echo [%date% %time%] ending
  • VenkyVenky Members
    No, I meant that adding these lines in ff_batch.bat or ie_batch.bat from where you run suite test.

    If you are running suite in IE, then add those lines in ie_batch.bat located at <sahi-base-directory>/userdata/bin directory.

    for firefox, add those lines in ff_batch.bat located at same location.

    so, ff_batch.bat will look like this,

    echo [%date% %time%] starting
    SET SAHI_HOME=..\..
    SET SAHI_USERDATA_DIR=..
    java -cp %SAHI_HOME%\lib\ant-sahi.jar net.sf.sahi.test.TestRunner <your file path> "C:\Program Files\Mozilla Firefox\firefox.exe" <your testing url> default localhost 9999 3 firefox.exe "-profile %SAHI_USERDATA_DIR%/browser/ff/profiles/sahi$threadNo -no-remote"
    echo [%date% %time%] ending

    when you run ff_batch.bat, then it prints the starting time and ending time in the console.

    Thanks,
    Venky.
  • aikincaikinc Members
    Thanks Venky.
    Is there a way to print this to the log file instead?
Sign In or Register to comment.