Testing In-Browser Silverlight Applications - Requirements

Applies to TestComplete 14.70, last modified on April 22, 2021

The information in this topic applies to web tests that locate web objects by using internal identification properties provided by TestComplete and run in local environments.

Testing In-Browser Silverlight applications with TestComplete has certain requirements to the Silverlight run-time version, TestComplete plugins, web browser and the tested application itself. These requirements are listed below in this topic.

Supported Application Types

TestComplete supports testing applications created with Silverlight 4 or 5.

TestComplete can test only those Silverlight applications that were compiled and packed to an application package (the .xap file). Silverlight applications loaded by wrapper web pages directly from XAML source code files (.xaml) without using .xap package files are not supported.

Supported Browsers

The tested Silverlight application must run in one of the following Internet browsers:

  • Internet Explorer ver. 11, including Silverlight 5 applications running in 64-bit versions of Internet Explorer.

  • Any web browser based on the Microsoft WebBrowser control.

Clear the browser cache and set the page's zoom ratio to 100% before testing. See the Preparing a Web Browser for Testing Silverlight Applications topic for more information.

Silverlight in-browser applications running under Mozilla Firefox and Silverlight out-of-browser applications can be tested only via the UI Automation technology which provides less access to the application internals.

Supported Silverlight Runtime Versions

You must have Silverlight ver. 4.0.50826.0 or later installed on the TestComplete computer. You can download the latest Silverlight version from here:

http://www.microsoft.com/getsilverlight

Testing Silverlight Applications Through the HTTPS Protocol

When your Silverlight application communicates through the secure hypertext transfer protocol (HTTPS), TestComplete cannot automatically gain in-depth access to the application. In order to test such an application, you should manually process it with the tcAgPatcher utility as described in the Preparing In-Browser Silverlight Applications for Testing topic.

Preparing In-Browser Silverlight Applications for Testing

  • The tested Silverlight application must be compiled and packed to a package file (.xap) from which a wrapper web page will load the application. TestComplete does not support Silverlight applications that are loaded by wrapper web pages directly from XAML files (.xaml) containing the applications’ source code. Due to some specifics of such Silverlight applications, TestComplete cannot recognize their internal objects and make them testable.

    The following example demonstrates embedding of supported and unsupported Silverlight applications into a wrapper web page via an object HTML element:

    HTML

    <!-- Embedding a Silverlight application from a .xap file (supported) -->
    <div id="silverlightControlHost">
        <object width="640" height="480" data="data:application/x-silverlight-2," type="application/x-silverlight-2" >
            <param name="source" value="MySilverlightApp.xap"/>
            <param name="minRuntimeVersion" value="4.0.50826.0" />
            <a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">
                <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>
            </a>
        </object>
    </div>

    <!-- Embedding a Silverlight application from a .xaml file (unsupported) -->
    <div id="silverlightControlHost">
        <object width="640" height="480" data="data:application/x-silverlight-2," type="application/x-silverlight-2" >
            <param name="source" value="MySilverlightApp.xaml"/>
            <param name="minRuntimeVersion" value="4.0.50826.0" />
            <a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">
                <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>
            </a>
        </object>
    </div>

  • Generally, TestComplete automatically treats tested Silverlight applications as Open Applications. That is, TestComplete provides access to the applications’ internal objects, their methods, properties and fields without special preparations.

    However, there are cases when the automatic Silverlight application patching mechanism is not supported and you must prepare your application manually.

    To learn which applications are patched automatically and which are not, and how to patch applications manually, see Preparing In-Browser Silverlight Applications for Testing.

  • TestComplete is unable to recognize objects, methods and properties of a Silverlight application automatically if the application is running on a server that requires Negotiate, NTLM or some other authentication.

    In order for TestComplete to be able to access internal objects, methods and properties of this Silverlight application, prepare the application for testing with the tcAgPatcher utility. See Preparing In-Browser Silverlight Applications for Testing for complete information.

Testing Cross-Domain Silverlight Applications

Once your Silverlight application uses cross-domain communication, you need to put additional efforts to test it with TestComplete. See detailed instructions in the “Making Cross-Domain Silverlight Applications Testable with TestComplete” section of the Preparing In-Browser Silverlight Applications for Testing topic.

Silverlight Support Plugins

Core Silverlight Plugins

TestComplete support for testing Silverlight applications is provided by the following plugins:

  • Silverlight Application Support
  • Open Applications
  • Web Testing

These plugins are installed and enabled automatically. Therefore, you can test most Silverlight applications right out-of-box, without any additional configuration.

You can check to see if these plugins are active by selecting File > Install Extensions from the TestComplete main menu. If one of these plugins is not available, you need to run the TestComplete installation in the Repair mode.

To use the plugins, you must have a license for TestComplete Web module.

Plugins for Silverlight Controls Automation

The TestComplete Web module also includes pre-installed plugins for automated testing of Silverlight controls. These plugins provide test objects, methods and properties for automating various operations on Silverlight controls, getting their contents, state and so on.

Just like core Silverlight support plugins, these plugins are also installed and enabled automatically.

You can verify that these plugins are active using the File | Install Extensions dialog. To re-install the plugins, run the TestComplete installation in the Repair mode.

See Also

Testing Silverlight Applications
Preparing In-Browser Silverlight Applications for Testing
Preparing a Web Browser for Testing Silverlight Applications
Using Microsoft UI Automation Technology
Installing Extensions

Highlight search results