Silverlight: Unable to Find the Target Host

PROBLEM

I'm trying to run a Silverlight test from Quick Execution, as part of a test list, or through the Telerik Testing Framework. The test fails with the Unable to find the target host error at the initial stages.

SOLUTION

This is likely related to the test settings. This errors frequently shows up when you add a coded step that performs actions against Silverlight elements in your test. There are a few things you need to check:

  • If you're running the test from Quick Execution in the Standalone version, go to the Project tab and check whether the test's SilverlightEnabled Test Property is set to True.
  • If you're running the test as part of a test list (applicable for the Standalone version and VS plugin), check whether the SilverlightEnabled property is set to True on the Web tab of Test List Settings.
  • Increase the Silverlight Connect Timeout in Project Settings > Recording Options.
  • If running the test as part of a test list, increase the Silverlight Connect Timeout on the Web tab of Test List Settings.
  • If you're using the Telerik Testing Framework, ensure your test includes the code below as the first line of your test. This is seen in this example.
  •  

    Settings.Current.Web.EnableSilverlight = true;

 

Note: These solutions apply only for execution-related problems with Silverlight (i.e. you were able to record a test successfully). If you're unable to connect the recorder to your Silverlight application to record a test, see this article.

 

Note: If you receive this error for a non-Silverlight test that contains frames, see the bottom of this page.