<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Sahi - Web Automation and Test Tool - Sahi Tutorial]]></title>
		<link>http://sahi.co.in/forums/viewtopic.php?id=205</link>
		<description><![CDATA[The most recent posts in Sahi Tutorial.]]></description>
		<lastBuildDate>Thu, 11 Jun 2009 08:14:30 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Sahi Tutorial]]></title>
			<link>http://sahi.co.in/forums/viewtopic.php?pid=2891#p2891</link>
			<description><![CDATA[<p>Realized that the tutorial had been truncated to just 2 lines after migration to the new forums. <br />Resurrected from database. Thanks again StringyLow.</p>]]></description>
			<author><![CDATA[dummy@example.com (narayan)]]></author>
			<pubDate>Thu, 11 Jun 2009 08:14:30 +0000</pubDate>
			<guid>http://sahi.co.in/forums/viewtopic.php?pid=2891#p2891</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sahi Tutorial]]></title>
			<link>http://sahi.co.in/forums/viewtopic.php?pid=1964#p1964</link>
			<description><![CDATA[<p>Hi Robin,</p><p>It prints the properties (Props)/attributes of the selected element/accessor and also the functions supported/applicable by/to it.</p><p>Regards,<br />Pankaj.</p>]]></description>
			<author><![CDATA[dummy@example.com (pankaj.nith)]]></author>
			<pubDate>Sun, 15 Feb 2009 11:38:16 +0000</pubDate>
			<guid>http://sahi.co.in/forums/viewtopic.php?pid=1964#p1964</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sahi Tutorial]]></title>
			<link>http://sahi.co.in/forums/viewtopic.php?pid=1959#p1959</link>
			<description><![CDATA[<p>Good Job!&nbsp; &nbsp;But could you explain what the &quot;Props&quot; button does?&nbsp; What is &quot;Props&quot; short for?<br />It looks like it prints HTML or something when pressed.&nbsp; Thanks!</p><p>RR</p>]]></description>
			<author><![CDATA[dummy@example.com (RobinLRandall)]]></author>
			<pubDate>Sun, 15 Feb 2009 00:58:55 +0000</pubDate>
			<guid>http://sahi.co.in/forums/viewtopic.php?pid=1959#p1959</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sahi Tutorial]]></title>
			<link>http://sahi.co.in/forums/viewtopic.php?pid=929#p929</link>
			<description><![CDATA[<p>Try this list:</p><p>http://sahi.co.in/w/help-the-sahi-controller-does-not-come-up</p>]]></description>
			<author><![CDATA[dummy@example.com (StringyLow)]]></author>
			<pubDate>Mon, 25 Aug 2008 17:31:17 +0000</pubDate>
			<guid>http://sahi.co.in/forums/viewtopic.php?pid=929#p929</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sahi Tutorial]]></title>
			<link>http://sahi.co.in/forums/viewtopic.php?pid=928#p928</link>
			<description><![CDATA[<p>Not able to bring up controller except for google.co.in <br />What am I doing wrong here?</p>]]></description>
			<author><![CDATA[dummy@example.com (rangila)]]></author>
			<pubDate>Mon, 25 Aug 2008 16:15:53 +0000</pubDate>
			<guid>http://sahi.co.in/forums/viewtopic.php?pid=928#p928</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sahi Tutorial]]></title>
			<link>http://sahi.co.in/forums/viewtopic.php?pid=755#p755</link>
			<description><![CDATA[<p>i used and checked with machine name instead of localhost</p><p>even though i am not able to bring up controller</p>]]></description>
			<author><![CDATA[dummy@example.com (suri)]]></author>
			<pubDate>Thu, 17 Jul 2008 10:34:36 +0000</pubDate>
			<guid>http://sahi.co.in/forums/viewtopic.php?pid=755#p755</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sahi Tutorial]]></title>
			<link>http://sahi.co.in/forums/viewtopic.php?pid=754#p754</link>
			<description><![CDATA[<p>http://sahi.co.in/w/help-the-sahi-controller-does-not-come-up</p><p>Use machine name instead of localhost if on IE 7.</p>]]></description>
			<author><![CDATA[dummy@example.com (narayan)]]></author>
			<pubDate>Thu, 17 Jul 2008 10:18:47 +0000</pubDate>
			<guid>http://sahi.co.in/forums/viewtopic.php?pid=754#p754</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sahi Tutorial]]></title>
			<link>http://sahi.co.in/forums/viewtopic.php?pid=753#p753</link>
			<description><![CDATA[<p>Hi StringlyLow,</p><p> I have followed same thing.</p><p>Internet Explorer:</p><p>Go to Tools &gt; Internet Options &gt; Connections &gt; LAN Settings &gt; <br />In</p>]]></description>
			<author><![CDATA[dummy@example.com (suri)]]></author>
			<pubDate>Thu, 17 Jul 2008 10:10:22 +0000</pubDate>
			<guid>http://sahi.co.in/forums/viewtopic.php?pid=753#p753</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sahi Tutorial]]></title>
			<link>http://sahi.co.in/forums/viewtopic.php?pid=685#p685</link>
			<description><![CDATA[<p>tinchie, </p><p>I did not understand that comment. Could you explain please?</p>]]></description>
			<author><![CDATA[dummy@example.com (narayan)]]></author>
			<pubDate>Thu, 03 Jul 2008 07:43:52 +0000</pubDate>
			<guid>http://sahi.co.in/forums/viewtopic.php?pid=685#p685</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sahi Tutorial]]></title>
			<link>http://sahi.co.in/forums/viewtopic.php?pid=654#p654</link>
			<description><![CDATA[<p>Another Great Job for StringyLow!</p><p>By the way, can we actually have a node here in the forums both for StringyLow and Narayan?</p>]]></description>
			<author><![CDATA[dummy@example.com (tinchie8)]]></author>
			<pubDate>Sun, 29 Jun 2008 13:06:52 +0000</pubDate>
			<guid>http://sahi.co.in/forums/viewtopic.php?pid=654#p654</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sahi Tutorial]]></title>
			<link>http://sahi.co.in/forums/viewtopic.php?pid=645#p645</link>
			<description><![CDATA[<p>Hi StringyLow,</p><p>Thats really great! It will help all the first timers looking for a tutorial on Sahi.<br />Thanks on behalf of everyone. :)</p><p>Regards,<br />Pankaj.</p>]]></description>
			<author><![CDATA[dummy@example.com (pankaj.nith)]]></author>
			<pubDate>Fri, 27 Jun 2008 08:47:23 +0000</pubDate>
			<guid>http://sahi.co.in/forums/viewtopic.php?pid=645#p645</guid>
		</item>
		<item>
			<title><![CDATA[Sahi Tutorial]]></title>
			<link>http://sahi.co.in/forums/viewtopic.php?pid=641#p641</link>
			<description><![CDATA[<p><strong>Sahi Tutorial</strong></p><p><strong>Introduction</strong></p><p>Sahi is an open source testing tool for web applications, with the facility to record and playback scripts. Developed in Javaâ„¢ and Javascript, this tool uses simple Javascript to execute events in the browser.</p><p>Features:</p><p>In-browser controls <br />Intelligent recorder <br />Text-based scripts <br />Ant support for playback of suites of tests <br />Multi-threaded playback from a command line<br />HTTP and HTTPS support <br />AJAX support </p><p>Sahi runs as a proxy server which intercepts traffic from the web browser and records the web browsing actions. Sahi can play back those recorded actions by injecting Javascript into the browser so it can access elements in the web page. This makes the tool independent of the website/ web application.</p><p>Sahi is similar to Selenium (http://www.openqa.org/selenium-ide/) but is not browser specific like Selenium is.&nbsp; Sahi works with Firefox, Internet Explorer, Opera, and Safari whereas Selenium is Firefox only. In addition, Selenium has to be deployed to the server the web application resides on. Sahi just needs a browser that can display the web application.</p><p>Sahi is released under the <a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License, Version 2.0</a>.</p><br /><p><strong>Prerequisites</strong></p><p>Sahi requires Java 1.4 and above. You can get Java <a href="http://www.java.com/en/">here</a>.</p><br /><p><strong>Installing Sahi</strong></p><p>You can download Sahi and the source code from <a href="http://sourceforge.net/project/showfiles.php?group_id=151639&amp;package_id=167796">here</a>. The latest build (the one at the top of the list) is the one you want.</p><p>Unzip sahi.zip to a convenient directory of your choosing. <em>That&#039;s it!</em></p><br /><p><strong>Running Sahi</strong></p><p>Navigate to the Sahi directory you extracted and:</p><p>Windows: Go to \bin and run sahi.bat<br />Linux and Mac: Go to /bin and run sahi.sh</p><p>The Sahi proxy server will start and begin listening for traffic on port 9999.</p><p><strong>NOTE:</strong> by default Sahi uses port 9999. This can be modified through sahi.properties in the \config directory.</p><p>Now that the Sahi proxy server is running, it&#039;s time to configure the web browser to use it.</p><br /><p><strong>Configuring the browser</strong></p><p>Firefox:<br />Go to Tools &gt; Options &gt; Advanced &gt; Connection Settings &gt; <br />Set to &quot;Manual Proxy Configuration&quot; <br />Set &quot;HTTP Proxy&quot; to &quot;localhost&quot; <br />Set &quot;Port&quot; to &quot;9999&quot;. <br />Do the same for &quot;SSL Proxy&quot; too, if you wish to record and playback HTTPS traffic<br />Keep &quot;Use the same proxy for all protocol&quot; unchecked as Sahi does not understand protocols other than HTTP </p><p>NOTE: &quot;No Proxy for&quot; should NOT have localhost or 127.0.0.1 or the domain of the test application in it.</p><p>Internet Explorer:</p><p>Go to Tools &gt; Internet Options &gt; Connections &gt; LAN Settings &gt; <br />In &quot;Proxy server&quot; section, check &quot;Use a proxy server for your LAN&quot; <br />Set &quot;Address&quot; to &quot;localhost&quot; <br />Set &quot;Port&quot; to &quot;9999&quot; <br />Leave &quot;Bypass proxy server for local addresses&quot; unchecked <br />Click OK &gt; OK</p><br /><p>Opera:</p><p>Go to Tools &gt; Preferences &gt; Network<br />Click &quot;Proxy servers&quot; button<br />Check &quot;HTTP&quot;<br />Enter localhost in the textbox<br />Enter &quot;9999&quot; for Port <br />Click Ok &gt; Ok<br />Repeat the above if you wish to record and playback HTTPS traffic</p><p>Safari:</p><p>Go to Edit &gt; Preferences<br />Select &quot;Advanced&quot;<br />click &quot;Change Settings&quot; for Proxies<br />Click &quot;LAN Settings&quot; button<br />In &quot;Proxy server&quot; section, check &quot;Use a proxy server for your LAN&quot; <br />Set &quot;Address&quot; to &quot;localhost&quot; <br />Set &quot;Port&quot; to &quot;9999&quot; <br />Leave &quot;Bypass proxy server for local addresses&quot; unchecked <br />Click OK &gt; OK</p><br /><p><strong>Testing with Sahi</strong></p><p>Now that the Sahi proxy server is running and the web browser is configured to talk to the proxy, it is time to start using Sahi! We&#039;ll start out by using Sahi to navigate a webpage:</p><p>Open http://www.Google.com/ in your web browser<br />After Google loads, hold down the Ctrl and Alt keys and then double-click the web page.</p><p>The Sahi Controller should now appear:</p><p><span class="postimg"><img src="http://i179.photobucket.com/albums/w288/stringylow/Sahi/Tutorial/1SahiController.png" alt="http://i179.photobucket.com/albums/w288/stringylow/Sahi/Tutorial/1SahiController.png" /></span></p><p>The Sahi Controller has two tabs: Record and Playback. We will start by recording the navigation steps.</p><p>The &quot;Script Directory&quot; field shows you where the script will be saved. By default Sahi saves to the &quot;scripts&quot; directory.</p><p><strong>NOTE:</strong> This directory can be changed via sahi.properties in the &quot;config&quot; directory. </p><p>Enter &quot;Test&quot; in the &quot;Script Name&quot; text field and press the &quot;Record&quot; button<br />In the web browser, enter &quot;Sahi&quot; in the Google search box<br />Now click the &quot;Google Search&quot; button<br />Click the &quot;Stop&quot; button in the Sahi Controller</p><p>So far, so good!</p><p>Now to play back what we just recorded:</p><p>Click the &quot;Playback&quot; tab in the Sahi Controller<br />Select &quot;Test.sah&quot; in the &quot;File&quot; selection list<br />Enter &quot;http://www.Google.com/&quot; in the &quot;Start URL&quot; text field<br />Click the &quot;Set&quot; button<br />Wait for the web page in the browser to reload<br />Click the &quot;Play&quot; button</p><p><span class="postimg"><img src="http://i179.photobucket.com/albums/w288/stringylow/Sahi/Tutorial/2SahiController.png" alt="http://i179.photobucket.com/albums/w288/stringylow/Sahi/Tutorial/2SahiController.png" /></span></p><p>The web browser loads the Google search page, &quot;Sahi&quot; is entered in the search box, and the button &quot;Google Search&quot; is clicked. </p><p>Clicking &quot;Set&quot; loaded the test script and opened the target page for the start of the test.</p><p>Sahi entered &quot;Shai&quot; into the textbox named &quot;q&quot; using the following statement:<br /> _setValue(_textbox(&quot;q&quot;), &quot;Sahi&quot;);</p><p>After the text was entered, Sahi click the submit button labeled &quot;Google Search&quot; with this statement:<br />&nbsp; &nbsp; _click(_submit(&quot;Google Search&quot;));</p><p>And finally Sahi signaled that the test was successful:<br />&nbsp; &nbsp; --Stopped Playback: SUCCESS--</p><p>Leave the Google results page open and we&#039;ll add a test to find an image on the page....</p><p>Click the &quot;Record&quot; tab again<br />Enter &quot;Test&quot; in the &quot;Script Name&quot; text box<br />Click the &quot;Record&quot; button<br />Hold down the &quot;Ctrl&quot; key and move the mouse cursor over the link for &quot;Sahi&quot; in the search results<br />Click the &quot;Assert&quot; button<br />Click the &quot;Text --&gt;&quot; button<br />Click the &quot;Apend to Script&quot; button<br />Finally, click the Stop button</p><p><span class="postimg"><img src="http://i179.photobucket.com/albums/w288/stringylow/Sahi/Tutorial/3SahiController.png" alt="http://i179.photobucket.com/albums/w288/stringylow/Sahi/Tutorial/3SahiController.png" /></span></p><p>Notice that the &quot;Accessor&quot; and &quot;Alternative&quot; fields have been filled in.</p><p>The &quot;Accessor&quot; indicates that Sahi found the link by the text it contains. </p><p>The &quot;Alternative&quot; indicates where Sahi found the link in the Document Object Model hierarchy.</p><p>Clicking the &quot;Assert&quot; button added a condition stating that we believe the link &quot;Sahi&quot; exists on the web page. By clicking the &quot;Test --&gt;&quot; button, we asked Sahi to verify that the link existed. The link did exist and to Sahi answered &quot;true&quot;. We added the assert to the script.<br />Let&#039;s run the script again with the assert added to it:</p><p><span class="postimg"><img src="http://i179.photobucket.com/albums/w288/stringylow/Sahi/Tutorial/4SahiController.png" alt="http://i179.photobucket.com/albums/w288/stringylow/Sahi/Tutorial/4SahiController.png" /></span></p><p><em>Success!</em> </p><p>We are now able to open a web page, fill in a form, submit the form, and test the results.</p><p>You are encouraged to experiment with setting assertions for different web page elements and testing for them with Sahi scripts.</p><br /><p><strong>A Closer Look At The Sahi Controller</strong></p><p>Let&#039;s find out what the other buttons on the Record tab do...</p><p>Open http://www.Google.com/ in the browser again<br />Click the &quot;Record&quot; tab in the Sahi Controller<br />Hold down the &quot;Ctrl&quot; key and hover the mouse over the Google search box.<br />Click the &quot;Props&quot; button in the Sahi Controller</p><p>The &quot;evaluate expression&quot; box displays the properties of the Google search box. </p><p>You can expand the Sahi Controller by dragging the corners if you need more reading area.</p><p>Click the &quot;Hilight&quot; button</p><p>A red box highlights the search box. This is good technique to use if other people will be using your Sahi scripts so they know what is being tested.</p><p>In the &quot;Value&quot; text box, enter &quot;Sahi is great&quot;<br />Click the &quot;Set&quot; button</p><p>The Sahi Controller enters &quot;Sahi&quot; in to the Google search box.</p><p>Hold down the &quot;Ctrl&quot; key and hover the mouse over the &quot;Google Search&quot; button<br />Click the &quot;Click&quot; button</p><p>The Sahi Controller clicks the button for you and the browser navigates to the search results.</p><p>If for some reason you need a Sahi script to pause, you can insert a &quot;Wait&quot; for a specified number of milliseconds (1000 ms = 1 second).</p><p><span class="postimg"><img src="http://i179.photobucket.com/albums/w288/stringylow/Sahi/Tutorial/5SahiController.png" alt="http://i179.photobucket.com/albums/w288/stringylow/Sahi/Tutorial/5SahiController.png" /></span></p><p>You can also add comments to your script to denote sections, what you are trying to test, etc.... A comment is started with &quot;//&quot;.</p><p><span class="postimg"><img src="http://i179.photobucket.com/albums/w288/stringylow/Sahi/Tutorial/6SahiController.png" alt="http://i179.photobucket.com/albums/w288/stringylow/Sahi/Tutorial/6SahiController.png" /></span></p><p>Click the &quot;API List&quot; text box and enter an &quot;_&quot; to view a list of the functions you can use to drive the web browser.</p><p>Let&#039;s go check out the rest of the Playback tab...</p><p><span class="postimg"><img src="http://i179.photobucket.com/albums/w288/stringylow/Sahi/Tutorial/7SahiController.png" alt="http://i179.photobucket.com/albums/w288/stringylow/Sahi/Tutorial/7SahiController.png" /></span></p><p>At the top of the tab you have the option telling Sahi where to load the test scripts from.</p><p>By default, Sahi loads scripts from the location listed.&nbsp; This directory can be changed via sahi.properties in the &quot;config&quot; directory</p><p>You can share tests across a team by putting the test scripts on a web server instead of copying the tests to each workstation.</p><p>Click the &quot;from url&quot; link at the top of the &quot;Playback&quot; tab</p><p><span class="postimg"><img src="http://i179.photobucket.com/albums/w288/stringylow/Sahi/Tutorial/8SahiController.png" alt="http://i179.photobucket.com/albums/w288/stringylow/Sahi/Tutorial/8SahiController.png" /></span></p><p>Enter the URL of the test script (e.g. http://www.example.com/Test.sah)<br />Enter the &quot;Start URL&quot; (e.g. http://www.Google.com/)<br />Click &quot;Set&quot;</p><p>The process should be familiar to you...</p><p>At the bottom of the Playback tab you will find:</p><p>View Script<br />View Parsed Script<br />View Queue<br />View Logs</p><p>Click &quot;View Script&quot; and a copy of the test script currently loaded for play back is displayed in the web brower.</p><p>&quot;View Parsed Script&quot; will display the actual code that will executed by Sahi. This is used for debugging and is not much use unless you are actively developing Sahi features.</p><p>&quot;View Queue&quot; will display the commands being processed by Sahi. Again, this is used for debugging and is not much use unless you are actively developing Sahi features.</p><p>The &quot;View Logs&quot; link is interesting. Clicking it will display a web page with links to the results of test runs performed by Sahi. The test logs are stored by default in the Sahi &quot;/logs/playback&quot; directory. </p><p>As usual, you can change where Sahi stores the execution logs by modifying sahi.properties in the &quot;config&quot; directory.</p><br /><p><strong>Conclusion</strong></p><p>That wraps up the tutorial for Sahi!</p><p>You should now know how to:</p><p>Install Sahi<br />Configure your browser to use Sahi<br />Use Sahi to record scripts<br />Find page web page elements<br />Test for success using assertions<br />View test logs</p><p>You are encouraged to review the Sahi API. Sahi provides a robust feature set to assist you in automating your web application testing efforts.</p><p>You are also encouraged to visit the support forum at <a href="http://sahi.co.in/forums/index.php">http://sahi.co.in/forums/index.php</a> for help and to contribute to the Sahi community.</p><p>Good luck!</p>]]></description>
			<author><![CDATA[dummy@example.com (StringyLow)]]></author>
			<pubDate>Thu, 26 Jun 2008 22:38:59 +0000</pubDate>
			<guid>http://sahi.co.in/forums/viewtopic.php?pid=641#p641</guid>
		</item>
	</channel>
</rss>
