Silverlight Testing with WebAii - Part V

By Mike Hanson at November 13, 2010 22:22
Filed Under: Silverlight, Testing, WebAii

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

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

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.

Tag cloud

Previous Articles