<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>suites — Sahi Pro Community</title>
        <link>https://community.sahipro.com/forums/</link>
        <pubDate>Fri, 13 Nov 2026 03:49:17 +0000</pubDate>
        <language>en</language>
            <description>suites — Sahi Pro Community</description>
    <atom:link href="https://community.sahipro.com/forums/discussions/tagged/suites/feed.rss" rel="self" type="application/rss+xml"/>
    <item>
        <title>Modularization of the Test Scripts</title>
        <link>https://community.sahipro.com/forums/discussion/1065/modularization-of-the-test-scripts</link>
        <pubDate>Tue, 07 Jul 2009 11:19:13 +0000</pubDate>
        <category>Sahi - Open Source</category>
        <dc:creator>n_narayanan</dc:creator>
        <guid isPermaLink="false">1065@/forums/discussions</guid>
        <description><![CDATA[Hi<br />
<br />
I was trying to make a test suite by modularizing. Here is the summary<br />
<br />
I have created 3 test scripts<br />
<br />
1) MainScript.sah<br />
2) Login.sah<br />
3) IndustryMasterAdd.sah (Add a record to one master screen)<br />
<br />
Here is the name and script<br />
<br />
MainScript.sah<br />
===========<br />
_include(&quot;Login.sah&quot;);<br />
_setGlobal(&quot;LoginSuccess&quot;,&quot;0&quot;); //Set to false initially. This will set to true after successful login<br />
_setGlobal(&quot;productname&quot;,&quot;My Application v3.9.5.0&quot;);<br />
Login(&quot;admin&quot;,&quot;admine4#&quot;,_getGlobal(&quot;productname&quot;));<br />
if (_getGlobal(&quot;LoginSuccess&quot;)==&quot;1&quot;)<br />
{<br />
_include(&quot;IndustryMasterAdd.sah&quot;);<br />
IndustryMasterAdd('ABCIND','ABC INDUSTRIES LIMITED');<br />
}<br />

<hr />
In the above script I am using LoginSuccess as a global variable. Once a login is successful I will set 1 to this variable<br />
Also since the product version keep changing I want to use a global variable called productname and use it in the other scripts whereever required
<hr />
<br />
Login.sah<br />
========<br />
<br />
function Login($username=&quot;admin&quot;,$userpwd=&quot;admine4#&quot;,$pname=&quot;My App v3.9.5.0&quot;)<br />
{<br />
//Script by Narayanan Neelakantan 07-Jul-2009<br />
//The below 4 lines to test login screen is visible<br />
_popup($pname)._assertExists(_div(&quot;User Id&quot;));<br />
_popup($pname)._assertContainsText(&quot;User Id&quot;, _div(&quot;User Id&quot;));<br />
_popup($pname)._assertExists(_div(&quot;Password&quot;));<br />
_popup($pname)._assertContainsText(&quot;Password&quot;, _div(&quot;Password&quot;));<br />
//The above 4 lines to test login screen is visible<br />
_popup($pname)._setValue(_textbox(&quot;loginName&quot;), $username);<br />
_popup($pname)._setValue(_password(&quot;password&quot;), $userpwd);<br />
_popup($pname)._click(_link(&quot;Login&quot;));<br />
_popup($pname)._assertExists(_link(&quot;Main page&quot;)); // If login is success then the main page comes<br />
if (_popup($pname)._assertExists(_link(&quot;Main page&quot;)))<br />
{<br />
_log(&quot;Login Success&quot;,&quot;success&quot;);<br />
_setGlobal(&quot;LoginSuccess&quot;,&quot;1&quot;);<br />
}<br />
else<br />
{<br />
_log(&quot;Login Failure&quot;,&quot;Failure&quot;);<br />
_setGlobal(&quot;LoginSuccess&quot;,&quot;0&quot;);<br />
}<br />
}<br />

<hr />
IndustryMasterAdd.sah<br />
=================<br />
<br />
function IndustryMasterAdd($sname, $lname)<br />
{<br />
_popup(_getGlobal(&quot;productname&quot;))._click(_div(&quot;el2&quot;));<br />
_popup(_getGlobal(&quot;productname&quot;))._click(_div(&quot;el75&quot;));<br />
_popup(_getGlobal(&quot;productname&quot;))._click(_link(&quot;Add&quot;));<br />
_popup(_getGlobal(&quot;productname&quot;))._setValue(_textbox(&quot;txtIndustryName&quot;), $sname);<br />
_popup(_getGlobal(&quot;productname&quot;))._setValue(_textbox(&quot;txtIndustryDesc&quot;), $lname);<br />
_popup(_getGlobal(&quot;productname&quot;))._click(_link(&quot;Save&quot;));<br />
_popup(_getGlobal(&quot;productname&quot;))._assertExists(_cell(&quot;Add Delete Back&quot;));<br />
_log(&quot;Industry Addition Success&quot;,&quot;success&quot;);<br />
}<br />

<hr />
Now when I play the MainScript.sah, I am getting the following message<br />
<br />
--Stopped Playback: SUCCESS--<br />
<br />
What should be the problem?<br />
<br />
The following is the output of the log file
<hr />
Test Total Steps Failures Errors Success Rate<br />
<br />
MainScript.sah 0 0 0 100%<br />
<br />
<br />
Starting script<br />
Stopping script<br />

<hr />
<br />
I would appreciate if you can help me.<br />
<br />
Regards<br />
Narayanan<br />
<br />
Regards<br />
Narayanan]]>
        </description>
    </item>
   </channel>
</rss>
