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 for performance testing

AkshadaAkshada Members
edited November -1 in Sahi - Open Source
Hi All,

Can i use SAHI as a performance testing tool??
I need to measure the loading time of the page and other parameters.(Eg:Response time etc)

I have had problems with JMETER, hence the research.
Suggestions are welcome!! :) :)

Thanks and regards
Akshada

Comments

  • Hi Akshada,

    Yes, SAHI can be used for performance testing. This feature is available in Sahi PRo V4.0 build and will be released by tomorrow.

    Here are the Details:

    Running a load test using Sahi Pro

    Concept: Sahi Pro lets you run load tests on your application. There are 2 Sahi scripts
    involved in this. One is used to generate the load. This script is called the noise and
    is run on a headless browser. The steps in the noise file are generally in an infinite
    loop so that they never terminate.
    The other script is called the subject. The subject is the script whose steps you would
    like to measure periodically at different loads.


    Instructions:

    1) Get the headless browser: PhantomJS
    Download phantomjs from http://code.google.com/p/phantomjs/downloads/list The current version is phantomjs-1.2.0-win32-dynamic.zip

    Unzip phantomjs-1.2.0-win32-dynamic.zip inside sahi/ext/phantomjs such that you have
    sahi/ext/phantomjs/phantomjs.exe (and all the other files)

    2) Start Sahi Pro. PhantomJS should be visible on the Dashboard as one of the browsers.

    3) On the dashboard, click on the "Bin" link. This will open up a command prompt at userdata/bin

    4) On the command prompt, run
    dload.bat demo/load/noise.sah demo/load/subject.sah http://sahi.co.in/demo/training firefox

    This will do the following:

    1) Run 1 (min) threads of noise.sah on PhantomJS (This will not be visible)
    2) Run subject.sah on firefox browser and store the time of steps.
    3) Wait for 5 seconds (interval)
    4) Run 2 (incrementby) more threads of noise.sah on PhantomJS
    5) Run subject.sah on firefox and store results
    6) Keep incrementing the noise threads at periodic intervals, run the subject, and store results, till it reaches max noise threads.

    Once finished, Click on "Logs" link on the Dashboard to view results.

    To test your application, go to userdata/scripts/demo/load folder.
    1) Open noise.sah and add your sequence of steps. These steps should be representative of a normal
    user interaction. Note that your steps should be in a while(true){} loop so that the threads
    don't die out. (Refer to existing noise.sah)
    2) Open subject.sah and specify the sequence of steps whose reaction times you would like to
    measure at different loads.

    The parameters min,max,incrementby,interval etc. can be edited in dload.sah file.
    It is also possible to involve multiple machines in creating the load by modifying
    the "NODES" variable (Look in dload.bat)

    Let me know if you face any problem.

    Regards
    Sumtira
  • HI Sumitra,

    Thanks a lot for the reply :) :)
    I will try and let you know in case of any issues.

    Thanks again.
    Regards
    Akshada
  • edited November 2011
    I don't see a dload.sah file anywhere. Is it the delayedLoad.sah file instead? Also how do I increase the number of threads? Thanks!
  • Hi chopstickscheetos,

    The performance testing feature is available in latest version of Sahi Pro ie Sahi Pro V4.0 version which was released on 20111129.

    In this, 2 Sahi scripts are involved. You can find these scripts in <sahi-home>/userdata/scripts/demo/load/ . One is used to generate the load. This script is called the noise and is run on a headless browser. The steps in the noise file are generally in an infinite
    loop so that they never terminate.

    There is no dload.sah file used. Its dload.bat.

    To increase the number of threads navigate to <sahi-home>/userdata/bin/dload.bat and you can change it in line number 14 (mention it in -min 2 - max 5)
    java -cp %SAHI_HOME%\lib\ant-sahi.jar in.co.sahi.distributed.DLoadRunner -noise %COPIED_SCRIPTS_PATH%/%1 -noiseBrowserType phantomjs -min 1 -max 5 -incrementBy 2 -interval 5 -subject %COPIED_SCRIPTS_PATH%/%2 -browserType %4 -baseURL "%START_URL%" -host localhost -port 9999 -nodes "%NODES%"
    

    Let me know if you face any problem.

    Regards
    Sumitra
  • Hi Sumitra,

    I would like to know whether this feature is available in latest version of Sahi Open Source?

    Thanks,
    Umashankar
  • jaganbjaganb Members
    Hi,

    Can I run the load testing scripts from multiple machines, like drun.
  • PaulPaul Members
    Hi,

    I am new with Sahi (actually downloaded the open source and ran it today), and must say that its a very good and user friendly tool I have come across in a long time. However, my main need is to be able simulate load for the AUT, and generate performance reports that makes sense (unlike many Open source tools that make no sense to end user/management).

    however, I am also stuck with the points asked earlier in this post:

    a) Are performance testing features available in Sahi Open Source? If not, can I get access to a evaluation copy of Sahi Pro to test, if it suits my organizations need (we are trying to see its normal to medium usage in simulating load vis-a-vis Jmeter).
    b) Either in Open source or in Pro, how do I load test from multiple machines/servers (master, slave server combinations).

    Awaiting your kind response in helping me determine if Sahi is the way we should go in our organization.

    Warm Regards,

    Abhijit
  • Hi Guys,

    I am bit confused with the noise.sah file and what i change to customise for my webpage.
    I understand that I need to put in the steps I want to execute and measure in the subject.sah file however I dont understand what i need to do in the noise.sah file.
    Do I just leave the existing content of the noise.sah file and add the steps that I want to execute?

    For example Say I wanted to perform and measure performance on the following steps:

    _setValue(_textbox("user"), "test");
    _setValue(_password("password"), "secret");
    _click(_submit("Login"));

    I understand I need to put these in the subject.sah file. However what do I change in the noise.sah file?....do i leave all the existing text as shown below in the file and just add the same steps as I have in the subject.sah?

    Thanks in advance

    Neil

    while(true) {
    _navigateTo("/demo/clicks.htm");

    _doubleClick(_div("dbl click me"));
    _assertEqual("[DOUBLE_CLICK]", _textarea("t2").value);
    _click(_button("Clear"));

    _doubleClick(_button("dbl click me"));
    _assertEqual("[DOUBLE_CLICK]", _textarea("t2").value);
    _click(_button("Clear"));

    _click(_button("click me"));
    _assertEqual("[CLICK]", _textarea("t2").value);
    _click(_button("Clear"));

    _rightClick(_div("right click me"));
    _assertEqual("[RIGHT_CLICK]", _textarea("t2").value);
    _click(_button("Clear"));

    _rightClick(_button("right click me"));
    _assertEqual("[RIGHT_CLICK]", _textarea("t2").value);
    _click(_button("Clear"));

    _click(_checkbox(0));
    _assertTrue(_checkbox(0).checked);
    if (_condition(_isIE() || _sahi.isSafariLike())){
    _assertEqual("onclick_c1", _textarea("t2").value);
    }else{
    _assertEqual("onchange_c1", _textarea("t2").value);
    }

    _click(_checkbox(0));
    _assertFalse(_checkbox(0).checked);


    _click(_radio(0));
    _assertTrue(_radio(0).checked);

    if (_condition(_isIE() || _sahi.isSafariLike())){
    _assertEqual("onclick_r1", _textarea("t2").value);
    }else{
    _assertEqual("onchange_r1", _textarea("t2").value);
    }

    _click(_radio(1));
    _assertFalse(_radio(0).checked);
    _assertTrue(_radio(1).checked);
    }
  • Hi Neil,
    Please refer to the documentation on Load testing on the following link:
    http://sahi.co.in/w/load-testing-with-sahi-pro
    

    If you still have some query, please let me know.

    Regards.
  • Yes, you can use SAHI as performance testing tool. The tutorial will show how to use the test for regression and smoke testing. Then the tutorial will repurpose the test as a load and performance test and business service monitor. http://www.pushtotest.com/sahi-tutorial.html

    Thanks,
    Emily
    http://www.learnmax.co.in
Sign In or Register to comment.