<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>My Thought Pot &#187; .net</title>
	<atom:link href="http://www.mythoughtpot.com/category/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mythoughtpot.com</link>
	<description>Thoughts of a constantly evolving programmer</description>
	<lastBuildDate>Thu, 11 Feb 2010 05:52:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Selenium RC with .Net 3.0</title>
		<link>http://www.mythoughtpot.com/2008/05/27/selenium-rc-with-net-30/</link>
		<comments>http://www.mythoughtpot.com/2008/05/27/selenium-rc-with-net-30/#comments</comments>
		<pubDate>Wed, 28 May 2008 06:27:21 +0000</pubDate>
		<dc:creator>kiran</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[selenium]]></category>

		<guid isPermaLink="false">http://www.mythoughtpot.com/?p=7</guid>
		<description><![CDATA[Seems like a sidetrack from my work. I was helping out my wife in setting up Selenium-RC with C# client driver. However the documentation assumes everyone is using .Net 2.0. So I wanted to share what I have done to achieve the same with C# 3.0. Here are the steps,
Requirements

JDK 1.5, to run selenium rc [...]]]></description>
			<content:encoded><![CDATA[<p>Seems like a sidetrack from my work. I was helping out my wife in setting up <a href="http://selenium-rc.openqa.org/">Selenium-RC</a> with C# client driver. However the documentation assumes everyone is using .Net 2.0. So I wanted to share what I have done to achieve the same with C# 3.0. Here are the steps,</p>
<p><b>Requirements</b></p>
<ol>
<li>JDK 1.5, to run selenium rc server</li>
<li>Visual Studio 2008 (obviously)</li>
<li>Selenium RC, and </li>
<li><a href="http://www.nunit.org/index.php">Nunit</a></li>
</ol>
<p><b>Steps</b></p>
<ol>
<li>Create a sample C# class library, say SeleniumSample</li>
<li>Change the build target framework to .Net 2.0. To do that go to Project &gt; SeleniumSample Properties and select .Net Framework 2.0 under Target Framework drop down</li>
<li>Remove the non .Net Framework 2.0 references, namely Linq etc.</li>
<li>Clean and Rebuild the solution, fix the using errors</li>
<li> Add the following class (GoogleTest) to test selenium
<pre class="brush: csharp;">
using System;
using NUnit.Framework;
using Selenium;

namespace SeleniumSample
{
    [TestFixture]
	public class GoogleTest
	{
		private ISelenium selenium;

		[SetUp]
		public void SetupTest()
		{
			selenium = new DefaultSelenium(&quot;localhost&quot;, 4444, &quot;*iexplore&quot;, &quot;http://www.google.com&quot;);
			selenium.Start();
		}

		[TearDown]
		public void TeardownTest()
		{
			selenium.Stop();
		}

		[Test]
		public void GoogleSearch()
		{
			selenium.Open(&quot;http://www.google.com/webhp&quot;);
			Assert.AreEqual(&quot;Google&quot;, selenium.GetTitle());
			selenium.Type(&quot;q&quot;, &quot;Selenium OpenQA&quot;);
			Assert.AreEqual(&quot;Selenium OpenQA&quot;, selenium.GetValue(&quot;q&quot;));
			selenium.Click(&quot;btnG&quot;);
			selenium.WaitForPageToLoad(&quot;5000&quot;);
			Assert.IsTrue(selenium.IsTextPresent(&quot;www.openqa.org&quot;));
			Assert.AreEqual(&quot;Selenium OpenQA - Google Search&quot;, selenium.GetTitle());
		}
	}
}
</pre>
</li>
<li> Rebuild the solution </li>
<li> Now open Nunit-Gui, Program Files > Nunit X.Y.Z > Nunit Gui (.Net 2.0)</li>
<li>Do File > Open Project and select the SeleniumSample.dll which should be in projects bin directory</li>
<li> Now you should see the test class GoogleTest with GoogleSearch test case under it.</li>
<li>Open an command window and cd to directory where you downloaded and extracted selenium rc</li>
<li> cd to selenium-server-1.0-beta-1</li>
<li> run java -jar selenium-server.jar, check that the server is running and listening on port 4444</li>
<li>Now back to Nunit-GUI, start the tests by clicking on run. This should launch internet explorer and run the steps/checks mentioned in the above code</li>
<li>Feel free to add more test cases and then back in Nunit-gui do File > Reload Project and re-run the  tests</li>
</ol>
<p><i>Happy Testing</i></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mythoughtpot.com/2008/05/27/selenium-rc-with-net-30/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
