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.

Problem with switch

lepierrotlepierrot Members
edited November -1 in Sahi - Open Source
Hi,

Does Sahi knows switch instruction ?
Because JavaScript does, but I have problem with sahi when running it ...
function init_gsm(){
    switch ($scenario){
        case "1" : _click(_link("GSM Device")); break;
        case "2" : _click(_link("Sim Array")); break;
        default : _click(_link("Port Group")); break;
    }
}
The problem is that the function is executed in loop just when clicking on 'set' button on sahi controller. No need to press 'start' ...
Is there a special way to run this instruction with sahi ? because I didn't see anything on website concerning this!
That's very strange...

Comments

  • surisuri Members
    Hi All,
    I am very new to this forum also to this tool

    I am not able to open sahi controller by using alt+ctrl+doubleclick in the webpage.
    i have changed port number host number in config properties file as mention below.

    # Sahi configuration file

    proxy.port=my local port number

    # dirs. Relative paths are relative to bin dir. Separate directories with semi-colon

    scripts.dir=../scripts;

    script.extension=sah;sahi;inc

    # default log directory.

    logs.dir=../logs

    # Directory where auto generated ssl cerificates are stored

    certs.dir=../certs/

    # Use external proxy server

    ext.proxy.enable=false

    ext.proxy.host=my local ip address

    ext.proxy.port= my local port number


    When i start sahi.bat file i could see "#set is not recognized as an internal or external command."

    Can you suggest me whether this could be a path setting problem or config properties problem.

    Please suggest me the solution.

    Thanks in advance

    Thanks,

    Suri
  • Hi,

    Are you using the last release or 20080305 one ?
  • surisuri Members
    sorry i cound'nt see properly,
    i am using 20080305 one
  • And basic procedure doesn't work ? You have started the proxy by running sahi.bat ? What does sahi prompt returns ?
  • StringyLowStringyLow Members
    edited July 2008
    Are you setting the proxy configuration in your browser?

    And what OS are you using?

    Here is a link to the tutorial that will help you set up your browser:
    http://sahi.co.in/forums/viewtopic.php?id=205

    And next time, just start post a new message.

    Now back to the original problem...
  • lepierrot

    It sounds to me like you have included the function but aren't calling it anywhere.

    So what's happening is that Sahi parses the script, sees the function but no call to it and just executes the function during parsing.

    Try adding a function call.
  • Hum no function call is present :)
Sign In or Register to comment.