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.

sahi becomes slower

stevstev Members
edited November -1 in Sahi - Open Source
hy, im facing a problem with sahi, i want to run a very long test case, it has about 3000-5000 steps, after 500 steps sahi becomes to be very slow, and takes to long to execute a step. Anyone knows what could be the raison?
thx

Comments

  • Akss004Akss004 Members
    edited September 2011
    Hi stev,

    I think you are executing testcase with sahi controller. Which shows and logs steps executed from your test script in it. So when you execute long test cases, size of this log file will increase (and it consumes more memory to display on controller) with execution and eventually it will slowdown your execution.

    So try and execute same scripts on batch mode. i think that will solve your problem.

    Details about batch mode execution is given on below link.

    http://sahi.co.in/w/Running+multiple+tests+in+batch+mode
  • Hi Akash,
    thx for your reply. so it means for long test i am not able to see or to have a look on the log file, cause nothing will be wrote in it. and also not possibility to know if an Assert goes wrong or not.
    Do you know any possibility in the batch mode to see what goes wrong and what was successful?
  • globalwormingglobalworming Moderators
    edited September 2011
    Running testsuites in batch-mode will produce the same logs as the controller... as far as i know, there's no great difference between controller and sahi/userdata/logs/playback.... asides from HTML and CSS....
    failing asserts will still be logged
    well... if u want direct feedback, start the suite, open the logfile in the playback/suitename directory and keep pressing F5 ;-)
  • Hi stev,

    You can have a look at log file even if you run a long script but it basically increases the size of the log file and it consumes more memory to display on controller.Hence takes long time to execute the steps.

    Suite file will help you to distribute the Sahi scripts among multiple browsers and will help you to show the logs for each sahi script.

    In batch mode, if the assertion fails then you can view this on the logs and will point to the step where it is failed.

    Let me know if you need more information.

    Regards
    Sumitra
  • Hi Sumitra,

    thx for your reply. that's the point how can i open the log when i run sahi on batch more, i'm new in Sahi annd i always worked with sai controller, that why i dont know how to get the log from the batch mode. can u help me? thx
  • Hi sorry, i didn't see the reply of globalworming. thx to y'all
  • In your sahi controller, there's in the Playback Tab a link at the Bottom "View Logs", it will show the logs from the tests in batch-mode too.
    These logs are stored in your $SAHI_HOME/userdata/logs/playback/$SUITENAME with timestamps.

    Regards
    Wormi
  • agile_testeragile_tester Members
    edited September 2011
    Hi Stev,

    I agree with the statements that have been made in this thread that running the scripts in batch mode will solve your slow-down issues. I, too, have faced similar issues with scripts that perform many test steps or which implement some loops which cause the scripts to run for many hours.

    There is, however, another way that you can still use the controller as you have been to execute your large scripts; I suggest you refer to another thread that I've found to be extremely helpful - it describes the root cause and work-around:

    Search for: "Sahi Controller Leaks Memory" in Forums. (note that the title is a little bit deceiving, as I described further below)

    Root cause: The controller logs the steps in a text area which keeps growing (and uses a lot of resources). This issue is not caused by SAHI itself, but by limits imposed by the browsers.

    Work-around: Depending on your level of expertise and familiarity in changing javascript files, you can try to implement jimschilling's patched function which you'll find in before mentioned thread. Basically, the patch will only keep the last n statements in the text area and remove the rest in an ongoing basis.

    I have done this and can CONFIRM that this resolved the issues.

    Note that you'll still have access to the full log file if you follow wormi's instructions above.

    HTH
    Best Regards
    - Thomas
  • Running testsuites in batch-mode will produce the same logs as the controller... as far as i know, there's no great difference between controller and sahi/userdata/logs/playback.... asides from HTML and CSS....

    Yes , but i have not said that this will not produce logs.

    I am using sahi with ant integration and never faced any such issue of memory leakage though testscripts are very long.

    But yes solution of twiking java script of sahi is also nice option .... :)
  • globalwormingglobalworming Moderators
    edited September 2011
    hi akss004

    I mentioned that there are still logs because of Stevs answer to your post :)
    stev wrote:
    so it means for long test i am not able to see or to have a look on the log file, cause nothing will be wrote in it
  • Hi guys,
    thx to y'all for your replies, they was very helpfull.
    The Wormi's suggestion was very helpfull, i created a .suite file that i runned in batch mode, and then the log are store in userdate/logs/playback so that i can have a look on this.
    The execution time is now faster than with the sahi controller, but there are random error with the batch mode , the execution sometimes just stops and i don't know why. does anyone of you know the raison of the random error in the batch mode?

    thx
  • globalwormingglobalworming Moderators
    edited September 2011
    Seems to be a Sahi problem http://sahi.co.in/forums/viewtopic.php?pid=6515#p6515
    Try keep your scripts short... maybe you can set some breakpoints.. where one script can end... and another takes over
Sign In or Register to comment.