Using Telerik Testing Framework with Silverlight Out-of-Browser and Elevated Trust

Basic functionalities

Your Silverlight runs correctly out-of-browser with elevated trust when running without Telerik Testing Framework. When running with Telerik Testing Framework, as part of automatic test execution, an error occurs similar to this:



This is a communication problem. Telerik Testing Framework supports elevated trust, but after a bit of configuring. Here are the changes that need to be made:

All web service calls need to be absolute hard-coded paths. They cannot use relative paths to locate their service. This is because during Out of Browser automation, Telerik software alters the path which is no longer understood by the web server.

The code below will fail because it uses a relative path:

TestMath context = new TestMath()
public TestMath() : 
this(new WebDomainClient<ITestMathContract>(new Uri("TestAutomationByRia-Web-Services-TestMath.svc", UriKind.Relative)))

This is fixed by modifying the initial call to hardwire in a service path:

TestMath context = new TestMath(new Uri("http://localhost:49569/ClientBin/TestAutomationByRia-Web-Services-TestMath.svc", UriKind.Absolute));

We have effectively forced the app to make cross-site calls, so this needs to be enabled on the server. You'll need to modify the app manifest, as well as generate some policy documents which tell the server this sort of operation is acceptable.

The AppManifest.xml file needs to set ExternalCallersFromCrossDomain in its root node:

<Deployment ... ExternalCallersFromCrossDomain="ScriptableOnly" ... >

And in the root of the server, these files need to be created:


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


<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "">
  <allow-http-request-headers-from domain="*" headers="SOAPAction,Content-Type"/>

t is possible that some lesser combination of these actions would be sufficient to get the app running, however these are the steps we had to take in our testing.

In this article
Not finding the help you need? Improve this article