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.

Unable to run scripts through command prompt

manasa.msmanasa.ms Members
edited November -1 in Sahi - Open Source
HI,
i have recorded a script and is placed in scripts folder but when i try to run the same .sah file from command prompt, only the first line of the script is executed successfully i.e, _navigateTo("url") the corresponding web page is opened.
but failed to execute the remaining lines of recorded script....
Am using SAHI OS on ubuntu machine, and Firefox

command i executed :
#:/home/trainee/sahi/userdata/bin# ./testrunner.sh /home/sahi/userdata/scripts/new.sah http://raktadan.org/ firefox
test=scripts//home/sahi/userdata/scripts/new.sah

stuff am getting in the prompt :

browserType=firefox
baseURL=http://raktadan.org/
host=localhost
port=9999
threads=5
useSingleSession=false

suiteName = scripts//home/sahi/userdata/scripts/new.sah
base = http://raktadan.org/
sahiHost = localhost
port = 9999
threads = 5
browserType = firefox
this.isSingleSession == false
Added shutdown hook.
http://localhost:9999/_s_/dyn/Suite_start?suite=scripts//home/trainee/sahi/userdata/scripts/raktadan_new.sah&base=http://raktadan.org/&threads=5&sahisid=sahi_f7d528d30e0ff042450ab7c00bf7dd230847&browserType=firefox&html=
FAILURE
Shutting down ...

Comments

  • spchinspchin Members
    When I run scripts from the command prompt I put them in a .suite file first. What you need in the .suite file is:

    script. sah <starting URL>

    Then the suite file is referenced from the testrunner.bat file.
  • Hi spchin,
    I want to run only one script , so no need to create any suite i think. But as you suggested i created a suite file and added my script name and url in suite file, now it is not possible to open the url even.
    While running a .suite file do i have to edit "testrunner.sh" file or what.
  • Hey
    Now am able to run the script from command prompt syntax that i followed is
    ./testrunner.sh scriptname.sah url browsertype

    Its working/...
This discussion has been closed.