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

Issue with Silverlight OOB

5 Answers 112 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kim
Top achievements
Rank 1
Kim asked on 10 Dec 2012, 08:43 PM
I am extremely new to Test Studio and have run into an issue with using Test Studio with a Silverlight out-of-browser application.  I have the OOB app installed and it works just fine.  I have set up a new project with one test in Test Studio (using the latest version).  I have configured the Silverlight OOB settings for the test so that it points to my local application directory and uses "Silverlight Out-of-Browser" as the Recording Host.

The problem is when I try to record my test.  For some reason, it appears that my Silverlight app detects that it is NOT running in out-of-browser mode and essentially tries to install the application.  I did find this on a documentation page:

Once a Silverlight Out-of-Browser application is configured for recording, Test Studio modifies its shortcut to point directly to the application's location on disk. This replaces the Microsoft "offline://" notation. The side effect of this is that your application will not detect that it is running in Out-of-Browser mode and code must be written in the application to work around this limitation.

What code must be written to work around this limitation?  Can you give us an example?  Please note, this application MUST run in out-of-browser mode, so is there anything we can do to get this working with Test Studio?

Thanks for your help!

Kim

5 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 10 Dec 2012, 09:09 PM
Hello Kim,

What code must be written to work around this limitation?

Your own Silverlight application code must be modified/rewritten such that it works when while running "in-browser" mode. Currently your application must be written like this:

Get IsInOOBMode from Silverlight engine

If IsInOOBMode == false
Prompt to install app
else
Run App Normal
exit

Because Test Studio will force "IsInOOBMode" to always return false, somehow you need to eliminate this If condition and always run the app as if in OOB mode regardless of what the Silverlight engine tells you. Your software developer might be able to add a special test only configuration entry in your application that will force it to skip the If condition and always run the app (instead of prompting to install the app).

All the best,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Kim
Top achievements
Rank 1
answered on 10 Dec 2012, 09:34 PM

Thanks for your quick reply, Cody.


Our developers would like to know whether Test Studio actually changes anything in the Silverlight runtime that we can look for either through Application.Current or Application.Current.Host ( in the Settings collection perhaps)?

Thanks!

Kim
0
Cody
Telerik team
answered on 10 Dec 2012, 10:02 PM
Hi Kim,

One of the things we do to hook into your Silverlight application in order to automate it is update the app manifest to include our ArtOfTest.SLExtension.dll. If your developers can detect this being included in the app manifest, that's your clue that Test Studio is being used to automate your application. It would not be present in the app manifest otherwise.

Regards,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Kim
Top achievements
Rank 1
answered on 11 Dec 2012, 07:37 PM
Hi Cody,

We've gotten a little bit further now with the information you have provided so far.  Now we are experiencing problems connecting to web services.  One of our developers has modified our app to print out any error messages when trying to access a web service.  This is what is printed when running our app through Test Studio:

The provided URI scheme 'file' is invalid; expected 'http'.

So it now looks like the app is trying to access web services on the file system.  What do we need to do to resolve this issue?

Thanks for your help!

Kim
0
Cody
Telerik team
answered on 11 Dec 2012, 07:59 PM
Hi Kim,

As documented here: http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/knowledge-base/silverlight/out-of-browser-and-elevated-trust.aspx

"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."

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
Kim
Top achievements
Rank 1
Answers by
Cody
Telerik team
Kim
Top achievements
Rank 1
Share this question
or