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.
the scripts in browser tag is loaded in a wrong order
I wrote file1.sah and file2.sah and I have some scripts are written in the browser tag in these two files and in file2.sah I includes the file1.sah.
file1.sah
<browser>
_log('file1 in browser tag')
</browser>
_log('file1')
file2.sah
_include("file1.sah");
<browser>
_log('file2 in browser tag')
</browser>
_log('file2')
result
Starting script
file2 in browser tag at Apr 18, 2012 8:11:45 PM
file1 in browser tag at Apr 18, 2012 8:11:45 PM
file1 at Apr 18, 2012 8:11:50 PM
_log('file1') at Apr 18, 2012 8:11:50 PM
file2 at Apr 18, 2012 8:11:51 PM
_log('file2') at Apr 18, 2012 8:11:51 PM
Stopping script
From the above running result, we can say the scripts outside of the browser tags are executed in a correct order (file1 first, then file2) but the scripts in the browser tag are executed in a wrong order (file2 first, then file1).
I need to call the variables/functions in the file1.sah from file2.sah so I need they are executed in a correct order. Is there any way can make the scripts in the browser tag be executed in a correct way?
file1.sah
<browser>
_log('file1 in browser tag')
</browser>
_log('file1')
file2.sah
_include("file1.sah");
<browser>
_log('file2 in browser tag')
</browser>
_log('file2')
result
Starting script
file2 in browser tag at Apr 18, 2012 8:11:45 PM
file1 in browser tag at Apr 18, 2012 8:11:45 PM
file1 at Apr 18, 2012 8:11:50 PM
_log('file1') at Apr 18, 2012 8:11:50 PM
file2 at Apr 18, 2012 8:11:51 PM
_log('file2') at Apr 18, 2012 8:11:51 PM
Stopping script
From the above running result, we can say the scripts outside of the browser tags are executed in a correct order (file1 first, then file2) but the scripts in the browser tag are executed in a wrong order (file2 first, then file1).
I need to call the variables/functions in the file1.sah from file2.sah so I need they are executed in a correct order. Is there any way can make the scripts in the browser tag be executed in a correct way?