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 _include statements when there are multiple folders.

SreekanthSreekanth Members
edited April 2013 in Sahi - Open Source
Hello All,

Our project is named “Project_Atlas” and there are 19 files which are placed in various sub-folders. For example, I have got exports_message.sah, exports_status.sah and exports_log.sah in exports folder. imports_message.sah, imports_status.sah and imports_log.sah in imports folder. Exports and imports are sub-folders of Project_Atlas. We start our package using “package.sah” file which is under folder Project_Atlas.

A picture of folder structure:
http://s9.postimg.org/pg90wjpfj/sahi_folder.jpg

This is the order in which we include other sahi files. First is Login.sah and second is Functions.sah, both of which are called from “package.sah“ using include API and both these files are under folder “Project_Atlas\Supports”, third file to be included is exports_messages.sah which is under “Project_Atlas\Exports” folder.

Evenything works find if I give full path, like _include("D:/SAHI_Application/userdata/scripts/Project_Atlas/package.sah");
But, if I modify include statement like this _include("scripts/Project_Atlas/package.sah");. Sahi will say exports_messages.sah not found. It’s looking for exports_messages.sah under “scripts/Project_Atlas/Supports/Exports/”

I believe, this is happening because, sahi first sets path as scripts/Project_Atlas/Supports/ from where it takes first and second file. Then to take third file it assumes that there is another folder under supports. It should be going back to parent folder first.

Again, we are trying to configure Jenkins. When we build using Jenkins, it takes a fresh checkout of the entire project from subversion and then works on it. Now Jenkins saves checked out files into location “D:\Jenkins\jobs\SAHI3\workspace\sahiatlas\trunk\ Project_Atlas”. As you can see, the path given in include statements and the path of Jenkins are lot different. Again I get error, file not found.


So I was wondering if there was any way through which I can specify path of sahi files. I don’t know if anyone else have experience it. I did search for this in sahi forum and had actually posted something similar previously.
http://sahi.co.in/forums/discussion/4775/is-it-possible-to-set-a-default-path-for-sahi-#Item_1

This time I have given few examples hoping to make it a little clearer.
It will be great help if anyone can help me on this and has got a solution for this.

SAHI Version is: SAHI Open source 4.2
Browser is firefox:20
OS: windows8.


Thanks & Regards,
Sreekanth.

Best Answer

Sign In or Register to comment.