This topic describes how to run the tested Flash or Flex application under the Runtime Loader utility manually and how to automate this process.
Before You Begin
-
Regardless of the way you choose, you should use the RuntimeLoader.html page that you copied to the computer where the tested Flash or Flex application is located.
-
If you run Runtime Loader and the tested application from a local file system, you need to add the application’s folder to Flash Player's list of trusted locations. For detailed information on how you can do that, see the Setting Security Permissions topic.
Specifying the Tested Movie Manually
-
Open the RuntimeLoader.html web page in a web browser (for the list of the supported web browsers, see Requirements for Testing Flash and Flex Applications).
-
In the edit box on the page, specify the URL of the SWF file to be run for testing. You can specify a location which is relative to Runtime Loader’s location or specify an absolute path. If Runtime Loader resides in the same folder where the tested SWF file is located, then you can just enter the SWF file’s name with the .swf extension.
If the application is run on a web server, the absolute path to the SWF file can be specified in the following format:
http://myserver/TestedApp/MyApp.swfThe SWF file of the application to be tested and Runtime Loader must reside on the same web server. Otherwise, you will not be able to test the application. If the application resides on a local hard drive, you can specify the absolute path to the SWF file in either of the following formats:
file:///C:/TestedApp/MyApp.swf
-- or --
C:\TestedApp\MyApp.swf -
Specify the type of resources which the tested application can access (it depends on the value set in the
-use-network
compiler option when compiling the application to be tested):-
Select the Network (http://) option on the RuntimeLoader.html web page if the tested application was compiled to be able to use network resources (that is, if it was compiled with the
-use-network
compiler option set totrue
). -
Select the Local file system (file:///) option on the RuntimeLoader.html web page if the application was compiled to be able to access only local file system resources (the
-use-network
compiler option was set tofalse
).
-
-
Click the Load SWF button to load and run the specified SWF file.
Automating the Tested Movie Launch
To use Runtime Loader in automated tests, you need to automate the launch of your Flash or Flex application within Runtime Loader. A possible approach is to record the manual launch actions described above and use the recorded test commands to simulate the launch. However, we would recommend adding the RuntimeLoader.html page as a tested application to your project:
-
Open your test project in TestComplete.
-
If the project does not contain the Tested Applications project item, add this item to the project. To do this:
-
Right-click the project in the Project Explorer panel (by default, it is on the left of the TestComplete window), and select Add | New Item from the context menu.
-
In the subsequent dialog, select Tested Applications and click OK.
-
-
Right-click the Your_Project | TestedApps node in the Project Explorer and select Edit from the context menu. This will display the Tested Applications editor.
-
Right-click somewhere within the editor and then click Add Application. TestComplete will open the Add Tested Application wizard.
-
In the wizard, select Web Application. The wizard will open the Add a new Web application page.
-
On the page:
-
In the Web browser box, specify the web browser, in which the page will be opened. For the list of the supported web browsers, see Requirements for Testing Flash and Flex Applications.
-
In the Page URL box, specify the URL of the RuntimeLoader.html file on the server.
If your tested application and Runtime Loader are located on a web server, you should specify a URL like the one below:
http://myserver/MyApp/RuntimeLoader.html?url=MyApp.swf&useNetwork=trueIf you run Runtime Loader from a local hard drive, specify a URL like this one:
file:///C:/MyApp/RuntimeLoader.html?url=MyApp.swf&useNetwork=falseIn the URL, you should set the needed values in the following query string parameters (the parameters are highlighted in the examples above):
-
url - The URL of the SWF file to be tested. The path can be either relative or absolute.
-
useNetwork - A flag that specifies whether the tested application was compiled to be able to use network resources (the
-use-network
compiler option was set totrue
) or whether it was compiled to be able to access only local file system resources (the-use-network
compiler option was set tofalse
). For applications with network access enabled, set this flag totrue
. For applications compiled to use only local file system resources, set it tofalse
. The default value of the parameter isfalse
.
-
-
Click Finish to close the wizard and to apply the settings.
TestComplete will add the page to the tested applications list of your project.
-
Now Runtime Loader will start and load your Flash or Flex application when you launch tested applications in your tests, for example, when you use the TestedApp.Run
script method or when you use the Run TestedApp operation in keyword tests. See Running Tested Applications.
See Also
Runtime Loader Files
Preparing Flash and Flex Applications for Testing with the Runtime Loader Utility