This is a migrated thread and some comments may be shown as answers.

Silverlight: Error Launching OOB Application

8 Answers 53 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Top Gun
Top achievements
Rank 1
Top Gun asked on 20 Jun 2012, 08:40 PM

I have an out of browser Silverlight application.  When I open the application (from desktop) by double clicking, it runs fine.  In Test Studio, the Out of Browser application opens just fine when I need to record a test.  The problem occurs when I run the test.  Test Studio opens the application.  Everything looks good.  However, I receive a strange error message.  The error message states, “An error occurred while trying to make a request to URI ‘https://127.0.01/MyServiceSL/SomethingService.svc’.  This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services.  …”   The inner exception looks like the following:

{System.Security.SecurityException ---> System.Security.SecurityException: Security error.

   at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)

   at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClassa.<EndGetResponse>b__9(Object sendState)

   at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__1(Object sendState)

 

Do you have any idea what is wrong?  How do I get Test Studio to run this test and logon to this application?

8 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 20 Jun 2012, 08:56 PM
Hello Top Gun,

Based on your description and the error message, I suspect the problem is the way the application is trying to connect to the webservice. Often the application is programmed to use UriKind.Relative when initializing the webservice connection. Unfortunately this is not compatible with Test Studio. The application must use UriKind.Absolute as demonstrated in this code:

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

If your application is using Relative, you must ask your developers to modify the application to use Absolute. Once that is done then your application should be compatible with Test Studio.

Regards,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Top Gun
Top achievements
Rank 1
answered on 21 Jun 2012, 09:52 PM
Our endpoints are defined in the config file for Silverlight.  I am not sure that URIKind.Absolute can be applied here.  The endpoint is https.  Not sure whether that makes a difference.  Do you have any other ideas?
0
Cody
Telerik team
answered on 21 Jun 2012, 10:06 PM
Hi,

An HTTPS endpoint should be just fine. I don't believe that is the problem.

Can you share with me your config file and the code used to read it and create the end point? I'd like to review it to try and determine if it's trying to use Relative or Absolute paths.

Other than that, I do not have any ideas.

Kind regards,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Top Gun
Top achievements
Rank 1
answered on 29 Jun 2012, 05:00 PM

A co worker figured it out and showed me.  This was not easy to figure out.  Here are the steps. 

Open Test Studio.

Create A New Test Project.  Or Select Existing Test Project.

On the top menu bar, select the Project tab.

Click Show (“Settings”) on the Ribbon.  Pop Up titled “Project Settings” appears.

Select Recording Options.

Enter Base URL: 

This is the URL where the ClientBin directory resides.  The Silverlight start page will also be found in this location. For example, lets say my webpage comes up with the URL address, https://www.mydomain.com/SLcontent/silverlightStartPage.aspx#/Start

My start page is silverlightStartPage.aspx.  My Base URL would be https://www.mydomain.com/SLcontent.


For the field Elements Page Compare Mode, choose Base Url.

Select General (on the left side).  Click on Register certificates for https connection.

Click OK. 
This solution worked for me. 

Telerik should document this somewhere.  I did not see this anywhere in Telerik's documentation.

0
Cody
Telerik team
answered on 29 Jun 2012, 06:51 PM
Hi Top Gun,

I am very glad to hear you managed to resolve this problem. I suspect registering the certificate was the key. We have documented that here. Your symptom is one we haven't seen before however. You mentioned "cross-domain" which we do know can be a problem with OOB applications and web service calls.

Greetings,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Top Gun
Top achievements
Rank 1
answered on 02 Jul 2012, 03:20 PM
Thanks for the information.  Based on your explanation, I just need to click register https in the configuration settings.  Right now it is working for me.  But I will try that if I have this problem running Test Studio on a different computer.
0
Top Gun
Top achievements
Rank 1
answered on 24 Jul 2012, 03:40 PM
You are correct.  This problem is resolved by selecting register https in the configuration settings.  Thanks again!
0
Cody
Telerik team
answered on 24 Jul 2012, 04:01 PM
Hi,

No problem at all. Glad we were able to assist!

Regards,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Top Gun
Top achievements
Rank 1
Answers by
Cody
Telerik team
Top Gun
Top achievements
Rank 1
Share this question
or