Category Archives: 8458

Recording Silverlight actions on Microsoft Test Manager

Whilst try to record some manual tests in MTM for a new Silverlight application I found I was not getting any actions recorded, just loads of “Fail to record the object corresponding to this action” warnings in the actions window.

Turns out to fix this you have to do three things

  1. Install the Visual Studio 2010 Feature Pack 2 (MSDN Subscribers Only) – this adds Silverlight support to MTM (this I had already done)
  2. In your SIlverlLight application you need to reference the Microsoft.VisualStudio.TestTools.UITest.Extension.SilverlightUIAutomationHelper.dll  from the folder C:\Program Files (x86)\Common Files\microsoft shared\VSTT\10.0\UITestExtensionPackages\SilverlightUIAutomationHelper
  3. Finally if using IE9 you need to run IE in IE8 mode. To do this in IE9 press F12 and select the browser mode

image

Once this was done I got the actions I would expect

image

Somewhat nasty upgrade experience with Seesmic Desktop 2

A few days ago I got the regular ‘there is a new version of seesmic’ message.

image

So I pressed update and got the less than helpful message

image

After a quick search on the web I found the log files are in C:\Users\[username]\Documents\Seesmic\Seesmic Desktop 2\Logs, why that cannot be listed on the error dialog I don’t know!.

Unfortunately there was nothing obvious in the log, just a list of plug-ins it loaded. So I went back and tried the upgrade again, reading the release notes (I know a strange idea) and noticed that it mentioned a specific version of Silverlight. A quick check of this showed I was not up to date, so I went to http://www.microsoftr.com/silverlight and ran the installer, which updated my install (I would have expected Windows Update to have done this).

I tried the update again it failed, I then remembered that IE was running and this could have blocked some of the Silverlight assembly updates so I closed all browsers down. I also deleted the Seesmic log files, so I could get a clean look at any errors. I reloaded Seesmic and was present with an updating dialog.

image

And all seems to be working, not sure which step actually fixed it!

Lets seem what the new UI is like to use……

Empty page being show for Silverlight application running out of browser

Whilst preparing demo’s for our design event next week I hit a problem with the out of browser experience in Silverlight 3. I had decided to add the out of browser settings to our 2009 Christmas Card Silverlight application. To do this all you need to do is check a box on the project settings

image

I ran the application in the browser and all was OK, I right clicked to installed it to the desktop and it ran OK but I got an empty white screen

image

Turns out the problem was due to a trick we had pulled in the page load. The comic page is a bit long, we had found that of we set the SIlverlight control in the browser page to the comic height the loading spinner could often appear off the bottom of the browser window (especially if the window was not maximised). To address this we set the height of the Silverlight Control small in the containing web page, then at the end of the loading reset it the required height. The fact we were trying to access an HTML Control was the problem, when you are out of the browser there is no HTML page to access.

The solution was single, wrapper the call in conditional test

 if (Application.Current.IsRunningOutOfBrowser == false)
 {
      // resize to the correct size, we keep the height small during the load so the loading spinner is easy to see
      // remember this only works if in a browser
      HtmlPage.Document.GetElementById("silverlightControlHost").SetStyleAttribute("height", "930px");
 }


.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

One this change was made the application worked fine both inside and outside the browser



image

SLExtensions HTMLEditor

I have been looking at porting a old content editor I wrote from WinForm to SilverLight and hit the problem there was no HTML editor control available in the standard Silverlight 2 control set. Roll in the excellent SLExtensions controls on CodePlex, to save the day…..

Now I did hit one problem with the HTMLEditor, that was addressed very quickly in for support forums. The point to watch out for is that for the HTMLEditor control to work the Silverlight object must be loaded into the web page with the setting to be windowless

<object id="appId"  data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%" > 
    <!– all the other parameters –>
    <param value="true" name="windowless"/>
</object>

If you just add the object with default settings to a new web page, or let Visual Studio generate a dynamic test page then this is not set. You end up rendering the editor but cannot enter text.

Hope this saves you some time.

Blend and Source control

It is all well and good Microsoft saying that a developers and designer can share the same project WPF/Silverlight files in Visual Studio and Expression Blend, but whilst Blend does not have the ability to use a source control repository (TFS, SVN or anything else for that matter) and actually strips out  any source control binding it finds in a project file, this is for me unworkable experience. How has this product got to V2 without this feature?

For any company interested in a quality development process source control must be the most basic safety net, irrespective of how agile their methodology is.

I suppose there is one agile model where it could almost work and that is the designer and developer pair programing on the same PC with Blend and VS installed – but how realistic is that? and certainly does not scale beyond two people.

So as I am at Remix, I just asked Scott Guthrie when we would see source control in Blend – he said next version, some time next year, but on the plus side it should also include TFS work item integration. All good but we need it now, this is such a barrier to adoption of the Blend products.

No Silverlight NBC Olympics for us

After the announcement at Mix of the NBC Silverlight Olympic streaming service I was looking forward to have a look at what had been created. Turns out you have to be in the USA to watch it, I assume due to media rights issues, a bit of a shame. I hope something can be worked out with a small fraction of the 2200 hours of content so we can all see what Silverlight can do for such a major event.

Back to the BBC Flash streams then…………

ps. I suppose it is to be expected, you get the same problem with the TMS cricket coverage and other BBC Internet streams