Posts Tagged ‘Functional testing’

Selenium 2 Webinar: The Next Generation of Web and Mobile Application Testing

February 10th, 2011 by Ashley Wilson

Curious to know more about Selenium 2? Join Jason Huggins, creator of Selenium, for a webinar devoted to covering the essentials of this new testing tool that combines the best of WebDriver and Selenium.

Here’s a run-down of what you will learn next Wednesday, 2/16, at 10am PST:

  • iPhone and Android testing – See how Selenium 2 allows you to use built-in Android and iPhone emulators to test versions of your applications on the most popular mobile platforms.
  • Cleaner API for IDE users – Selenium introduces a simplified interface for IDE users that directs you to focus on only two basic objects to construct tests: WebDriver (browsers) and WebElements (anything on a web page). In Selenium 2, every API library is now tailored to each programming language for easier usability.
  • Enhanced scalability – The new Selenium 2 architecture allows developers and QA teams to “scale up and down”. For a single test on a local machine, you no longer need a background server. But when you want to scale up to run tests across multiple machines with multiple browser configurations, Selenium has all the power you’ll need.
  • Improved architecture – The new Selenium 2 architecture has enabled the introduction of a number of features that developers and QA pros will love, including native keyboard, support for mouse events, improved capabilities for handling pop-ups, and more stable browser control.

To join us, please click here to register. If you were wondering if Sauce Labs supports Selenium 2 testing the cloud, the answer is yes :-)

See you next week!

Advanced Selenium Synchronization with ‘Latches’

February 7th, 2011 by Adam Goucher

Selenium testing Tip of the Week:

Synchronization with Selenium is the number two problem I see with people’s scripts (the first being broken locators). This is actually a pretty easy problem to solve in all but the most pathological situations.

Web 1.0
Remember the good ol’ days when clicking a link caused the browser to fetch a new page? Those were, and remain, super easy to synchronize with using waitForPageToLoad and its language specific variants. Here’s an example of this in Ruby: "link=click here", :wait_for => :page

Web 2.0
But along came Web 2.0 and all its AJAX-y ‘goodness’. No longer could we be guaranteed that some action or event on the page would trigger a page load. For that, we needed to use a combination of isElementPresent or isVisible. "link=click here", :wait_for => :element, :element => "my locator" "link=click here", :wait_for => :visible, :element => "my locator"

While I haven’t done it yet for Ruby, I often combine the two together to create an ‘available’ condition to make sure that the element I care about is both present and visible. Something like this. "link=click here", :wait_for => :available, :element => "my locator"

Post Web 2.0
Some AJAX calls affect multiple elements and are both tricky and/or time consuming to figure out all the places to watch. New technologies like COMET also make element availability more fallible than it might originally be. For these situations you need to use a ‘latch’ for synchronization.

A what?

The term ‘latch’ in this case is a value that is set in the browser’s DOM that your script monitors for synchronization rather than something in the actual page. And example is in order. Here is an AJAX call in Ruby on Rails.

<%= link_to_remote( "click here",
                   :update => "time_div",
                   :url => { :action => :say_when },
                   :before => "window.latch = 'started'",
                   :complete => "window.latch = 'done'") %>

What this will do is set window.latch to the string value ‘started’ in the DOM before it actually executes and will set it to ‘done’ after it is complete. No problem. People who work with AJAX are used to working with callbacks. The twist happened in our Selenium script. "link=click here", :wait_for => :condition, :javascript => "window.latch == 'done'"

Now instead of checking for an element to be present or visible, we are waiting via waitForCondition for the latch conditions; in this case, ‘window.latch is done’.

I consider the latch technique as the synchronization method of last resort since it requires changing production code to support automation. But successful automation often calls for just that.

Trends in Testing: Continuous Integration, Mobility, Open Source, Cloud

May 10th, 2010 by The Sauce Labs Team

Functional testing is the automation of web app testing across several platforms or browsers. In the past, functional testing was less common due to long development cycles and the lack of multiple browser options. It was done primarily in-house via proprietary software like Rational or QuickTestPro.

Today, there are four trends converging to radically change how organizations test web applications:

  1. Continuous integration – An increased emphasis on performance of the software through the end customer’s perspective is leading agile development. Gartner predicts that by 2012 agile development methodologies will be used by 80 percent of all software development projects. Teams are shifting away from rigid quality control to quality that is demonstrable to the end user. With this shift, comes a need for quick, simple and automated testing tools.
  2. Open source – Open source tools, like Selenium, are viable for functional testing. Today’s development environment has dramatically changed and a lot more people are contributing than ever before. The major advantages of open-source are speed, time to market, time to value, and the ability to reach and grow a developer and user community. In fact, Gartner predicts that by 2012, 80 percent of all commercial software will include elements of open source technology.
  3. Cloud computing – Testing in the cloud is an affordable and scalable alternative to testing behind a firewall. It is expensive and time consuming to maintain on site test infrastructures that cover a vast number of browsers (and versions) of operating systems in several languages. The increase in the adoption of cloud computing creates an opportunity to leverage the space for functional testing. We believe the life cycle for cloud-based applications will look different in the future. New solutions that are cloud based will support cloud-base applications.
  4. Mobility – Websites need to support multiple browsers such as Internet Explorer, Firefox, Chrome, Rockmelt, Opera on various platforms including Windows and Mac. Smartphones only add to this “Browser War 2.0” battle with the plethora of mobile operating systems. These various environments make the infrastructure required more complex and the need for functional testing more relevant that ever before.

Are there other trends beyond continuous integration, mobility, open source and the cloud that will change how organizations test their web applications?

Highlights from our April 20th Selenium Testing Tools Demo Night

April 29th, 2010 by Ashley Wilson

Below are clips from our most recent Selenium meetup, which drew quite an enthusiastic crowd. Presenters Ray Vizzone of Test Labs, Inc and Matt Krapivner of Smart Pilot, David Vydra of Guideware, and Quality Tree founder Elisabeth Hendrickson were on hand at the Sauce Labs office to demonstrate leading edge tools / techniques that make functional testing easier and more effective. Also featured was a special Flex Pilot demo by Sauce Labs’ own Adam Christian.

Make sure to visit our #SFSE Meetup page here to RSVP for our next event on May 19, 2010 at Mozilla’s headquarters in Mountain View. Speakers from Mozilla and LinkedIn will discuss how they use Selenium and other open-source tools to handle quick and effective web testing. Take it from us – you don’t want to miss this!

Introduction to 4/20 Selenium Meetup with Stephen Donner of Mozilla

Selenium + FitNesse – A QA Multiplier Effect with Ray Vizzone and Matt Krapivner – Part 1

Selenium + FitNesse – A QA Multiplier Effect with Ray Vizzone and Matt Krapivner- Part 2

Integrating Selenium into a continuous test harness; dynamically generate type-safe test APIs with David Vydra- Part 1

Integrating Selenium into a continuous test harness; dynamically generate type-safe test APIs with David Vydra – Part 2

Flex Pilot Demo with Adam Christian of Sauce Labs – Part 1

Flex Pilot Demo with Adam Christian of Sauce Labs – Part 2

Using Robot Framework to drive Selenium tests with Elisabeth Hendrickson- Part 1

Using Robot Framework to drive Selenium tests with Elisabeth Hendrickson – Part 2

Creating Selenium Tests for Mature Ruby on Rails Project

December 24th, 2009 by John Dunham

Consultant Sarah Mei talks about effectively using outsourcing to ‘catch up’ implementing Selenium tests on an existing Ruby on Rails project.