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.
Using suites to drive component level sah files (not end to end tests)
Folks,
As part of our ongoing investigation into Sahi, it seems likely that we might want to create something like:
Login.sah - a script to start the browser, and login as a specified user/password
Navigate.sah - a script to click a short sequence of links to get to a given page
DostuffHere.sah - there would be a number of scripts along these lines, each aimed at testing the navigated-to page
Lougout.sah - click logout, and close the browser
This of course, is as opposed to having a single "Dostuffhere.sah" that does the login, navigate, and logout itself.
I know that Suite entries obviously look a bit like:
test.sah urltostartat
Is there a way to have a test.sah that contains something like:
Login.sah username password
Navigate.sah firstlink secondlink thirdlink
DostuffHere.sah param1 param2 param3 etc
Logout.sah
Thanks
Steve
As part of our ongoing investigation into Sahi, it seems likely that we might want to create something like:
Login.sah - a script to start the browser, and login as a specified user/password
Navigate.sah - a script to click a short sequence of links to get to a given page
DostuffHere.sah - there would be a number of scripts along these lines, each aimed at testing the navigated-to page
Lougout.sah - click logout, and close the browser
This of course, is as opposed to having a single "Dostuffhere.sah" that does the login, navigate, and logout itself.
I know that Suite entries obviously look a bit like:
test.sah urltostartat
Is there a way to have a test.sah that contains something like:
Login.sah username password
Navigate.sah firstlink secondlink thirdlink
DostuffHere.sah param1 param2 param3 etc
Logout.sah
Thanks
Steve
Comments
What you need are parametrized functions. Here is an example:
Regards,
Narayan
Thats fine, but in time we would have a huge number of functions, such as login for example would be common across many tests - and so we would need to create funtion libraries.
Is it possible to just do a sort of "include commonfunctions.sah" - or did I read somewhere that each and every function in such a library would need declaring? If so, can you point me to a link on how this is done?!
Many thanks again for your help - you're a star!
Steve
You can move all the common functions into another file and just include it using _include.
Have a look at this: http://sahi.co.in/w/functions and http://sahi.co.in/w/_include
You do not need to declare them explicitly. You just need to include your commonfunctions.sah wherever you need those functions.
Regards,
Narayan
Thanks again Narayan!