<?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>SeleniumExamples &#187; new release</title>
	<atom:link href="http://seleniumexamples.com/blog/tag/new-release/feed/" rel="self" type="application/rss+xml" />
	<link>http://seleniumexamples.com/blog</link>
	<description>Examples and tips for Selenium</description>
	<lastBuildDate>Thu, 10 Mar 2011 15:29:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Another successful Selenium meetup in London!</title>
		<link>http://seleniumexamples.com/blog/events/another-successful-selenium-meetup-in-london/</link>
		<comments>http://seleniumexamples.com/blog/events/another-successful-selenium-meetup-in-london/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 14:56:12 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[london]]></category>
		<category><![CDATA[meetup]]></category>
		<category><![CDATA[new release]]></category>
		<category><![CDATA[selenium 2]]></category>

		<guid isPermaLink="false">http://seleniumexamples.com/blog/?p=109</guid>
		<description><![CDATA[Last night was the second London Selenium Users meetup. In contrast to the last one &#8211; a purely social event in a pub in Fitzrovia &#8211; this one was hosted by Google with talks from myself, David Burns (The Automated Tester), Eran Messeri (Google), and a Q&#38;A with Simon Stewart (Google). I arrived at Google&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Last night was the second London Selenium Users meetup. In contrast to the last one &#8211; a purely social event in a pub in Fitzrovia &#8211; this one was hosted by Google with talks from myself, <a href="http://www.theautomatedtester.co.uk/">David Burns (The Automated Tester)</a>, Eran Messeri (Google), and a Q&amp;A with Simon Stewart (Google).</p>
<p>I arrived at Google&#8217;s London HQ (or Googleplex) at 18:00 to meet with Eran and Simon &#8211; who was only around thanks to the cloud of volcanic ash preventing him from flying out to New York! After a quick tour of the offices, and a brief label-off (I lost) people started to arrive. They were early &#8211; definitely a good sign!</p>
<p>I was the first to present, and I&#8217;m not used to speaking in-front of an audience, but my preparation and practise paid off as I feel my presentation went well. My talk covered a suggested migration path from Selenium IDE to Selenium 2 using my WebDriver Backed Formatters plugin for IDE, and contained live demos. After a few questions my presentation was over and I could relax!</p>
<div style="text-align:center"><a href="http://seleniumexamples.com/blog/wp-content/uploads/2010/04/googleplex.jpg"><img style="margin-right:1em;" class="size-thumbnail wp-image-121" title="Google's London HQ" src="http://seleniumexamples.com/blog/wp-content/uploads/2010/04/googleplex-150x150.jpg" alt="Google's London HQ" width="150" height="150" /></a><a href="http://seleniumexamples.com/blog/wp-content/uploads/2010/04/daveh.jpg"><img class="size-medium wp-image-119" title="Presenting at the second London Selenium Users group" src="http://seleniumexamples.com/blog/wp-content/uploads/2010/04/daveh-150x150.jpg" alt="Presenting at the second London Selenium Users group" width="150" height="150" /></a></div>
<p>David Burns next took to the stage with his presentation on what Selenium 2 means to the average QA. There was a short delay in getting started (which I understand we&#8217;re blaming Eran for, but might be more to do with David not using a Macbook <img src='http://seleniumexamples.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ). Before long David&#8217;s talk was under way. Of particular interest were the demos, where by simply switching a test to use Selenium 2 he solved one of the most irritating limitations of Selenium 1 &#8211; typing into a rich text editor! This was followed by solving another limitation, with a demo that entered a file name into a &lt;input type=&#8221;file&#8221;&gt; field. After a few more questions for both David and Simon, the second presentation came to an end.</p>
<p>After our final break Eran gave a short presentation of his current work on an advanced user interactions API, which is something I&#8217;m looking forward to for testing complex Ajax applications with rich interfaces. The idea being that you can combine several actions such as &#8216;Hold shift, click down on element X, and drag it onto element Y&#8217;. Also mentioned was the mobile (or &#8216;Fingers&#8217;) interactions API to support swiping, pinching, etc. A very good talk, and proof (if needed) that Google are taking the future of Selenium very seriously &#8211; there&#8217;s a lot of work going into it!</p>
<p>Earlier on in the evening Simon had asked for questions to be written on the whiteboard, and instead of his planned talk &#8211; which he&#8217;d mostly given all of the details out as answers to questions throughout the evening &#8211; he worked his way through the list. The questions included: testing Ajax applications using Selenium 2 (you can), is the Selenium IDE dead (no), is Selenese dead (not quite), and does Selenium Grid support Selenium 2 (not yet).</p>
<p>After the Q&amp;A it there was just time for some more refreshments, but then I had to then start my journey home. I hear those that stayed had some lively discussions in the nearby pub about dynamic Firefox instances and the like, with Google buying everyone one more beer!</p>
<p>Feedback on the event has so far been very positive, and I&#8217;d like to thank everyone that came along &#8211; there were some interesting questions, and a good range of Selenium experience in the room.</p>
<p>It was a thoroughly enjoyable event and I&#8217;d like to thank Google for being such awesome hosts, Simon for all of his efforts and question answering, Eran Messeri for his great work on the project and for sharing some of that with us, and David Burns for his presentation and demos.</p>
<p>I would also like to thank Jérémy Hérault (Selenium committer) and Kévin Pollet (creator of Helium plugin for Selenium IDE) for coming along &#8211; they were travelling for 8 hours to get to the event and had to do a return journey the same day! I hope it hasn&#8217;t put you off coming to future events guys!</p>
<p>Slides, notes, demos, videos (possibly), all to follow!</p>
]]></content:encoded>
			<wfw:commentRss>http://seleniumexamples.com/blog/events/another-successful-selenium-meetup-in-london/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Selenium IDE &#8211; My plugin baby</title>
		<link>http://seleniumexamples.com/blog/plugins/selenium-ide-my-plugin-baby/</link>
		<comments>http://seleniumexamples.com/blog/plugins/selenium-ide-my-plugin-baby/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 09:28:53 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[new release]]></category>
		<category><![CDATA[selenium ide]]></category>

		<guid isPermaLink="false">http://seleniumexamples.com/blog/?p=97</guid>
		<description><![CDATA[With last month&#8217;s release of Selenium IDE 1.0.4 came initial support for plugins, and this month&#8217;s release of 1.0.5 continues to build on the new plugin API as well as fixing a few bugs. This is quite possibly the most exciting development in Selenium IDE in a long time, and the best thing is that [...]]]></description>
			<content:encoded><![CDATA[<p>With <a href="http://saucelabs.com/blog/index.php/2010/01/selenium-ide-1-0-4-is-released/">last month&#8217;s release of Selenium IDE 1.0.4</a> came initial support for plugins, and <a href="http://saucelabs.com/blog/index.php/2010/02/selenium-ide-1-0-5-is-released/">this month&#8217;s release of 1.0.5</a> continues to build on the new plugin API as well as fixing a few bugs.</p>
<p>This is quite possibly the most exciting development in Selenium IDE in a long time, and the best thing is that it enables users to come up with their own improvements &#8211; in much the same way as <a href="http://www.greasespot.net/">Greasemonkey</a> or Firefox addons themselves. The possibilities are endless.</p>
<p>Adam Goucher continues to post guidance on creating plugins <a href="http://adam.goucher.ca/?s=The+Selenium-IDE+1.x+plugin+API">on his blog</a> as the API evolves. I have followed these myself to create two plugins:</p>
<ul>
<li><strong>Flow control</strong> &#8211; This is actually just an old Selenium user extension that I&#8217;ve repackaged into a plugin. Two main advantages of doing this are: an easy install/disable/uninstall process, and no messing around with JavaScript files! [<a title="Download Flow Control Plugin for Selenium IDE" href="https://addons.mozilla.org/en-US/firefox/downloads/file/81157/selenium_ide__flow_control-1.0.1-fx.xpi" onClick="javascript: pageTracker._trackPageview('/downloads/flowcontrol');">install</a>] [<a href="http://github.com/davehunt/selenium-ide-flowcontrol">public repository</a>]</li>
<li><strong>WebDriver Backed Selenium Formatters</strong> &#8211; This is a formatter plugin that provides the Selenium emulation from WebDriver, giving quick access to WebDriver&#8217;s advantages without changing from the existing Selenium API. [<a title="Download WebDriver Backed Formatters Flow Control Plugin for Selenium IDE" href="https://addons.mozilla.org/en-US/firefox/downloads/file/81150/selenium_ide__webdriver_backed_formatters-1.0.1-fx.xpi" onClick="javascript: pageTracker._trackPageview('/downloads/webdriver-backed-formatters');">install</a>] [<a href="http://github.com/davehunt/selenium-ide-webdriver-backed-formatters">public repository</a>]</li>
</ul>
<p>These plugins are available to download from SeleniumExamples, and you can view the source/report issues/provide feedback via the GitHub repositories.</p>
<p>Let SeleniumExamples know if you&#8217;re developing your own plugin, or have any good ideas. I&#8217;ll be happy to review, host, or link to your plugins &#8211; most of all we want to encourage plugin development.</p>
<p><strong>Update:</strong><br />
Plugins now made available via addons.mozilla.org:</p>
<ul>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/85794">Flow Control</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/85793">WebDriver Backed Selenium Formatters</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://seleniumexamples.com/blog/plugins/selenium-ide-my-plugin-baby/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Selenium 2 Examples</title>
		<link>http://seleniumexamples.com/blog/examples/selenium-2-examples/</link>
		<comments>http://seleniumexamples.com/blog/examples/selenium-2-examples/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 10:23:28 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[new release]]></category>
		<category><![CDATA[selenium 2]]></category>
		<category><![CDATA[webdriver]]></category>

		<guid isPermaLink="false">http://seleniumexamples.com/blog/?p=89</guid>
		<description><![CDATA[Yesterday Selenium 2 (alpha 1) was released. This is the first release since the Selenium and WebDriver projects started to merge. The main difference is the inclusion of the WebDriver API into Selenium. I&#8217;ve put together a small example below that uses the new API to log into two web based e-mail clients and send [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday <a href="http://groups.google.co.uk/group/selenium-developers/browse_thread/thread/ef3897dd08c1ab2e">Selenium 2 (alpha 1) was released</a>. This is the first release since the Selenium and WebDriver projects started to merge. The main difference is the inclusion of the WebDriver API into Selenium. I&#8217;ve put together a small example below that uses the new API to log into two web based e-mail clients and send an e-mail.</p>
<p><span id="more-89"></span></p>
<p><strong>WebDriverTestBase.java</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">tests</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.openqa.selenium.WebDriver</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.openqa.selenium.firefox.FirefoxDriver</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.openqa.selenium.support.ui.Wait</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.openqa.selenium.support.ui.WebDriverWait</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.testng.Assert</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.testng.annotations.AfterClass</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.testng.annotations.BeforeClass</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> WebDriverTestBase <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> FirefoxDriver driver<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> Wait wait<span style="color: #339933;">;</span>
&nbsp;
	@BeforeClass<span style="color: #009900;">&#40;</span>alwaysRun <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000066; font-weight: bold;">void</span> startWebDriver<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    	driver <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> FirefoxDriver<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	wait <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> WebDriverWait<span style="color: #009900;">&#40;</span>driver, <span style="color: #cc66cc;">120</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    @AfterClass<span style="color: #009900;">&#40;</span>alwaysRun <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000066; font-weight: bold;">void</span> closeSession<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    driver.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> assertEquals<span style="color: #009900;">&#40;</span><span style="color: #003399;">Object</span> actual, <span style="color: #003399;">Object</span> expected<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    	<span style="color: #000000; font-weight: bold;">Assert</span>.<span style="color: #006633;">assertEquals</span><span style="color: #009900;">&#40;</span>actual, expected<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>VisibilityOfElementLocated.java</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">tests</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.openqa.selenium.By</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.openqa.selenium.WebDriver</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.openqa.selenium.support.ui.ExpectedCondition</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> VisibilityOfElementLocated <span style="color: #000000; font-weight: bold;">implements</span> ExpectedCondition <span style="color: #009900;">&#123;</span>
&nbsp;
	By findCondition<span style="color: #339933;">;</span>
&nbsp;
	VisibilityOfElementLocated<span style="color: #009900;">&#40;</span>By by<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">findCondition</span> <span style="color: #339933;">=</span> by<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Boolean</span> apply<span style="color: #009900;">&#40;</span>WebDriver driver<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		driver.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">findCondition</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #003399;">Boolean</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>WebmailTest.java</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">tests</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.openqa.selenium.By</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.testng.annotations.Test</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> WebmailTest <span style="color: #000000; font-weight: bold;">extends</span> WebDriverTestBase <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//variables</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> YAHOO_EMAIL <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;example@yahoo.co.uk&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> HOTMAIL_EMAIL <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;example@hotmail.co.uk&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	@Test<span style="color: #009900;">&#40;</span>description <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Sends an e-mail from Yahoo account&quot;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> sendFromYahoo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">//new message variables</span>
		<span style="color: #003399;">String</span> to <span style="color: #339933;">=</span> HOTMAIL_EMAIL<span style="color: #339933;">;</span>
		<span style="color: #003399;">String</span> subject <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Test Sending Email Message From Yahoo&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">String</span> message <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;This is a test e-mail from Yahoo&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//login to yahoo</span>
		driver.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://mail.yahoo.com/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		driver.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">id</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;username&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">sendKeys</span><span style="color: #009900;">&#40;</span>YAHOO_EMAIL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		driver.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">id</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;passwd&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">sendKeys</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;mytestpw&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		driver.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">id</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;.save&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//create new message</span>
		driver.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">id</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;compose_button_label&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		wait.<span style="color: #006633;">until</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> VisibilityOfElementLocated<span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">xpath</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;id('_testTo_label')/ancestor::tr[1]//textarea&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//send test message</span>
		driver.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">xpath</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;id('_testTo_label')/ancestor::tr[1]//textarea&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">sendKeys</span><span style="color: #009900;">&#40;</span>to<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		driver.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">xpath</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;id('_testSubject_label')/ancestor::tr[1]//input&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">sendKeys</span><span style="color: #009900;">&#40;</span>subject<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		driver.<span style="color: #006633;">switchTo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">frame</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;compArea_test_&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		driver.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">xpath</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;//div&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">sendKeys</span><span style="color: #009900;">&#40;</span>message<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		driver.<span style="color: #006633;">switchTo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">defaultContent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		driver.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">id</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SendMessageButton_label&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">//WARNING! sometimes a captcha is displayed here</span>
		wait.<span style="color: #006633;">until</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> VisibilityOfElementLocated<span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">xpath</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;//nobr[contains(text(), 'Message Sent')]&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@Test<span style="color: #009900;">&#40;</span>description <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Sends an e-mail from Hotmail account&quot;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> sendFromHotmail<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">//new message variables</span>
		<span style="color: #003399;">String</span> to <span style="color: #339933;">=</span> YAHOO_EMAIL<span style="color: #339933;">;</span>
		<span style="color: #003399;">String</span> subject <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Test Sending Email Message From Hotmail&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">String</span> message <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;This is a test e-mail from Hotmail&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//login to hotmail</span>
		driver.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://mail.live.com/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		driver.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">name</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;login&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">sendKeys</span><span style="color: #009900;">&#40;</span>HOTMAIL_EMAIL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		driver.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">name</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;passwd&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">sendKeys</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;mytestpw&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>driver.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">name</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;remMe&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">isSelected</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			driver.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">name</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;remMe&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		driver.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">name</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SI&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//create new message</span>
		driver.<span style="color: #006633;">switchTo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">frame</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;UIFrame&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		driver.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">id</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;NewMessage&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//send test message</span>
		driver.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">id</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;AutoCompleteTo$InputBox&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">sendKeys</span><span style="color: #009900;">&#40;</span>to<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		driver.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">id</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;fSubject&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">sendKeys</span><span style="color: #009900;">&#40;</span>subject<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		driver.<span style="color: #006633;">switchTo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">frame</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;UIFrame.1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		driver.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">xpath</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;//body&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">sendKeys</span><span style="color: #009900;">&#40;</span>message<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		driver.<span style="color: #006633;">switchTo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">frame</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;UIFrame&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		driver.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">id</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SendMessage&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		assertEquals<span style="color: #009900;">&#40;</span>driver.<span style="color: #006633;">findElement</span><span style="color: #009900;">&#40;</span>By.<span style="color: #006633;">cssSelector</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;h1.SmcHeaderColor&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getText</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, <span style="color: #0000ff;">&quot;Your message has been sent&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Disclaimer: These tests are working at the time of this post but do require active e-mail accounts. They are likely to fail when the web based e-mail clients update their applications. Also, please don&#8217;t misuse these examples &#8211; their intention is to show how to use the WebDriver API and were inspired by a test assignment for an interview process.</p>
]]></content:encoded>
			<wfw:commentRss>http://seleniumexamples.com/blog/examples/selenium-2-examples/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

