Statlight unable to download prism modules

Jul 29, 2011 at 11:12 AM

Hi,

I am working composite silverlight 4 application using prism. I have got five different modules in separate xap files. I implement unit tests using silverlight toolkit. Everything is OK. I want to run those test using statlight  so that I want integrate unit tests TFS 2010 gated checkin but I cannot run. Statlight shows following error message and statlight process does not respond;

%localappdata%\statlight\statlight.exe -x="Presentation.Test.Unit.xap" --debug

StatLight - Version 1.4.4147
Copyright (C) 2009 Jason Jarrett
All Rights Reserved.

DiskXapHostFileLoader cannot find file - C:\Users\Administrator\AppData\Local\St
atLight\StatLight.Client.For.December2008.xap
DiskXapHostFileLoader cannot find file - C:\Users\Administrator\AppData\Local\St
atLight\StatLight.Client.For.March2009.xap
****************** Input options as configured ******************
ContinuousIntegrationMode          : False
Dlls                               : IEnumerable<string>
                                     {
                                     }
ForceBrowserStart                  : False
IsRequestingDebug                  : True
MethodsToTest                      : IEnumerable<string>
                                     {
                                     }
MicrosoftTestingFrameworkVersion   :
NumberOfBrowserHosts               : 1
OutputForTeamCity                  : False
QueryString                        :
ShowHelp                           : False
ShowTestingBrowserHost             : False
StartWebServerOnly                 : False
TagFilters                         :
TFSGenericReport                   : False
UnitTestProviderType               : Undefined
UseRemoteTestPage                  : False
WebBrowserType                     : SelfHosted
XapPaths                           : IEnumerable<string>
                                     {
                                       'Presentation.Test.Unit.xap'
                                     }
XmlReportOutputPath                :
*****************************************************************
RunnerType = OneTimeConsole
Starting configuration for: Presentation.Test.Unit.xap
XapItems.FilesContainedWithinXap = AnalogSubscriberModule.dll
XapItems.FilesContainedWithinXap = AppManifest.xaml
XapItems.FilesContainedWithinXap = Castle.Core.dll
XapItems.FilesContainedWithinXap = Castle.DynamicProxy2.dll
XapItems.FilesContainedWithinXap = ConfigurationManager.Business.dll
XapItems.FilesContainedWithinXap = ConfigurationManager.dll
XapItems.FilesContainedWithinXap = ConfigurationManager.Infrastructure.dll
XapItems.FilesContainedWithinXap = ConfigurationManager.TestSupport.dll
XapItems.FilesContainedWithinXap = DeviceConfiguration.Model.Silverlight.dll
XapItems.FilesContainedWithinXap = LinkModule.dll
XapItems.FilesContainedWithinXap = Microsoft.Practices.EnterpriseLibrary.Common.
Silverlight.dll
XapItems.FilesContainedWithinXap = Microsoft.Practices.EnterpriseLibrary.Validat
ion.Silverlight.dll
XapItems.FilesContainedWithinXap = Microsoft.Practices.Prism.Interactivity.Silve
rlight.dll
XapItems.FilesContainedWithinXap = Microsoft.Practices.Prism.Silverlight.dll
XapItems.FilesContainedWithinXap = Microsoft.Practices.Prism.UnityExtensions.Sil
verlight.dll
XapItems.FilesContainedWithinXap = Microsoft.Practices.ServiceLocation.dll
XapItems.FilesContainedWithinXap = Microsoft.Practices.Unity.Interception.Silver
light.dll
XapItems.FilesContainedWithinXap = Microsoft.Practices.Unity.Silverlight.dll
XapItems.FilesContainedWithinXap = Microsoft.Silverlight.Testing.dll
XapItems.FilesContainedWithinXap = Microsoft.VisualStudio.QualityTools.UnitTesti
ng.Silverlight.dll
XapItems.FilesContainedWithinXap = Moq.Silverlight.dll
XapItems.FilesContainedWithinXap = Presentation.Test.Unit.dll
XapItems.FilesContainedWithinXap = Prismv4FrameRegionNavigation.dll
XapItems.FilesContainedWithinXap = System.ComponentModel.DataAnnotations.dll
XapItems.FilesContainedWithinXap = System.Windows.Controls.Data.Input.dll
XapItems.FilesContainedWithinXap = System.Windows.Controls.dll
XapItems.FilesContainedWithinXap = System.Windows.Controls.Navigation.dll
XapItems.FilesContainedWithinXap = System.Windows.Interactivity.dll
XapItems.FilesContainedWithinXap = System.Xml.Linq.dll
Incoming MSTest file's hash = 357A677957F309AE85C3E5AEEDA43A32BCA23AD3
Attempting to open port at http://localhost:8887/
testPageUrlWithQueryString = http://localhost:8887/GetHtmlTestPage?
IRunner typeof(OnetimeRunner)


Starting Test Run: 29.07.2011 11:48:48

Listening on http://localhost:8887/
Loading XapHost file [MSTestApril2010]
Loading XapHost [C:\Users\Administrator\AppData\Local\StatLight\StatLight.Client
.For.April2010.xap]
XapItems.FilesContainedWithinXap = AnalogSubscriberModule.dll
XapItems.FilesContainedWithinXap = AppManifest.xaml
XapItems.FilesContainedWithinXap = Castle.Core.dll
XapItems.FilesContainedWithinXap = Castle.DynamicProxy2.dll
XapItems.FilesContainedWithinXap = ConfigurationManager.Business.dll
XapItems.FilesContainedWithinXap = ConfigurationManager.dll
XapItems.FilesContainedWithinXap = ConfigurationManager.Infrastructure.dll
XapItems.FilesContainedWithinXap = ConfigurationManager.TestSupport.dll
XapItems.FilesContainedWithinXap = DeviceConfiguration.Model.Silverlight.dll
XapItems.FilesContainedWithinXap = LinkModule.dll
XapItems.FilesContainedWithinXap = Microsoft.Practices.EnterpriseLibrary.Common.
Silverlight.dll
XapItems.FilesContainedWithinXap = Microsoft.Practices.EnterpriseLibrary.Validat
ion.Silverlight.dll
XapItems.FilesContainedWithinXap = Microsoft.Practices.Prism.Interactivity.Silve
rlight.dll
XapItems.FilesContainedWithinXap = Microsoft.Practices.Prism.Silverlight.dll
XapItems.FilesContainedWithinXap = Microsoft.Practices.Prism.UnityExtensions.Sil
verlight.dll
XapItems.FilesContainedWithinXap = Microsoft.Practices.ServiceLocation.dll
XapItems.FilesContainedWithinXap = Microsoft.Practices.Unity.Interception.Silver
light.dll
XapItems.FilesContainedWithinXap = Microsoft.Practices.Unity.Silverlight.dll
XapItems.FilesContainedWithinXap = Microsoft.Silverlight.Testing.dll
XapItems.FilesContainedWithinXap = Microsoft.VisualStudio.QualityTools.UnitTesti
ng.Silverlight.dll
XapItems.FilesContainedWithinXap = Moq.Silverlight.dll
XapItems.FilesContainedWithinXap = Presentation.Test.Unit.dll
XapItems.FilesContainedWithinXap = Prismv4FrameRegionNavigation.dll
XapItems.FilesContainedWithinXap = System.ComponentModel.DataAnnotations.dll
XapItems.FilesContainedWithinXap = System.Windows.Controls.Data.Input.dll
XapItems.FilesContainedWithinXap = System.Windows.Controls.dll
XapItems.FilesContainedWithinXap = System.Windows.Controls.Navigation.dll
XapItems.FilesContainedWithinXap = System.Windows.Interactivity.dll
XapItems.FilesContainedWithinXap = System.Xml.Linq.dll
re-writing host xap with the following files
    add -  AnalogSubscriberModule.dll
        updated AppManifest - AnalogSubscriberModule
    -  already has file AppManifest.xaml
    add -  Castle.Core.dll
        updated AppManifest - Castle.Core
    add -  Castle.DynamicProxy2.dll
        updated AppManifest - Castle.DynamicProxy2
    add -  ConfigurationManager.Business.dll
        updated AppManifest - ConfigurationManager.Business
    add -  ConfigurationManager.dll
        updated AppManifest - ConfigurationManager
    add -  ConfigurationManager.Infrastructure.dll
        updated AppManifest - ConfigurationManager.Infrastructure
    add -  ConfigurationManager.TestSupport.dll
        updated AppManifest - ConfigurationManager.TestSupport
    add -  DeviceConfiguration.Model.Silverlight.dll
        updated AppManifest - DeviceConfiguration.Model.Silverlight
    add -  LinkModule.dll
        updated AppManifest - LinkModule
    add -  Microsoft.Practices.EnterpriseLibrary.Common.Silverlight.dll
        updated AppManifest - Microsoft.Practices.EnterpriseLibrary.Common.Silve
rlight
    add -  Microsoft.Practices.EnterpriseLibrary.Validation.Silverlight.dll
        updated AppManifest - Microsoft.Practices.EnterpriseLibrary.Validation.S
ilverlight
    add -  Microsoft.Practices.Prism.Interactivity.Silverlight.dll
        updated AppManifest - Microsoft.Practices.Prism.Interactivity.Silverligh
t
    add -  Microsoft.Practices.Prism.Silverlight.dll
        updated AppManifest - Microsoft.Practices.Prism.Silverlight
    add -  Microsoft.Practices.Prism.UnityExtensions.Silverlight.dll
        updated AppManifest - Microsoft.Practices.Prism.UnityExtensions.Silverli
ght
    add -  Microsoft.Practices.ServiceLocation.dll
        updated AppManifest - Microsoft.Practices.ServiceLocation
    add -  Microsoft.Practices.Unity.Interception.Silverlight.dll
        updated AppManifest - Microsoft.Practices.Unity.Interception.Silverlight

    add -  Microsoft.Practices.Unity.Silverlight.dll
        updated AppManifest - Microsoft.Practices.Unity.Silverlight
    -  already has file Microsoft.Silverlight.Testing.dll
    -  already has file Microsoft.VisualStudio.QualityTools.UnitTesting.Silverli
ght.dll
    add -  Moq.Silverlight.dll
        updated AppManifest - Moq.Silverlight
    add -  Presentation.Test.Unit.dll
        updated AppManifest - Presentation.Test.Unit
    add -  Prismv4FrameRegionNavigation.dll
        updated AppManifest - Prismv4FrameRegionNavigation
    add -  System.ComponentModel.DataAnnotations.dll
        updated AppManifest - System.ComponentModel.DataAnnotations
    add -  System.Windows.Controls.Data.Input.dll
        updated AppManifest - System.Windows.Controls.Data.Input
    -  already has file System.Windows.Controls.dll
    add -  System.Windows.Controls.Navigation.dll
        updated AppManifest - System.Windows.Controls.Navigation
    add -  System.Windows.Interactivity.dll
        updated AppManifest - System.Windows.Interactivity
    -  already has file System.Xml.Linq.dll

*****************************************
An unknown request was made to the StatLight's web server. You may want to check
 your test project for what generated the following request.
********** Request Information **********
       Url : http://localhost:8887/ServiceAgentsModule.xap
HttpMethod : GET
  PostData :
*****************************************


*****************************************
An unknown request was made to the StatLight's web server. You may want to check
 your test project for what generated the following request.
********** Request Information **********
       Url : http://localhost:8887/MenuModule.xap
HttpMethod : GET
  PostData :
*****************************************


*****************************************
An unknown request was made to the StatLight's web server. You may want to check
 your test project for what generated the following request.
********** Request Information **********
       Url : http://localhost:8887/ServiceAgentsModule.xap
HttpMethod : GET
  PostData :
*****************************************


*****************************************
An unknown request was made to the StatLight's web server. You may want to check
 your test project for what generated the following request.
********** Request Information **********
       Url : http://localhost:8887/MenuModule.xap
HttpMethod : GET
  PostData :
*****************************************


------------------ Test Failed ------------------
Test Namespace:  [StatLight]
Test Class:  [CannotFigureItOut]
Test Method: [NotEnoughContext]
Other Info: A Silverlight MessageBox dialog was automatically closed.
Caption:
Dialog Message:
Windows Internet Explorer
-------------------------------------------------
Clicking OK on a dialog (MessageBox)

Coordinator
Jul 29, 2011 at 2:40 PM

If you take a look at the sequence diagram at the documentation home page http://statlight.codeplex.com/documentation. You should notice 2 things. 1. StatLight starts it's own in memory web server, and 2 is your test project's xap is re-written to be included into StatLight. This means StatLight is now the "Host" application and your assemblies/other files are just coming along for the ride.

Because your application is now NOT the "host" application AND this rewritten xap is coming from the StatLight web server anything you do to try to talk back to "home base" from within your tests are going to be talking back to the StatLight web server (which is why you see the "...unknown request was made to the StatLight's web server...".

What you need to do:

  1. Modify your xap downloader to allow you to configure it's download location.
  2. When run in a StatLight test - re-configure it's download location to point to the correct location of where to download the xaps.

An option you can consider when making this change is possibly using the StatLight's querystring parameter. You can have your build scripts call statlight passing in some sort of configuration, pull it out of the querystring within your silverlight test and use that to reconfigure your xap downloader.

Hope this helps you get started.