18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
How to call a specific function in a file from another file
Hi,
In my script file i use _include("count.sah");
this count.sah file contains five functions but i want to call only one function to execute.
but when i run my script file these five functions present inside the count.sah file also execute one by one.
after including the count.sah file, i call only one function like,
count_five();.but all other functions are also execute.
Regards,
Debakanta
In my script file i use _include("count.sah");
this count.sah file contains five functions but i want to call only one function to execute.
but when i run my script file these five functions present inside the count.sah file also execute one by one.
after including the count.sah file, i call only one function like,
count_five();.but all other functions are also execute.
Regards,
Debakanta
Comments
Can you post the contents of the script count.sah?
Regards
Sumitra
if you defined the functions as they shouldn't execute when included. Did you do so?
I am also facing the same problem, I need to call only one of the function from my nr_common.sah
How can I call a particular function to other script?
Can you post the contents of nr_common.sah.This problem may occur,if there is function call to all the function declared in nr_common.sah file.
Regards
Theeran.
I am facing the same problem. Below i mention the scenario:
there is sahi file (Libs.sah), this file contains lots of functions say (function1(), function2(), function3()....and lots more).
and there is one more sahi file (CallTestCase.sah). here my query is when i execute this .sah file, i just want function2() need to be called or run from Libs.sah file. but actually i am unable to do so.
Could anyone there please help me out and tell me about how to call a specific function in a sahi file from another sahi file?
Regards,
Deepak Verma
this should really be no problem, just use _include("Libs.sah") and then use function2() as you would usually do. Try to run CallTestCase.sah from the controller. Then click at "view parsed script" on the bottom of the controller. You will see that _include() will just insert your Libs.sah and will therefor make every function in Libs.sah available for CallTestCase.sah. The only problem could be a wrong path to the file, but Sahi should mention that...