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
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.
Cody
the Telerik team
Test Studio Trainings
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.
Cody
the Telerik team
Test Studio Trainings
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.
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
Test Studio Trainings
No problem at all. Glad we were able to assist!
Regards,Cody
the Telerik team
Test Studio Trainings