Wednesday, May 30, 2007

Automated Testing of Silverlight Applications – PART I

PART II

Update (11/10/09): Record/Playback tool for Silverlight automation release.

One of the latest hot web development technologies on the market is Microsoft’s Silverlight framework. When Microsoft introduced WPF/e (known now as Silverlight Beta), the focus was on building rich media applications - similar to what you can do today with Flash - using a subset of their latest client development technology known as the Windows Presentation Foundation (aka WPF). Earlier this month, Microsoft introduced Silverlight Alpha which expanded the scope of Silverlight by introducing a light-weight CLR that allows developers to write managed code applications and host these applications inside the browser. To allow Silverlight applications to integrate well with current HTML/Ajax applications, Silverlight also enabled easy access to the HTML document DOM hosting these applications. Pretty cool!

As many in the development community ponder the feature set of this technology and how it can be leveraged in future development projects, us and
others in the software testing community are investigating how automated testing would work in Silverlight world! There are quite a bit of challenges to overcome especially with it only being an Alpha! But again, it never hurts to get a head start on looking at this technology from a testing prospective and providing Microsoft with feedback on how they can make our lives a bit easier when it comes to automated testing :).

When thinking about Silverlight applications and automated testing, there are a couple of different approaches that come to mind:



1. Isolated API/Unit Testing: This can be efficiently executed by running test cases inside Silverlight in a light host similar to what Jamie did with TestDriven.NET or what Visual Studio Team Test might provide in future versions. [Think of Visual Studio Team Test's ASP.NET testing support today where they allow tests to have access to the ASP.NET HttpContext. They would simply enable a Silverlight configuration where they provide a light-weight Silverlight host that tests can run in.]

This approach works well when:

  • UnitTesting the business logic of your Silverlight application.
  • When you have a pure windowless Silverlight application that standsalone and has very limited interaction with the HTML on the page.

This approach might not be suiteable for:

  • Heavy UI applications that perform heavy interactions with other HTML elements on the page. Especially when HTML elements trigger events in Silverlight Apps or when using Ajax on your pages.
  • Automating usage scenarios or end-to-end scenarios that require a browser host.
  • Testing your application in different browsers (IE/Firefox/Safari)

2. Browser Testing: Basically automating the browser by accessing the HTML DOM of the page including the XAML DOM of the hosted Silverlight app(s) and being able to execute actions and query states of these two DOM trees in a consistent and interchangeable manner. This approach is suitable for the scenarios described above that are not fit for Isolated API/UnitTesting.

Here at ArtOfTest, we’ve spent some time prototyping a few solutions that we think can help solve some of the challenges introduced by Silverlight. We are currently focused on approach #2 above since we think the progression of leveraging Silverlight is going to be through integration of small Silverlight apps within existing HTML/Ajax applications.

So, how are we going about supporting Silverlight?

Well, our web automation infrastructure WebAii currently provides a rich infrastructure for automating HTML based web applications including rich support for Ajax. One of our goals is to extend WebAii’s rich support to Silverlight. We want to extend our current API to be used interchangeably between HTML elements and XAML elements. This API should allow both action invokation and data retrieval for both element types (XAML & HTML). If we can accomplish that we can offer customers:

  • One consistent API for automating the HTML DOM and the XAML DOM.
  • Eliminate the need to learn a new automation framework for Silverlight and the need to integrate yet another new library into testing environments.
  • Enable a single test case to automate and interact with both the HTML & XAML elements on the same page to allow testing of the interaction points that mix HTML/XAML applications might have.
  • No breaking changes to existing testcases that are currently using WebAii. You can simply upgrade the library and then slowly update existing tests to include some Silverlight scenarios or start writing new automated tests for Silverlight within your existing testbed.

In my next post I’ll be digging into how WebAii’s Silverlight support will look like and discuss some of the current automation limitations with Silverlight and what Microsoft can do to help improve its testability.

Stay tuned!


PART II

9 comments:

Anonymous said...

Hello,

Thanks for sharing the information.

I am wondering how this will affect the performance testing and the tools associated with it.

Can you please throw some light on it?

mkoswell said...

Thanks ever so much, very useful article. If you do not mind, please visit my article related to travel to Pandeglang district in Banten, Indonesia at Kenali dan Kunjungi Objek Wisata di Pandeglang

Best regards

Anonymous said...

Buy world of warcraft power leveling and flyff goldand flyff money or Aion gold or2moons dilI be to aoc gold go rs gold to wow power leveling conan aoc power leveling When world of warcraft gold you need archlord gold gold Aion kina gold World of warcraft gold and archlord power leveling

John said...

Thanks for this post.I enjoyed reading it.It has really changed the way I think about internships.
Load Testing

runescape gold said...

rs gold
rs money
rs items
rs power leveling
rs powerleveling
rs accounts
runescape gold
runescape money
runescape items
runescape power leveling
runescape powerleveling
runescape accounts
buy runescape
cheap runescape
rs gold
rs money
rs items
rs power leveling
rs powerleveling
rs accounts
runescape gold
runescape money
runescape items
runescape power leveling
runescape powerleveling
runescape accounts
buy runescape
cheap runescape
rs gold
rs money
rs items
rs power leveling
rs powerleveling
rs accounts
runescape gold
runescape money
runescape items
runescape power leveling
runescape powerleveling
runescape accounts
buy runescape
cheap runescape

runescape money said...

rs gold
rs money
rs items
rs power leveling
rs powerleveling
rs accounts
runescape gold
runescape money
runescape items
runescape power leveling
runescape powerleveling
runescape accounts
buy runescape
cheap runescape
buy wow
cheap wow
wow gold
wow gold eu
wow money
wow powerleveling
wow power leveling
world of warcraft gold
world of warcraft money
buy world of warcraft
cheap world of warcraft
world of warcraft powerleveling
world of warcraft power leveling
eve isk
eve online isk
buy isk
cheap isk
buy eve
cheap eve

Anonymous said...

In 130 countries around the world, each piece of Omega was sold by first-class dealers is the young generation's ideal Omega Watches in modern times.as well as pursue the Omega Watches sale . In American, cheap Omega Watches is the most popular and dicount Omega Watches and the best Omega replica Watches. The combination of Omega Watch and the Omega Watch sale make Fake cheap Omega Watch the leader in the watchesindustry. dicount Omega Watch in moden times is very popular and Omega replica Watch must give you a new life!

louis vuitton mahina said...

In 1984, when louis vuitton tivoli pm was appointed as the designer of louis vuitton damier neverfull mm, he said in the public that vernis alma had never won a fashion orgasm nymphomania. The great designer has made so many contributions to the lv handbag career. He had released so many Chanel outlet and Chanel bags. With Yves Saint Laurent fashion From a man to voice of the fashion battles, Chanel Karl Lagerfeld, intentionally or unintentionally? for the first time, stood on an equal footing with the old rivals. If louis vuitton neverfull pm think all of those are willing to fawn upon the rich and powerful persons, then neverfull are wrong.

Lalisa said...

Excellent one for sharing this information about Silverlight