<?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>Selenium Testing? Do Cross Browser Testing with Sauce Labs &#187; selenium</title>
	<atom:link href="http://saucelabs.com/blog/index.php/tag/selenium/feed/" rel="self" type="application/rss+xml" />
	<link>http://saucelabs.com/blog</link>
	<description></description>
	<lastBuildDate>Thu, 10 May 2012 17:20:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Selenium Testing Framework Part 3: Putting It All Together</title>
		<link>http://saucelabs.com/blog/index.php/2011/12/selenium-testing-framework-part-3-putting-it-all-together/</link>
		<comments>http://saucelabs.com/blog/index.php/2011/12/selenium-testing-framework-part-3-putting-it-all-together/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 20:40:14 +0000</pubDate>
		<dc:creator>Jason Smiley</dc:creator>
				<category><![CDATA[Selenium Knowledge]]></category>
		<category><![CDATA[base classes]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[testing frameworks]]></category>

		<guid isPermaLink="false">http://saucelabs.com/blog/?p=5672</guid>
		<description><![CDATA[This is the final post in a 3-part guest blog series by Jason Smiley, a QA Engineer at Gerson Lehrman Group. You can read his first post here and his second post here. If you&#8217;ve been following along with my other posts on building a Selenium testing framework, you know we&#8217;ve covered some of the [...]]]></description>
			<content:encoded><![CDATA[<p><em>This is the final post in a 3-part guest blog series by Jason Smiley, a QA Engineer at <a href="http://www.glgresearch.com/">Gerson Lehrman Group</a>. You can read his first post <a href="http://saucelabs.com/blog/index.php/2011/11/selenium-testing-framework-pt-1-testing-concepts/">here</a> and his second post <a href="http://saucelabs.com/blog/index.php/2011/11/selenium-testing-framework-pt-2-base-classes/">here</a>. </em> </p>
<p>If you&#8217;ve been following along with my other posts on building a Selenium testing framework, you know we&#8217;ve covered some of the <a href="http://saucelabs.com/blog/index.php/2011/11/selenium-testing-framework-pt-1-testing-concepts/">high-level testing concepts</a> and <a href="http://saucelabs.com/blog/index.php/2011/11/selenium-testing-framework-pt-2-base-classes/">base classes</a> so far. Now that we have defined all our working parts, let’s see how we would pull this above code into our test projects. To summarize specficially what we talked about in the last blog, we have defined the following classes.</p>
<ul>
<li>SeleniumTestBase.cs, which handles creating of the test browser, reading from the DB,  and handles changing of active windows or frames.</li>
<li>SeleniumActionBase.cs, which can update the DB and also can handle changing of the active windows or frames.</li>
<li>SeleniumPageBase.cs, which checks the starting number of the XPath browser index (IE uses 0 while all other browsers use 1).</li>
<li>SeleniumPageElement.cs, which handles waiting for and interacting with elements on the page.</li>
</ul>
<p>Since I mentioned the above classes should be in an external project from your testing project, I will refer to these set of classes in compiled form as the OurSeleniumFramework.dll. This .dll file should be referenced in your test project so test, action, and page classes can extend the base classes we created.</p>
<p>When creating a test project to test a website, it is a good idea to create a project base test that will create all of our action and page classes, as well as having a project base action class that will create all our page classes. Page classes will create SeleniumPageElements, which will be used by action and test classes.</p>
<h2>Example Test Project</h2>
<p>To demonstrate this structure, I will show how base classes are created and how this can be used to test a login page which has a username field, password field, submit button, login confirmation message that appears after successful login, and error message that appears after unsuccessful attempts. I will now show what each class required to perform a basic login test will look like. I will also add notes in the tests to show why something is being done. See below for all the example test project files. The files will be:</p>
<ol>
<li><em>ProjectTestBase.cs</em>: Handles NUnit setup, teardown, and page and action initialization functionality for tests.</li>
<li><em>ProjectActionBase.cs</em>: Handles page initialization functionality for actions.</li>
<li><em>LoginTests.cs</em>: Implements the tests for the login page.</li>
<li><em>LoginActions</em>.cs: Implements the steps required to do Login testing.</li>
<li><em>LoginPage.cs</em>: Handles the initialization for PageElement objects which will be used by actions and tests.</li>
</ol>
<h3>Example ProjectTestBase.cs</h3>
<pre class="brush:csharp">public ProjectTestBase : SeleniumTestBase
{
#region Action declarations
protected LoginActions _LoginActions;
#endregion

#region Page declarations
protected LoginPage _LoginPage;
#endregion

public ProjectTestBase (IWebDriver webDriver)
: base(webDriver) { }

public void CreateActions(IWebDriver webDriver)
{
_LoginActions = new LoginActions(webDriver);
}

public void CreatePages(IWebDriver webDriver)
{
_LoginPage= new LoginPage(webDriver);
}

[SetupTestFixture]
public virtual void setupTestFixture()
{
//Function is virtual so child test classes can have additional functionality.

//For this example project, nothing needs to be done on this level.
}

[Setup]
public virtual void setup()
{
//Function is virtual so child test classes can have additional functionality.
myDriver = StartBrowser(“firefox”);
CreateActions(myDriver);
CreatePages(myDriver);
LaunchUrl(“http://myhomepage.com”);
}

[Teardown]
public virtual void tearDown()
{
//Function is virtual so child test classes can have additional functionality.
myDriver.Quit();
}

[TeardownTestFixture]
public virtual void setupTestFixture()
{
//Function is virtual so child test classes can have additional functionality.

//For this example project, nothing needs to be done on this level.
}
}</pre>
<h3>Example ProjectActionBase.cs</h3>
<pre class="brush:csharp">public ProjectActionBase : SeleniumActionBase
{

#region Page declarations
protected LoginPage _LoginPage;
#endregion

public ProjectActionBase(IWebDriver webDriver)
: base(webDriver);
{
_LoginPage = new LoginPage(webDriver);
}
}</pre>
<p>(I&#8217;d like to point out here that in this class, you can put common actions such as successful login so all action classes will be able to perform this step. This is just a nice-to-have, though, and not a must.)</p>
<h3>Example LoginTests.cs</h3>
<pre class="brush:csharp">public LoginTests : ProjectTestBase
{

[Test]
public void successfulLoginTest()
{
_LoginActions.LoginAttempt(“Jason”, “Smiley”, true);
Assert.That(_LoginPage.ConfirmationMessage.Text, Is.EqualTo(“You are now logged in”).IgnoreCase, “You should have logged in successfuly but didn’t”);
}

[Test]
public void invalidLoginTest()
{
_LoginActions.LoginAttempt(“fake”, “fake”, false);
Assert.That(_LoginPage.ErrorMessage.Text, Is.EqualTo(“Invalid login”).IgnoreCase, “You should have gotten an error message but didn’t”)
}
}</pre>
<h3>Example LoginActions.cs</h3>
<pre class="brush:csharp">public LoginActions : ProjectActionBase
{
public void LoginAttempt(string username, string password, isValid = null)
{
LoginPage.UsernameTextField.Clear();
LoginPage.UsernameTextField.SendKeys(username);
LoginPage.PasswordTextField.Clear();
LoginPage.PasswordTextField.SendKeys(password);
LoginPage.SubmitBtn.Click();

if(isValid != null &amp;&amp; isValid == true)
{
LoginPage.ConfirmationMessage.
WaitUntilVisibleAndPresent(“confirmation is not appearing after 5 seconds”);
}

if(isValid != null &amp;&amp; isValid == false)
{
LoginPage.ErrorMessage.WaitUntilVisibleAndPresent(“error message is not appearing after 5 seconds”);
}
}
}</pre>
<h3>Example LoginPage.cs</h3>
<pre class="brush:csharp">public LoginPage : SeleniumPageBase
{
#region PageElement declarations
public PageElement UsernameTextField;
public PageElement PasswordTextField;
public PageElement ConfirmationMessage;
public PageElement ErrorMessage;
#endregion

public LoginPage(IWebDriver webDriver)
: base(webDriver)
{
UsernameTextField = new PageElement(By.Id(“username”), webDriver);
PasswordTextField= new PageElement(By.Id(“password”), webDriver);
ConfirmationMessage= new PageElement(By.Id(“success”), webDriver);
ErrorMessage= new PageElement(By.Id(“error”), webDriver);
}
}</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsaucelabs.com%2Fblog%2Findex.php%2F2011%2F12%2Fselenium-testing-framework-part-3-putting-it-all-together%2F&amp;title=Selenium%20Testing%20Framework%20Part%203%3A%20Putting%20It%20All%20Together" id="wpa2a_2"><img src="http://saucelabs.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://saucelabs.com/blog/index.php/2011/12/selenium-testing-framework-part-3-putting-it-all-together/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Sauce Partner Program Has Officially Landed</title>
		<link>http://saucelabs.com/blog/index.php/2011/11/the-sauce-partner-program-has-officially-landed/</link>
		<comments>http://saucelabs.com/blog/index.php/2011/11/the-sauce-partner-program-has-officially-landed/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 18:16:32 +0000</pubDate>
		<dc:creator>Ashley Wilson</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Sauce Offerings]]></category>
		<category><![CDATA[authorize partners]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[oem]]></category>
		<category><![CDATA[partners]]></category>
		<category><![CDATA[Sauce Labs]]></category>
		<category><![CDATA[selenium]]></category>

		<guid isPermaLink="false">http://saucelabs.com/blog/?p=5563</guid>
		<description><![CDATA[Sauce’s customer community know us well for our role and enthusiasm in expanding the use of Selenium amongst agile teams big and small. But we’re a young company ourselves and not everyone is aware of us yet. And even among those who do—and might want to use our services—there’s often a need for expertise, capabilities and services [...]]]></description>
			<content:encoded><![CDATA[<p>Sauce’s customer community know us well for our role and enthusiasm in expanding the use of Selenium amongst agile teams big and small. But we’re a young company ourselves and not everyone is aware of us yet. And even among those who do—and might want to use our services—there’s often a need for expertise, capabilities and services that Sauce Labs doesn’t now (or have plans to) offer. So we’re turning to our neighbor communities of facilitators and implementers to:</p>
<ul>
<li>Make it easier to connect customers to service providers and vice versa</li>
<li>Expand the use cases of Sauce’s browser cloud service and</li>
<li>Show our appreciation for community cooperation in a concrete way</li>
</ul>
<p>We&#8217;re excited to announce the formation of the <a href="http://saucelabs.com/partners">Sauce Partner program</a>. The program aims to support testing consultants, QA companies, and OEMs by providing infrastructure integrations, demo accounts, commissions, and more, as they enable software development teams to ship quality code faster using Selenium and the Sauce Selenium infrastructure.</p>
<p>The Sauce Partners program contains three different initiatives to cover the full breadth of needs in our expanding community. Read on to find out which one is right for you.<strong><br />
</strong></p>
<h2>Authorized Partners</h2>
<p>Authorized Partners are expertise centers for Selenium and/or Sauce who handle most, if not all, of the end-to-end QA process. This could include test script creation, test maintenance, Selenium implementation, QTP to Selenium training, etc. At Sauce, we get a number of people who write in saying they want to use our service, but only have manual test cases and need a company to write scripts for them. Or they need individualized help implementing Selenium and Sauce Labs. Since we don&#8217;t currently support this ourselves, we&#8217;re looking for 1-2 companies highly skilled in Selenium and Sauce who will benefit from some brand-name customer referrals. Requirements are that you pass an annual qualification demo and also pay a fee. In addition to the customer referrals, we&#8217;ll list you on our website as an authorized partner and also kick back commissions based on sales volume brought in.</p>
<h2>Sauce Maître&#8217; D</h2>
<p>We designed the Sauce Maître&#8217; D program for individual agile coaches or testing consultancies that help companies implement automation infrastructure, transition manual test practices to automated ones, adopt Selenium, implement Sauce, and more. The Sauce Maître&#8217; D program is free to participant and includes an unlimited demo account for your consulting demonstration purposes. We&#8217;ll issue you a promo code to share with your clients that want to use Sauce. Your clients benefit in that your promo code entitles them to a 5% discount off Sauce’s published price schedule.  On a quarterly basis we&#8217;ll send you a 10% commission based on the aggregate spending of customers entering your promo code. Simply <a href="https://docs.google.com/a/saucelabs.com/spreadsheet/viewform?hl=en_US&amp;formkey=dGo3TWtXQy1odTY1TjdkakNOeXBkN0E6MQ#gid=0">enroll here</a>, and we&#8217;ll set you up.</p>
<h2>Sauce OEM</h2>
<p>Sauce Labs built the world’s first public browser cloud to meet the needs of agile shops using Selenium to go fast safely.  But now we’re being increasingly approached by OEMs looking to use our browser cloud for applications beyond Selenium and beyond functional testing (such as Security threat injection, deep web data mining, etc.).  So we created the Sauce OEM program to serve the needs of these emerging use cases in addition to those organizations wishing to private-label Sauce’s Selenium service for use with their own customers.</p>
<h2>We want to hear from you!</h2>
<p>To learn more about and to join any one of these programs, please visit our <a href="http://saucelabs.com/partners">partner page</a> and register. Or, email us directly at <a href="mailto:partners@saucelabs.com">partners@saucelabs.com</a>. We look forward to partnering with you!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsaucelabs.com%2Fblog%2Findex.php%2F2011%2F11%2Fthe-sauce-partner-program-has-officially-landed%2F&amp;title=The%20Sauce%20Partner%20Program%20Has%20Officially%20Landed" id="wpa2a_4"><img src="http://saucelabs.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://saucelabs.com/blog/index.php/2011/11/the-sauce-partner-program-has-officially-landed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sauce Mac OS X Private Beta Signup!</title>
		<link>http://saucelabs.com/blog/index.php/2011/08/sauce-mac-os-x-private-beta-signup/</link>
		<comments>http://saucelabs.com/blog/index.php/2011/08/sauce-mac-os-x-private-beta-signup/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 17:02:23 +0000</pubDate>
		<dc:creator>Jason Huggins</dc:creator>
				<category><![CDATA[Featured Posts]]></category>
		<category><![CDATA[Product Updates]]></category>
		<category><![CDATA[Sauce Offerings]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[sauce ondemand]]></category>
		<category><![CDATA[selenium]]></category>

		<guid isPermaLink="false">http://saucelabs.com/blog/?p=4918</guid>
		<description><![CDATA[From the creation of Sauce OnDemand to the recent release of Sauce Scout, the most popular feature request from users has been OS X support. Well, we&#8217;re stoked to say that the wait is almost over. We are readying a very early version of Mac OS X support in our browser testing cloud. (In case you&#8217;re wondering, [...]]]></description>
			<content:encoded><![CDATA[<p>From the creation of <a href="http://saucelabs.com/ondemand">Sauce OnDemand</a> to the recent release of <a href="https://saucelabs.com/docs/scout">Sauce Scout</a>, the most popular feature request from users has been OS X support. Well, we&#8217;re stoked to say that the wait is <em>almost</em> over. We are readying a very early version of Mac OS X support in our browser testing cloud.</p>
<p>(In case you&#8217;re wondering, we will resist the incredible temptation to call this new offering &#8220;apple sauce&#8221;).</p>
<p>If you’re willing to give us tons of feedback, and will be patient with growing pains, please <a href="http://saucelabs.com/beta/osx">sign up</a>!</p>
<p>Like the rest of our cloud testing services, each Mac OS X session will include the browser testing features you&#8217;re familiar with. You&#8217;ll get a video of each session, and can take screenshots at any time. With every new test session, you get a clean-slate, freshly booted machine to control. And when the session is over, we delete the virtual machine, so there&#8217;s no lingering data left behind on the machine to worry about.</p>
<p>The Mac OS X private beta will initially be limited due to available systems and we’ll contact you as resourcing permits. First priority will be given to corporate users.</p>
<p>In you&#8217;re interested in joining the beta, <a title="Sauce Mac OS X - private beta signup form" href="http://saucelabs.com/beta/osx">complete the sign-up form</a>, and we&#8217;ll email you soon with details.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsaucelabs.com%2Fblog%2Findex.php%2F2011%2F08%2Fsauce-mac-os-x-private-beta-signup%2F&amp;title=Sauce%20Mac%20OS%20X%20Private%20Beta%20Signup%21" id="wpa2a_6"><img src="http://saucelabs.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://saucelabs.com/blog/index.php/2011/08/sauce-mac-os-x-private-beta-signup/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sauce OnDemand Now Supports Selenium 2.1.0</title>
		<link>http://saucelabs.com/blog/index.php/2011/08/sauce-ondemand-now-supports-selenium-2-1-0/</link>
		<comments>http://saucelabs.com/blog/index.php/2011/08/sauce-ondemand-now-supports-selenium-2-1-0/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 16:51:08 +0000</pubDate>
		<dc:creator>Santiago Suarez Ordoñez</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Sauce Offerings]]></category>
		<category><![CDATA[Selenium Knowledge]]></category>
		<category><![CDATA[Cross Browser]]></category>
		<category><![CDATA[features]]></category>
		<category><![CDATA[Sauce Labs]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[selenium 2]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://saucelabs.com/blog/?p=4807</guid>
		<description><![CDATA[In keeping up-to-date with the releases pushed by the Selenium project, Selenium version 2.1.0 is now fully available in our service. This new release includes a mayor fix to an important bug affecting some native clicks on elements. You can check out the official changelog for more information. Due to our new release process, there [...]]]></description>
			<content:encoded><![CDATA[<p>In keeping up-to-date with the <a href="http://seleniumhq.wordpress.com/2011/07/18/selenium-2-1-released/?utm_source=feedburner&#038;utm_medium=feed&#038;utm_campaign=Feed%3A+Selenium+%28The+Official+Selenium+Blog%29">releases pushed by the Selenium project</a>, Selenium version 2.1.0 is now fully available in our service.</p>
<p>This new release includes a mayor fix to an important bug affecting some native clicks on elements. You can check out the <a href="http://selenium.googlecode.com/svn/trunk/java/CHANGELOG">official changelog</a> for more information.</p>
<p>Due to our new release process, there will be a testing period before we make this the default version in our service. (Once we&#8217;ve decided to do so, we&#8217;ll announce it in advance). In the meantime, we advise you to try out your tests in this new version using the following Desired Capabilities/JSON key-value:</p>
<pre class="brush:js">"selenium-version": "2.1.0"</pre>
<p>We&#8217;d love to hear if you see any issues after moving your tests to Selenium 2.1.0. And stay tuned, as we&#8217;ll be announcing 2.2.0 as well as other versions through our blog too!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsaucelabs.com%2Fblog%2Findex.php%2F2011%2F08%2Fsauce-ondemand-now-supports-selenium-2-1-0%2F&amp;title=Sauce%20OnDemand%20Now%20Supports%20Selenium%202.1.0" id="wpa2a_8"><img src="http://saucelabs.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://saucelabs.com/blog/index.php/2011/08/sauce-ondemand-now-supports-selenium-2-1-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript + Selenium: The Rockstar Combination of Testing</title>
		<link>http://saucelabs.com/blog/index.php/2011/07/javascript-selenium-the-rockstart-combination-of-testing/</link>
		<comments>http://saucelabs.com/blog/index.php/2011/07/javascript-selenium-the-rockstart-combination-of-testing/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 23:58:26 +0000</pubDate>
		<dc:creator>Ashley Wilson</dc:creator>
				<category><![CDATA[Meetups]]></category>
		<category><![CDATA[Sauce Offerings]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[Functional testing]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Sauce Labs]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[unit testing]]></category>
		<category><![CDATA[yammer]]></category>

		<guid isPermaLink="false">http://saucelabs.com/blog/?p=4653</guid>
		<description><![CDATA[For our July Selenium meetup, held last Thursday, we wanted to give attendees something a little different to chew on. Thanks to our good friends at Yammer, who co-hosted the event with us, we did so not only with delicious catered Mexican food, but also plenty of Javascript &#38; Selenium testing goodness to go around. [...]]]></description>
			<content:encoded><![CDATA[<p>For our July <a href="http://www.meetup.com/seleniumsanfrancisco/">Selenium meetup</a>, held last Thursday, we wanted to give attendees something a little different to chew on. Thanks to our good friends at <a href="https://www.yammer.com/">Yammer</a>, who co-hosted the event with us, we did so not only with delicious catered Mexican food, but also plenty of Javascript &amp; Selenium testing goodness to go around.</p>
<p><a href="http://twitter.com/#!/foobarfighter">Bob Remeika</a>, senior engineer at Yammer, gave a spirited presentation that left no one questioning his stance on testing (his opening slide &#8211; &#8220;Test your shit&#8221; &#8211; really said it all). He gave us an inside look at how Yammer tests using a combination of Jellyfish and Sauce OnDemand, and gave some great advice on knowing what and how to test when you&#8217;re just starting out.</p>
<div id="__ss_8687788" style="width: 425px;"><iframe src="http://www.slideshare.net/slideshow/embed_code/8687788?rel=0&amp;startSlide=2" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="425" height="355"></iframe></div>
<p>&nbsp;</p>
<p>We also had <a href="http://twitter.com/admc">Adam Christian</a>, Sauce Labs&#8217; Javascript Aficionado and the creator of <a href="http://jelly.io/">Jellyfish</a>, give two talks. The first, a lightning talk titled &#8220;Javascript Via Selenium: The Good, The Bad, The Obvious&#8221;, covered some of the lesser known things about Javascript testing via Selenium.</p>
<p><iframe src="http://www.youtube.com/embed/TghflNMZrbw" frameborder="0" width="425" height="349"></iframe></p>
<p>The second showed off how you can use Jellyfish, the open source Javascript runner that he <a href="http://saucelabs.com/blog/index.php/2011/06/javascript-unit-testing-with-jellyfish-and-ondemand/">announced a few weeks ago</a>, to run your JS unit tests in any environment.</p>
<div id="__ss_7806634" style="width: 425px;">
<p><iframe src="http://www.slideshare.net/slideshow/embed_code/7806634" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="425" height="355"></iframe></p>
</div>
<p>Thanks to Adam, Bob, and Yammer for making this quite the fun and memorable meetup. As always, the <a href="http://www.meetup.com/seleniumsanfrancisco/">San Francisco Selenium Meetup group</a> is free to join &amp; we meet monthly at different venues around the Bay Area to talk all things testing. See you in August!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsaucelabs.com%2Fblog%2Findex.php%2F2011%2F07%2Fjavascript-selenium-the-rockstart-combination-of-testing%2F&amp;title=Javascript%20%2B%20Selenium%3A%20The%20Rockstar%20Combination%20of%20Testing" id="wpa2a_10"><img src="http://saucelabs.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://saucelabs.com/blog/index.php/2011/07/javascript-selenium-the-rockstart-combination-of-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sauce now supports Selenium 2.0 final, the new ChromeDriver and Firefox 5</title>
		<link>http://saucelabs.com/blog/index.php/2011/07/sauce-now-supports-selenium-2-0-final-the-new-chromedriver-and-firefox-5/</link>
		<comments>http://saucelabs.com/blog/index.php/2011/07/sauce-now-supports-selenium-2-0-final-the-new-chromedriver-and-firefox-5/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 18:46:10 +0000</pubDate>
		<dc:creator>Santiago Suarez Ordoñez</dc:creator>
				<category><![CDATA[Featured Posts]]></category>
		<category><![CDATA[Selenium Knowledge]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[Cross Browser Testing]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[Sauce Labs]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[selenium 2]]></category>

		<guid isPermaLink="false">http://saucelabs.com/blog/?p=4526</guid>
		<description><![CDATA[We&#8217;re pleased to announce we&#8217;ve been eagerly tracking the Selenium project as new releases come out and Selenium 2 becomes an even more awesome tool! Selenium 2.0.0 We couldn&#8217;t be happier to hear that the 2.0 final release has landed. Everyone on the Selenium development team has done an incredible job moving this forward and [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re pleased to announce we&#8217;ve been eagerly tracking the Selenium project as new releases come out and Selenium 2 becomes an even more awesome tool!</p>
<h3><strong>Selenium 2.0.0</strong></h3>
<p><img class="alignright" title="Selenium Logo" src="http://seleniumhq.org/images/big-logo.png" alt="" width="144" height="130" />We couldn&#8217;t be happier to hear that <strong>the 2.0 final release has landed</strong>. Everyone on the Selenium development team has done an incredible job moving this forward and making Selenium 2/Webdriver into <strong>what we believe is the best tool in the market for browser automation</strong>. As of last Friday, 2 hours after the release, we included Selenium 2.0 in our list of supported versions, <a href="https://twitter.com/santiycr/status/89357230767480832">allowing our users to start running tests on it by providing the right capability</a> into their DesiredCapabilities object.</p>
<p>As of today, <strong>we&#8217;ve made 2.0.0 the default</strong> version for all users, as it&#8217;s proven to be the most stable and fast version.</p>
<p><em><span style="text-decoration: underline;">Notice</span>: We know some users were affected by this upgrade due to some newly unsupported commands in this release. We&#8217;ve since put in place new steps for making the upgrade process more apparent and painless for our users in the future.</em></p>
<h3><strong>Firefox 5</strong></h3>
<p><img class="alignright size-thumbnail wp-image-4542" title="gecko" src="http://saucelabs.com/blog/wp-content/uploads/2011/07/gecko-150x150.png" alt="" width="120" height="120" /></p>
<p>With the latest Selenium upgrade, support for new browsers was included as usual. And since it&#8217;s a fundamental part of our job to keep users up to date with cutting edge technology, <strong>we&#8217;ve included Firefox 5 support for both your Selenium 1 and 2 tests</strong>. Just go ahead and add Firefox version 5 to your <a title="Sauce's supported browsers" href="http://saucelabs.com/docs/sauce-ondemand/browsers">list of browsers to test</a>, and you should be good to go.</p>
<p>Scout users can also use Firefox 5 to manually test anytime. (Are you aware about <strong>Scout</strong>, our cool new tool? If not, <strong><a href="http://saucelabs.com/blog/index.php/2011/05/cross-browser-testing-in-your-browser-with-sauce-scout/">y</a><a href="http://saucelabs.com/blog/index.php/2011/05/cross-browser-testing-in-your-browser-with-sauce-scout/">ou should</a>!).</strong></p>
<h3><strong>The new Chrome and Opera drivers</strong></h3>
<p><img class="alignleft size-thumbnail wp-image-4539" title="chrome" src="http://saucelabs.com/blog/wp-content/uploads/2011/07/chrome-150x150.png" alt="" width="120" height="120" /><br />
By now, you&#8217;ve hopefully seen the video of <a title="Simon's closing keynote" href="http://www.youtube.com/watch?v=ZtbEtQBYr1w">Simon Stewart presenting the new ChromeDriver</a> during the closing keynote of  the <a href="http://www.seleniumconf.com/">2011 Selenium Conference</a>. If you were in attendance, you may recall the <a href="http://www.youtube.com/watch?v=ZtbEtQBYr1w&amp;t=11m42s">OH SHIT, THAT&#8217;S SO COOL!</a> moment when attendees witnessed the new ChromeDriver running tests at<strong> blazing speeds</strong> as compared to the old version. But the importance of the <strong>new ChromeDriver and OperaDriver</strong> (which, as Simon mentioned, is just as fast and robust) is not only in their speed, but also in that they are no longer part of the Selenium codebase. They are now maintained by the right people: the browser vendors themselves. Right on, Opera and Google! We&#8217;re hoping the rest <a title="Firefox's request for Se2 support" href="https://bugzilla.mozilla.org/show_bug.cgi?id=670674">will follow along</a>.<img class="alignright size-full wp-image-4541" title="opera" src="http://saucelabs.com/blog/wp-content/uploads/2011/07/opera1.png" alt="" width="142" height="120" /></p>
<p>You can run tests using the new ChromeDriver by specifying it in your RemoteDriver&#8217;s DesiredCapabilities object. We&#8217;re currently working on getting support for the OperaDriver and will announce it as soon as it&#8217;s there. Here are the official release links in case you&#8217;re interested into getting these in your local setup too:</p>
<p><a href="http://seleniumhq.wordpress.com/2011/02/09/operadriver_released/">http://seleniumhq.wordpress.com/2011/02/09/operadriver_released/</a><br />
<a href="http://seleniumhq.wordpress.com/2011/07/07/new-chromedriver/"> http://seleniumhq.wordpress.com/2011/07/07/new-chromedriver/</a></p>
<p>For all of these releases, we owe a <strong>huge</strong> thank you to <strong>everyone on the Selenium development team</strong>. You guys are doing a great job, and your contributions to the project are constantly improving the quality of our service. For that (and a lot more), we humbly declare each of you the deserved owners of a Sauce t-shirt!</p>
<p><img class="aligncenter size-medium wp-image-4544" title="sauce tshirt" src="http://saucelabs.com/blog/wp-content/uploads/2011/07/Screen-shot-2011-07-13-at-3.03.57-PM1-300x205.png" alt="" width="300" height="205" /></p>
<p>&nbsp;</p>
<p>Happy testing!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsaucelabs.com%2Fblog%2Findex.php%2F2011%2F07%2Fsauce-now-supports-selenium-2-0-final-the-new-chromedriver-and-firefox-5%2F&amp;title=Sauce%20now%20supports%20Selenium%202.0%20final%2C%20the%20new%20ChromeDriver%20and%20Firefox%205" id="wpa2a_12"><img src="http://saucelabs.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://saucelabs.com/blog/index.php/2011/07/sauce-now-supports-selenium-2-0-final-the-new-chromedriver-and-firefox-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Appeasing the Butler or The Commit Heard Round the Company</title>
		<link>http://saucelabs.com/blog/index.php/2011/06/appeasing-the-butler-or-the-commit-heard-round-the-company/</link>
		<comments>http://saucelabs.com/blog/index.php/2011/06/appeasing-the-butler-or-the-commit-heard-round-the-company/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 17:45:10 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[QA Trends / Sauce Labs' View of the World]]></category>
		<category><![CDATA[Selenium Knowledge]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[sauce ondemand]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[spinassert]]></category>
		<category><![CDATA[test::right]]></category>

		<guid isPermaLink="false">http://saucelabs.com/blog/?p=4374</guid>
		<description><![CDATA[&#160; This is what our build looked like. He was not happy. Notice how his eyes are red. That&#8217;s because of failing tests, which as we know turn builds red. These failing tests weren&#8217;t normal failing tests, which are actually pretty happy, because they are telling you how to fix your broken stuff. No, these [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_4376" class="wp-caption alignleft" style="width: 106px"><a rel="attachment wp-att-4376" href="http://saucelabs.com/blog/index.php/2011/06/appeasing-the-butler-or-the-commit-heard-round-the-company/angry/"><img class="size-full wp-image-4376  " title="angry" src="http://saucelabs.com/blog/wp-content/uploads/2011/06/angry.png" alt="" width="96" height="96" /></a><p class="wp-caption-text">Sauce Labs does not employ any artists</p></div>
<p>&nbsp;</p>
<p>This is what our build looked like. He was not happy. Notice how his eyes are red. That&#8217;s because of failing tests, which as we know turn builds red. These failing tests weren&#8217;t normal failing tests, which are actually pretty happy, because they are telling you how to fix your broken stuff. No, these tests were <a title=" " href="http://joblivious.wordpress.com/2009/02/20/handling-intermittence-how-to-survive-test-driven-development/" target="_blank">intermittent</a>. That&#8217;s largely the fault of the fact that they were selenium tests &#8211; go figure, the selenium shop that sells selenium as a service is having selenium issues, lol (but sadface).</p>
<p>Well, to get out of sadfaceland, we dug into one of the sadtests and saw something surprising. It was a case of selenium looking for an element before it appeared. Wait, what? We already know how to fix that. In fact, we already told the whole world how to fix it: with <a href="http://saucelabs.com/blog/index.php/2011/04/how-to-lose-races-and-win-at-selenium/" target="_blank">spinning</a>! Basically, the way a spinassert works is by trying the assertion over and over until it passes. This is a big deal with selenium because trying to interact with an element on a page before the page has loaded is a frequent source of flakey tests. We even went so far as to write <a href="http://saucelabs.com/blog/index.php/2011/05/testright-browser-testing-done-right/" target="_blank">Test::Right</a> (<a href="https://github.com/saucelabs/test_right" target="_blank">source on github</a>), a ruby test framework which goes out of its way to make it impossible for you to do write selenium tests without spin asserts. So what happened?</p>
<p>Well, we don&#8217;t use Test::Right for all our own tests. Test::Right is ruby and our tests are written in the same language as our back-end; python. And while we were using spin-style asserts for many of our tests, some of them were written before we discovered the magic of spinning, and some were written when we just didn&#8217;t remember to use spinning. Also, there were some things that were not assertions but still required spinning; like, if you want to click on an element in a page, it makes sense to spin-wait for that element to be present before clicking on it. Test::Right does the right thing in all these cases; we just had to be more like Test::Right in-house, to prevent sadness from creeping back into the codebase again.</p>
<p><img class="alignright size-full wp-image-4377" title="happy" src="http://saucelabs.com/blog/wp-content/uploads/2011/06/happy.png" alt="" width="96" height="96" /></p>
<p>So the fix was clear: modify our own test framework to always spin-wait all the time for every DOM element to show up, every time anyone tried to interact with a DOM element, automatically. We did that, and it made the butler happy. All of a sudden we could trust the build again, and it didn&#8217;t take hours to wait for a nonflakey build so that we could deploy new changes. This in turn meant that we never had to hotpatch production when there was an issue, which meant we didn&#8217;t have to spend time cleaning up hotpatches when a deploy happened. It also unblocked people who wanted to push new changes to trunk. Basically the whole dev process got better.</p>
<p>So here&#8217;s the thing &#8211; our customers are having the same issue. Not everyone uses Test::Right. We know this because we have a support team and customers contact us all the time asking for help with flakey tests. <strong>In our over 3,000 support requests, race-condition flakey tests are the #1 cause of pain</strong>. The shocker is that except for Test::Right (and now our own internal python nose framework), nobody has this universal fix.</p>
<p>So we&#8217;re hoping to make test frameworks for all the common languages &#8211; PHP, Java, Python, at least &#8211; that do what Test::Right did. We already have our own PHPUnit extension (thanks <a href="http://sorgalla.com/" target="_blank">Jan Sorgalla</a>!) which will probably be the first to get the Test::Right makeover.</p>
<p>Sadly, we are a focused team, and we have many tasks to accomplish, so this fix to selenium client libraries will likely not be imminently released <em>by us</em>. Thus we decided to at least tell you all how to Fix Everything on your own side. Now that I&#8217;ve done that, back to programming! Good night and good luck.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsaucelabs.com%2Fblog%2Findex.php%2F2011%2F06%2Fappeasing-the-butler-or-the-commit-heard-round-the-company%2F&amp;title=Appeasing%20the%20Butler%20or%20The%20Commit%20Heard%20Round%20the%20Company" id="wpa2a_14"><img src="http://saucelabs.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://saucelabs.com/blog/index.php/2011/06/appeasing-the-butler-or-the-commit-heard-round-the-company/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>#SeConf Videos Now Available!</title>
		<link>http://saucelabs.com/blog/index.php/2011/05/videos-from-seconf-now-available/</link>
		<comments>http://saucelabs.com/blog/index.php/2011/05/videos-from-seconf-now-available/#comments</comments>
		<pubDate>Mon, 02 May 2011 19:02:59 +0000</pubDate>
		<dc:creator>Ashley Wilson</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[Sauce Labs]]></category>
		<category><![CDATA[seconf]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://saucelabs.com/blog/?p=3734</guid>
		<description><![CDATA[In case you missed the awesome Selenium Conference that happened in early April, check out videos from each of the presentations. We&#8217;ll be posting a couple at a time, so stay tuned to future posts! Jason Huggins&#8217; Opening Keynote Dave Hunt &#038; Andrew Smith: Automating Canvas Applications Despite recent improvements to automated testing tools, there’s [...]]]></description>
			<content:encoded><![CDATA[<p>In case you missed the awesome<a href="http://www.seleniumconf.com/"> Selenium Conference</a> that happened in early April, <a href="http://www.youtube.com/user/saucelabs?feature=mhum">check out videos</a> from each of the presentations. We&#8217;ll be posting a couple at a time, so stay tuned to future posts!</p>
<p><iframe width="560" height="349" src="http://www.youtube.com/embed/opk49J0fQOs" frameborder="0" allowfullscreen></iframe><br />
<strong>Jason Huggins&#8217; Opening Keynote<br />
</strong></p>
<p><iframe width="560" height="349" src="http://www.youtube.com/embed/yugolxP3rhc" frameborder="0" allowfullscreen></iframe><br />
<strong>Dave Hunt &#038; Andrew Smith: Automating Canvas Applications<br />
</strong><em>Despite recent improvements to automated testing tools, there’s still a large gap when it comes to emerging technologies such as HTML5. Recent developments like the canvas element present an interesting dilemma for traditional automated testing as they expose little or no information to debug tools. In order to move forwards, both developers and testers will need to work together. Using Selenium, Java, and JavaScript we will demonstrate writing automated tests for a popular canvas game. </em></p>
<p><iframe width="560" height="349" src="http://www.youtube.com/embed/NknTBuOpbHQ" frameborder="0" allowfullscreen></iframe><br />
<strong>Dima Kovalenko: Selenium and Cucumber<br />
</strong><em>Wouldn’t it be nice to have the BA’s write out the acceptance criteria in plain English, and then have those criteria run as tests? Join us for a beginner to intermediate walk through of Cucumber and Selenium. Learn how to write tests that are easy to understand and run. There will be plenty of examples and sample code to get you going in the right direction.</em></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsaucelabs.com%2Fblog%2Findex.php%2F2011%2F05%2Fvideos-from-seconf-now-available%2F&amp;title=%23SeConf%20Videos%20Now%20Available%21" id="wpa2a_16"><img src="http://saucelabs.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://saucelabs.com/blog/index.php/2011/05/videos-from-seconf-now-available/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to serve PHP/Pear packages with GitHub</title>
		<link>http://saucelabs.com/blog/index.php/2011/04/how-to-serve-php-packages-with-github/</link>
		<comments>http://saucelabs.com/blog/index.php/2011/04/how-to-serve-php-packages-with-github/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 18:47:24 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[pear]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Sauce Labs]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://saucelabs.com/blog/?p=3641</guid>
		<description><![CDATA[PHP packages are distributed through Pear channels. If you want to download a PHP package, it’s as simple as downloading Pear and using it. The process of using pear is telling it the &#8220;channel&#8221; you want to download the package from, and then telling it to download the package. That&#8217;s what you do if you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://php.net/">PHP</a> packages are distributed through <a href="http://pear.php.net/">Pear</a> channels. If you want to download a PHP package, it’s as simple as downloading Pear and using it. The process of using pear is telling it the &#8220;channel&#8221; you want to download the package from, and then telling it to download the package. That&#8217;s what you do if you want to download somebody else&#8217;s PHP. If you want other people to be able to download yours, you have to make your own pear channel.</p>
<p>We had to do that recently, and it turns out there’s an easy way to do it thanks to <a href="https://github.com/">GitHub</a> and <a href="http://fabien.potencier.org/">Fabien Potencier</a>&#8216;s <a href="http://www.pirum-project.org/">Pirum</a>. It’s pretty straightforward. Here come the lists. So many lists! Like 40. Still. Straightforward.</p>
<p>By the way, you&#8217;ll need to <a href="http://pear.php.net/manual/en/installation.php">install pear</a> and <a href="http://git-scm.com/download">install git</a> if you haven&#8217;t already.</p>
<div>
<hr />
<p>&nbsp;</p>
<h3><strong>Make a pear channel</strong></h3>
<ol>
<li>Create a new repository on GitHub called <code>pear</code>
<ol>
<li>Make the project on github</li>
<li><code>$ mkdir pear</code></li>
<li><code>$ cd pear</code></li>
<li><code>$ git init</code></li>
<li><code>$ git remote add origin git@github.com:[your git username]/pear.git</code></li>
</ol>
</li>
<li>Install <a href="http://www.pirum-project.org/">Pirum</a>
<ol>
<li><code>$ pear channel-discover pear.pirum-project.org</code></li>
<li><code>$ pear install pirum/Pirum-beta</code></li>
</ol>
</li>
<li>Create a pirum configuration file:
<ol>
<li>It&#8217;s called <code>pirum.xml</code></li>
<li>It goes in the root of your pear repository</li>
<li>It contains:
<ol>
<li><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;<br />
&lt;server&gt;<br />
&lt;name&gt;[username].github.com/pear&lt;/name&gt;<br />
&lt;summary&gt;[username]'s PEAR Channel Server&lt;/summary&gt;<br />
&lt;alias&gt;[username]&lt;/alias&gt;<br />
&lt;url&gt;http://[username].github.com/pear&lt;/url&gt;<br />
&lt;/server&gt;</code></li>
</ol>
</li>
</ol>
</li>
<li>Run the build command
<ol>
<li><code>$ pirum build .<br />
</code></li>
</ol>
</li>
<li>Now add and commit everything
<ol>
<li><code>$ git add -A</code></li>
<li><code>$ git commit -m "Initial server build. Sauce Labs is awesome"</code></li>
</ol>
</li>
<li>Rename your master branch to gh-pages and push it to GitHub
<ol>
<li><code>$ git branch -m master gh-pages</code></li>
<li><code>$ git push origin gh-pages</code></li>
</ol>
</li>
<li>Your PEAR channel server is now available (after maybe 15 minutes) under <code>[username].github.com/pear</code>. Test it out!
<ol>
<li><code>$ pear channel-discover [username].github.com/pear</code></li>
<li><code>$ pear channel-info [username]</code></li>
<li><code>$ pear list-all -c [username]</code></li>
</ol>
</li>
</ol>
<p>&nbsp;</p>
<hr />
<p>There! Now you have a pear channel. Now you need to</p>
<h3><strong>Make a PHP package</strong></h3>
<ol>
<li>Go to the directory that contains your PHP files</li>
<li>Create a <a href="http://pear.php.net/manual/en/guide.developers.package2.php">package.xml</a> file that contains metadata about your package</li>
<li>Check that it&#8217;s a valid package
<ol>
<li><code>$ pear package-validate</code></li>
</ol>
</li>
<li>Make the package!
<ol>
<li><code>$ pear package</code> (this should create a .tgz file that&#8217;s named after the package you detailed in package.xml)</li>
</ol>
</li>
</ol>
</div>
<p>&nbsp;</p>
<hr />
<p>Woo! Now you have a package and a channel. Next step is to</p>
<p>&nbsp;</p>
<h3><strong>Add the package to the channel</strong></h3>
<ol>
<li>Copy the .tgz file to your pear repository</li>
<li>Navigate to that directory</li>
<li>Add the package to the channel locally
<ol>
<li><code>$ pirum add . [filename].tgz</code></li>
</ol>
</li>
<li>Upload the changes to github! Note that you push to gh-pages and not to master.
<ol>
<li><code>$ git add -A</code></li>
<li><code>$ git commit -m "Added first version of my pear package. Sauce Labs is awesome"</code></li>
<li><code>$ git push origin gh-pages</code></li>
</ol>
</li>
</ol>
<p>&nbsp;</p>
<hr />
<p>And you&#8217;re done! No more bullets! Or numbered lists. Now the whole world is exposed to your PHP. Hopefully that&#8217;s a good thing.</p>
<p>&nbsp;</p>
<p>Here’s our Pear channel: <a href="https://github.com/saucelabs/pear">https://github.com/saucelabs/pear</a></p>
<p>Here’s the source we distribute through it: <a href="https://github.com/saucelabs/phpunit-selenium-sauceondemand">https://github.com/saucelabs/phpunit-selenium-sauceondemand</a></p>
<p>Special thanks to <a href="http://sorgalla.com/">Jan Sorgalla</a> for showing me by example how to do all this.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsaucelabs.com%2Fblog%2Findex.php%2F2011%2F04%2Fhow-to-serve-php-packages-with-github%2F&amp;title=How%20to%20serve%20PHP%2FPear%20packages%20with%20GitHub" id="wpa2a_18"><img src="http://saucelabs.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://saucelabs.com/blog/index.php/2011/04/how-to-serve-php-packages-with-github/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Lose Races and Win at Selenium</title>
		<link>http://saucelabs.com/blog/index.php/2011/04/how-to-lose-races-and-win-at-selenium/</link>
		<comments>http://saucelabs.com/blog/index.php/2011/04/how-to-lose-races-and-win-at-selenium/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 22:34:57 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Selenium Knowledge]]></category>
		<category><![CDATA[asserts]]></category>
		<category><![CDATA[automated testing]]></category>
		<category><![CDATA[Sauce Labs]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[spin asserts]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://saucelabs.com/blog/?p=3577</guid>
		<description><![CDATA[Selenium races your browser Selenium tests sometime fail for no reason. You can eliminate most of their random failures with a special kind of assertion, the spin assert. The problem is that Selenium is overeager, and it needs to chill out and wait. Selenium tests often fail because they&#8217;re too fast. Where a user might [...]]]></description>
			<content:encoded><![CDATA[<h4>Selenium races your browser</h4>
<p><a rel="attachment wp-att-3611" href="http://saucelabs.com/blog/index.php/2011/04/how-to-lose-races-and-win-at-selenium/photo_by_chris_breeze/"><img class="alignright size-medium wp-image-3611" title="photo_by_chris_breeze" src="http://saucelabs.com/blog/wp-content/uploads/2011/04/photo_by_chris_breeze-300x225.jpg" alt="" width="300" height="225" /></a>Selenium tests sometime fail for no reason. You can eliminate most of their random failures with a special kind of assertion, the spin assert. The problem is that Selenium is overeager, and it needs to chill out and wait.</p>
<p>Selenium tests often fail because they&#8217;re too fast. Where a user might wait for a page to load for a few seconds and then click on a link, Selenium will interact with a page at the speed of code, before the page is ready. The way to fix this is to have Selenium repeat its actions and assertions until they work. If you don&#8217;t, Selenium races your browser.</p>
<h4>You need Selenium to lose the race</h4>
<p><a rel="attachment wp-att-3612" href="http://saucelabs.com/blog/index.php/2011/04/how-to-lose-races-and-win-at-selenium/photo_by_rich_anderson/"><img class="size-medium wp-image-3612 alignleft" title="photo_by_rich_anderson" src="http://saucelabs.com/blog/wp-content/uploads/2011/04/photo_by_rich_anderson-225x300.jpg" alt="" width="225" height="300" /></a>Selenium tests pages. It tests them by loading them and then doing stuff on them like it&#8217;s a person. Isn&#8217;t that cute? Selenium thinks it&#8217;s people. Unfortunately for us, Selenium isn&#8217;t people, and in not being people, it&#8217;s too fast. Websites are made for people, with the knowledge that people are slow. When humans open a page, the humans wait for it to be loaded, then click on stuff. The clever secret of webpages is that they&#8217;re not really loaded when they look loaded. That&#8217;s because the web page&#8217;s authors know we take a second to take it all in before we start playing. So they make pages that look loaded right away, and then use javascript to do more real loading once the page is &#8216;loaded.&#8217; This javascript sets up for playtime in the background while we&#8217;re taking it all in. Selenium has a bad habit of trying to use pages before they&#8217;re set up for playtime.</p>
<p>The way to solve that is <strong>not</strong> telling Selenium to pause for a fixed number of seconds. Pauses have two problems. They make your tests slower than they need to be, and they don&#8217;t really fix the problem, just make it less frequent. The best solution is to have Selenium <strong>keep trying until it works</strong>. If your test is trying to assert that clicking on an &#8220;email settings&#8221; button pops up an email settings dialog, Selenium should repeat a &#8220;click the button -&gt; is the status dialog visible?&#8221; loop until the status dialog is visible.</p>
<p>Here&#8217;s the problem. When we tell Selenium to wait-for-page-to-load and then click, Selenium waits for the wrong thing. It can tell when all the page&#8217;s content has been downloaded and displayed, but it has no idea when the page&#8217;s custom javascript has finished loading. Sometimes that functional javascript goes back to the server and fetches more content to be displayed, so you can&#8217;t even count on required text being present yet. There are several ways for a page to be &#8220;loaded,&#8221; and Selenium doesn&#8217;t wait for the right one. It races your page&#8217;s loading logic, often &#8220;winning&#8221; the  race and clicking on things before they&#8217;re ready to be clicked on. You need Selenium to lose the race.</p>
<h4>Here&#8217;s how to do this</h4>
<p>&nbsp;</p>
<p>The solution is spin asserts.  At Sauce Labs, when we want to verify that some text appears on a page, we use this function:</p>
<pre class="brush:python">def wait_for_text_present(self, text, msg=None):
    msg = msg or " waiting for text %s to appear" % text
    assertion = lambda: self.selenium.is_text_present(text)
    self.spin_assert(msg, assertion)
</pre>
<p>Do you see it calling a function named <code>spin_assert</code>? That function is the key. <code>spin_assert</code> retries the passed-in test function, in this case a lambda expression, over and over until it works. Here&#8217;s what <code>spin_assert</code> looks like, minus some bells and whistles:</p>
<pre class="brush:python">def spin_assert(self, msg, assertion):
    for i in xrange(60):
        try:
            self.assertTrue(assertion())
            return
        except Exception, e:
            pass
        sleep(1)
    self.fail(msg)</pre>
<p><a rel="attachment wp-att-3615" href="http://saucelabs.com/blog/index.php/2011/04/how-to-lose-races-and-win-at-selenium/photo_by_colonright-bracket/"><img class="alignright size-medium wp-image-3615" title="photo_by_colon+right.bracket" src="http://saucelabs.com/blog/wp-content/uploads/2011/04/photo_by_colon+right.bracket-300x168.jpg" alt="" width="300" height="168" /></a>In this case, <code>wait_for_text_present</code> will repeatedly ask the Selenium server whether the text is present until it shows up. It could do several things in a loop, like click a button and then ask whether a popup has appeared. Almost all the asserts in our internal Selenium tests are a wrap around a call to <code>spin_assert</code>, and they&#8217;re all way more reliable than they were before the switch.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsaucelabs.com%2Fblog%2Findex.php%2F2011%2F04%2Fhow-to-lose-races-and-win-at-selenium%2F&amp;title=How%20to%20Lose%20Races%20and%20Win%20at%20Selenium" id="wpa2a_20"><img src="http://saucelabs.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://saucelabs.com/blog/index.php/2011/04/how-to-lose-races-and-win-at-selenium/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

