Flash Player has reached end of life on December 31, 2020. Support for Flash and Flex applications is now deprecated in TestComplete and will be removed in a future release. |
To test Flash and Flex applications with TestLeft and to access their internal objects, you can run such applications from the Runtime Loader utility shipped with TestLeft.
About Runtime Loader
Runtime Loader is a helper utility designed to test Adobe Flash and Flex applications. It exposes the internal structure of tested Flash and Flex applications to TestLeft and helps it recognize the application’s controls.
Runtime Loader exposes the application’s internal objects automatically. It does not require making any code changes or adding extra libraries to your Flash or Flex application.
Runtime Loader Files
Runtime Loader is shipped with TestLeft and is installed to the <TestLeft>\Open Apps\Flex\RuntimeLoader folder. It includes the following files:
-
RuntimeLoader.html - A wrapper web page for the Runtime Loader application.
-
RuntimeLoader.swf - A Runtime Loader module used to load Flash and Flex applications compiled for using only local file system resources, without network access (compiled with the
-use-network
compiler option set tofalse
). -
RuntimeLoaderLWN.swf - A Runtime Loader module used for loading Flash and Flex applications compiled for using network resources (compiled with the
-use-network
compiler option set totrue
).
Using Runtime Loader to Prepare Applications for Testing
1. Copy Runtime Loader Files to the Tested Server
For Runtime Loader to load your Flash or Flex application successfully, the Loader’s file must reside on the computer where the tested application resides.
Copy Runtime Loader files from the <TestLeft>\Open Apps\Flex\RuntimeLoader folder to the computer where the application to be tested resides. If the application is located on a web server, deploy Runtime Loader to that server. We recommend that you put Runtime Loader’s files to the same folder where the tested application’s SWF file resides.
If the location of your application does not change, you can copy Runtime Loader files only once when you start creating tests for your application. There is no need to copy them before each test.
2. Use RuntimeLoader.html as Start Page
Runtime Loader exposes objects of those Flash and Flex applications that were launched by it, so you should make the RuntimeLoader.html web page the start page for your tests.
-
Open the RuntimeLoader.html web page in a web browser.
-
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.
Preparing Web Browser
Preparing Internet Explorer
We recommend that you disable Protected Mode in Internet Explorer:
-
From the Internet Explorer main menu, select Tools | Internet Options.
-
Switch to the Security tab.
-
Clear the Enable Protected Mode check box and click OK.
-
Restart Internet Explorer.
Preparing Mozilla Firefox
Disable Flash Player Protected Mode
Starting from version 11.3, Firefox Flash Player plugin runs in protected mode on Windows 7 and later Windows versions. The protected mode may cause Flash Player to freeze or crash. If you experience these issues, disable Flash Player protected mode:
-
Open Flash Player configuration file mms.cfg in a text editor, for example, in Notepad. The mms.cfg file is in one of the following folders:
-
On 32-bit Windows: %WINDOWS%\System32\Macromed\Flash\
-
On 64-bit Windows: %WINDOWS%\SysWOW64\Macromed\Flash\
If the mms.cfg file does not exist, create it.
-
-
Add the following line at the end of the mms.cfg file and save the changes.
ProtectedMode=0
To enable the protected mode again, remove ProtectedMode=0 from the mms.cfg file.
Disable Flash Player Sandbox
If you use Firefox version 65 or later, disable the Flash Sandbox security mode:
-
Start Firefox and type
about:config
in the Address bar. This will open the Firefox settings page. -
Find the
dom.ipc.plugins.sandbox-level.flash
property in the list and set it to0
.
– or –
-
Open Windows Control Panel. To do this, you can, for example, click Start and then click Control Panel.
-
In the Search box, type environment variables and then click Edit environment variables for your account.
-
In the resulting dialog, create an environment variable named
MOZ_DISABLE_NPAPI_SANDBOX
with any value. -
Save the changes.
Setting Security Permissions
By default, the Flash Player does not allow the local SWF or FLV content to communicate with the Internet. To test Flash and Flex applications that reside on a local computer, allow the communication. To do this, add the folder where the application resides to Flash Player’s list of trusted locations:
-
Open the Control Panel | System and Security | Flash Player applet. You can also right-click somewhere within any Flash or Flex movie open in a web browser (or in the Flash Player standalone) and choose Global Settings from the context menu.
-
In the Flash Player Settings Manager, switch to the Advanced tabbed page and click the Trusted Location Settings button. This will invoke the Trusted Location Settings dialog.
-
In the Trusted Location Settings dialog, select Add and specify the path to your application or the folder where your application resides. The specified file or folder will be added to the list of trusted locations which are allowed to access the Internet.
If you have a Flash Player version earlier than 11, use the online version of the Adobe Flash Player Settings Manager to specify the list of trusted locations. To open the Global Security Settings panel where you can specify the list of trusted locations, navigate to the following URL:
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
Limitations
-
A Flash (or Flex) application and its wrapper web page may extensively interact and exchange data between each other. Runtime Loader can load only a .SWF file in which a Flash (Flex) application is implemented. The wrapper web page into which the application is embedded is not loaded by the Loader. Therefore, you cannot test such an application by using Runtime Loader properly.
-
Runtime Loader loads an application’s .SWF module by using the SWFLoader Flex control. The Runtime Loader application with its SWFLoader control becomes the parent application of the loaded one.
Runtime Loader and the loaded application compose a new application object hierarchy. If the loaded application was created without taking into account the fact that the application may be loaded by a SWFLoader control, such an application might work incorrectly when it is loaded into Runtime Loader.
To make the tested application compatible with Runtime Loader, modify the application’s source code in the following ways:
-
By referring to the parent application via the
moduleFactory["application"]
property. -
By using another approach for exchanging data between the application modules (for instance, interfaces).
-
-
We do not recommend that you use Runtime Loader to run applications compiled with the FlexClient library, since this may cause errors.
See Also
Preparing Flash and Flex Applications for Testing
Preparing Web Applications for Testing
Preparing Web Browsers for Testing