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.

parallel SUITE execution

globalwormingglobalworming Moderators
edited November -1 in Sahi - Open Source
Hi

when developing further, I will sooner or later face the problem to run more than one suite at the same time. Is there a way to easily start different instances of sahi.sh with different proxy ports?

Regards
Wormi

Comments

  • Hi globalworming,

    Yes, it is possible to run more than one suite at the same time.

    You can install two instances of Sahi in different place. You can set the proxy port as 9999 in sahi.properties for one instance of Sahi and 9998 in sahi.properties for another instance of Sahi.

    Now, you can open 2 command prompts and run the suite file for corresponding instances of Sahi.

    Let me know if this solves you issue.

    Regards
    Sumitra
  • Well I haven't tested it yet, but I think this will do it. Instead of using multiple installations, I will just copy the userdata directory, change the proxy.port and set the $USERDATA_DIR differently for each sahi proxy. This will have the same effect, won't it?
  • Hi globalworming,

    You cannot point Sahi to two $USERDATA_DIR at the same time.

    So, its better to have two instances of Sahi installed and run the suite file.

    You can also run these suite files among different machines using drun.

    For more details about drun:

    http://sahi.co.in/w/sahi_pro

    Regards
    Sumitra
  • Just to give a little update on this

    I now have two different projects running at the same time, every project with it's own userdata.dir. I just set the SAHI_USERDATA_DIR to different locations before starting the sahi.sh. The ports are assinged dynamically and the suites seem to run without problems. I will add a third project soon... when I tested locally, two instances of Sahi slowed my notebock down very much... now they run on a server and I m wondering how much parallel Sahi proxys it takes to freeze him^^

    Well, theres still a problem with https certificates... but that's another thread..

    Regards
    Wormi
  • Hello Wormi,

    This type of usage is not available in Sahi yet.
    One solution would be be to have a batch file/ shell script that runs these suites one after the other. You could deploy these tests on multiple machines using Sahi Pro.

    Regards,
    dkulkarni
  • globalwormingglobalworming Moderators
    edited October 2011
    Well... this update was no question if this feature is available.. it's more like: It works, and you don't need Sahi Pro to do it ;-) As i said.. I now have running 3 suites at the same time on one machine. And if anyone is interested how it works.. i could explain it further.

    I hope you won't permit this kind of usage because it's a Pro feature.
  • hello globalworming,

    can u tell me how can we change the port dynamically ?

    thanks in advance.
  • when working under UNIX like OS use
    #!/bin/bash
    # Author: Andreas Worm - headissue GmbH
    # Purpose: returns unused Port between $FIRST_PORT and $LAST_PORT
    
    LAST_PORT=9999
    FIRST_PORT=9979
    
    port=$FIRST_PORT 
    while test "$( lsof -i:$port -F p )" ; do
       if test  $port -eq $LAST_PORT ; then
         exit 1
       fi 
       port=$(( $port + 1 ));
    done
    echo $port
    
    with windows or mac, you will have to ask someone else :)
  • Sorry for the doublepost, but i think i misunderstood your question....

    you have to change the listening port for Sahi befor the start, so write a script like above, add "proxy.port=XXXX" to your userdata.properties and start Sahi ( you will need multiple installations of sahi.. at least multiple userdata folders...)

    well.. just send me a mail when u ghot further questions.. when you have time we can talk by skype or any other IM and I will eyplain in detail.. sorry, I m quite tired right know
  • narayannarayan Administrators
    Hi Wormi,

    What you mention is of course possible, and that is available in Sahi OS too. Sahi Pro will let you spread test cases on multiple machines.

    Can you explain why you cannot use the same Sahi proxy for all projects? Are the userdata.properties configurations conflicting with each other? You can run multiple suites simultaneously on a single Sahi server too. Just open another command prompt and trigger another suite. (It needs a few more changes may be.)

    Regards,
    Narayan
  • globalwormingglobalworming Moderators
    edited December 2011
    Hi narayan

    it's just to keep projects separated. You are right with the conflicting userdata, for I define different log directories to separate the logs better. It would be great to have more influence on the logging behavior. I'd like to have different suites with different log directories which I can name as I want and it would be great to get the directory of a currently running suite to know where to save screenshots and videocasts.
    I once requested an logDir() API http://sahi.co.in/forums/viewtopic.php?id=2903 but a setLogDir() API would also be nice :)
  • narayannarayan Administrators
    Hi Wormi,

    In the ant target to run a suite, you can specify a htmlLogDir. You should be able to get separate log dirs with that.

    Having said, that I am curious why Sahi seems to become slow when multiple instances are run. Would you have some time next week to have an online meeting?

    Regards,
    Narayan
  • We had implemented what Narayan has mentioned above almost 2 yr back, but we had only one project going on. But yes you can define the log directories for each separate project and same with suite files. We had quad core box with 8 gigs of RAM and we used to run 7 threads of 3 suites (total 21 threads) running parallel. And application was deployed on AIX server. And all with single Sahi proxy running.
  • globalwormingglobalworming Moderators
    edited December 2011
    Good to know, I may try ant then.

    I only had performance issues on my local machine, it is running fast and stable on the server. If you are interested, I could set it up locally again. Are there any metrics on which I should take a look besides CPU/RAM?
    Next week would be great, I'm usually working 8-17 UTC+1 just tell me when and how you would like to meet.
Sign In or Register to comment.