Silverlight Testing with WebAii–Part IV

By Mike Hanson at November 08, 2010 17:35
Filed Under: .NET, Testing, WebAii, Visual Studio

The fourth part of my series on testing Silverlight applications with the WebAii UI Automation Fx is now available here

WebAii and FitNesse

By Mike Hanson at October 14, 2010 21:13
Filed Under: .NET, Silverlight, Testing

Well now I am getting seriously worried.  After I got so far with automated UI testing with WebAii and NUnit I thought I was finished as the Automation Master on my team and could get on with some interesting work.  Oh no while I was down with a heavy dose of Man Flu the team decided to use FitNesse for defining acceptance tests and they want me to integrate this with the WebAii tests.  I guess their argument that I was the one with most experience of test automation so I will be up and running quicker is valid, but it worries me that I am doing so much testing and only a little programming.

 

If you are not familiar with it FitNesse is basically a Wiki that supports defining acceptance tests as tables of inputs and outputs and links to a test runner to execute the tests.  That is a bit of an over simplification but it will do for now.

 

It didn’t take long to get FitNesse setup so I started looking at how we could use it in conjunction with WebAii.  That took a while longer I figured out a way to do it and managed to port some of my existing code over to get a first test running.

 

So now my series on Silverlight Testing with WebAii will be at least one episode longer as I will include an extra one on how to get this done.

Silverlight Testing with WebAii–Part III

By Mike Hanson at October 12, 2010 01:10
Filed Under: Silverlight, Testing

The third part of my series on testing Silverlight applications with the WebAii UI Automation Fx is now available here

Silverlight Testing with WebAii–Part II

By Mike Hanson at October 11, 2010 10:25
Filed Under: Testing, Silverlight

The second part of my series on testing Silverlight applications with the WebAii UI Automation Fx is now available here

Adding a dictionary for the CodeRush spell checker

By Mike Hanson at September 25, 2010 18:01
Filed Under: CodeRush, Visual Studio

As a long time CodeRush + Refactor Pro user I was pleased when DevExpress added a Spell Checker plugin, I was even more pleased when I opened the options page and saw I could change the culture to English (United Kingdom).  However my joy was short lived when I discovered that changing the culture effectively disables spell checking.  For a while I just switched it back to English (United States) and lived with the irritating differences, but finally I got fed up and decided to figure out how to get the spell checker working for proper English.  What I discovered was that changing the culture is not enough, you actually have to install a dictionary that matches that culture.  So when I select English (United Kingdom) in the culture list the spell checker is looking for a dictionary with the name en-GB the standard code for the UK culture.  One option would be to take the standard en-US dictionary and modify it, but I also discovered that CodeRush supports the Open Office dictionary format, so I went off in search of one to install.  This article describes the steps to download and install an Open Office dictionary with CodeRush.

Silverlight Testing with WebAii UI Automation Fx

By Mike Hanson at September 23, 2010 04:19
Filed Under: Testing

I've been doing quite a bit of automated UI testing at work lately and learned a lot about something that only has basic documentation so I have started working on a series of articles that I hope will help others.

The introductory article is at http://www.borntocode.co.uk/page/Silverlight-Testing-with-WebAii-UI-Automation-Fx-.aspx

Silverlight cross domain WCF calls with VS WebDev.WebServer.exe

By Mike Hanson at September 18, 2010 20:54
Filed Under: .NET, WCF

This one had me stuck for hours earlier this week, and judging by the number of posts on forums plenty of other people are suffering the same, so I hope this little titbit saves someone the frustration I suffered.

I am using Visual Studio 2008 to create a Silverlight 2.0 (beta 2 at the moment) application. In my solution I have two web site projects, one for hosting the application, the other to host WCF services.  All I want is to hit F5 and have both sites run in debug mode and my SL app call my WCF services and work.  So I set my projects up as I believed they should be via the properties sheet for the project root as follows.

  • Disabled dynamic ports so I know the fixed address of the WCF
  • Remove the virtual directory name to make both root applications
  • Add the following clientaccesspolicy.xml file to the root of the WCF site (wide open for now)

<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
  <policy>
   <allow-from>
    <domain uri="*"/>
   </allow-from>
   <grant-to>
    <resource path="/"
        include-subpaths="true"/>
   </grant-to>
  </policy>
</cross-domain-access>
</access-policy>

So having written the code for my SL app to call my WCF service, references and all that stuff working fine I expect it all to work, I hit F5 in VS 2008 and both sites run, I can browse to the .svc file and get a working web page telling me how to create a client but in my SL application I get an error when I hit the button to call the service.

WTF? double check, triple check, hours of googling to make sure I have done it right, that my clientaccesspolicy.xml file is right still not working.  I read hundreds of blog/forum posts and articles and still no clue.  Many talked about problems with WebDev.WebServer.exe not having a root to place the policy file in but I had that covered you can change it in the properties sheet for the project.   Still no luck.

Just when I was about to give up and wire my project up to IIS I re-read an article that I had spotted earlier about "Self Hosting" WCF services in a Windows Service and what was required in the policy file to support this.  Light bulb moment, WebDev.WebServer.exe may not be a Windows Service but it is effectively a "Self Hosting Process", a quick change to my clientaccesspolicy.xml file and bingo it works.  What did I change?  Look below at the attribute in bold on the <allow-from> element.

<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
  <policy>
   <allow-from http-request-headers="*">
    <domain uri="*"/>
   </allow-from>
   <grant-to>
    <resource path="/"
        include-subpaths="true"/>
   </grant-to>
  </policy>
</cross-domain-access>
</access-policy>

So make this note in your little black book:

When it comes to web services (WCF or ASMX) WebDev.WebServer.exe is a Self Hosting Process and any requirements for self hosting apply.

Clean Namespace AddIn

By Mike Hanson at September 18, 2010 20:50
Filed Under: Visual Studio

One of my pet hates about Visual Studio is that it assumes that you organise folders in projects according to namespaces and adds folder names to the namespace declaration for classes.  Worse still there is no way to turn this behaviour off.

Usually I get by this by adding my classes to the root of the projec then dragging them to the relevant folder, and I strongly suggest that developers working for me do the same.  This week I came across a developer who complained about this and come up with reasons based around the lack of tool help if they forget to do this, so I decided to write an addin that automagically sets the namespace declaration of new C# classes added to match the Default Namespace setting in Project Properties.  I have called it Clean Namespace and published it on Visual Studio Gallery

No commands, menus or UI it just detects when a new C# class file is added to your project and changes the namespace declaration.  You can turn it off simply by disabling the addin via Tools, Add-in Manager...

Download Clean Namespace Visual Studio Installer

Change of domain name

By Mike Hanson at September 18, 2010 20:45
Filed Under: Commentary

Whilst I still retain my original domain name mikehanson.com the domain name and email address particularly have become a target of so much spam I got fed up of trying to protect it so decided to find a new domain name that communicates my passion for what I do.

I have migrated some of the content from mikehanson.com but have not bothered with the NavFx stuff as this is now defunct since Silveright 3 was introduced with a built in navigation framework.

Change of Blog Engine

By Mike Hanson at September 18, 2010 20:42
Filed Under: Commentary

Originally I chose Subtext for my blog, but recently I have found that other .NET blog engines have improved more and after reviewing the orginal set and some new ones I have settled on BlogEngine.NET.

Tag cloud

Previous Articles