TestComplete9 测试Flash UI的初始化问题

1、第一次使用TC9 测试Flash UI,会存在“Loaded .SWF File Not Prepared for Testing”的问题。

2、点击Help弹出帮助:

You may receive this message when trying to record a test against a Flex or Flash application or when exploring the application with the Object Spy. TestComplete displays this message if the Flash or Flex application under test was not prepared for testing.

To get access to a Flash or Flex application’s internal objects and to their public properties, prepare the application in one of the following ways:

  • To enable this access, use the debug version of Flash Player to run Flash and Flex applications and configure the Player to preload the FlashInjector.swf helper Flash movie when loading SWF files of the Flash or Flex application to be tested. This allows you to make all Flash and Flex applications created with ActionScript 3.0 testable at run time. FlashInjector.swf is shipped along with TestComplete and resides in the <TestComplete 9>\Open Apps\Flex folder. To learn how you can use the debug version of Flash Player for automated testing, see the topics of the Testing Flash and Flex Applications With the Debug Version of Flash Player section.

  • You can also run the application via a special Runtime Loader utility delivered along with the TestComplete installation package. You can find this utility in the <TestComplete 9>\Open Apps\Flex\RuntimeLoader folder. To better learn how to run Flash and Flex applications using this utility, see Testing Flash and Flex Applications with the Runtime Loader Utility.

  • As an alternative, you can ask the application developers to include the FlexClient.swc library, which is a part of the TestComplete package, in the application under test. They could create, for example, an individual testing-enabled version of the application with this library embedded while keeping the release version unchanged.

    Note that the TestComplete installation package contains three versions of this library (different library versions correspond to different versions of Flex SDK). So, you should choose the needed library version depending on the Flex SDK version you’re using. For detailed instructions on how to include this library in a Flash or Flex application for automated testing, see Testing Flash and Flex Applications with the FlexClient Library.

在这里选择第二种方法。

3、到安装目录下:C:\Program Files (x86)\SmartBear\TestComplete 9\Open Apps\Flex

寻找:RuntimeLoader文件夹

4、

Testing Flash and Flex Applications with the Runtime Loader Utility

One of the approaches to testing Flash and Flex applications with TestComplete is to run such applications from the Runtime Loader utility shipped along with TestComplete. The topics of this section provide information on specifics of using Runtime Loader to run Flash and Flex applications to be tested.

In This Section

Testing Flash and Flex Applications with the Runtime Loader Utility - Overview

Provides general information about testing Flash and Flex applications with Runtime Loader.

Limitations on Testing with the Runtime Loader Utility

Contains information about limitations on using Runtime Loader for testing Flash and Flex applications.

Preparing Flash and Flex Applications for Testing with the Runtime Loader Utility

Describes general preparations you may need to do before testing your Flash or Flex application.

Runtime Loader Files

Lists the files the Runtime Loader utility includes.

Runtime Loader Page Description

Explains how to run a Flash or Flex application under Runtime Loader.

Creating Custom Runtime Loader

Explains how to create a custom runtime loader for Flash and Flex applications.

Troubleshooting Runtime Loader

Describes common problems and solutions for using Runtime Loader with Flash and Flex applications.

5、

Preparing Flash and Flex Applications for Testing with the Runtime Loader Utility

TestComplete provides you with extended abilities for creating flexible tests for Flash and Flex applications using the Runtime Loader utility. In order to test your Flash and Flex applications, you do not have to change your code in any way. You may need to perform some preparations before the testing.

Below is the list of preparations that you may need to perform before testing your Flash or Flex application. These preparations include general preparations that configure the environment and method-specific preparations that are needed to be able to get access to the application’s internals with the Runtime Loader utility.

Note:General preparations are common for all of the testing approaches. That is, you need to adjust your environment only once before the testing.

In order to prepare your Flash or Flex application for testing with the RuntimeLoader utility, go through the following steps:

Note:In the Tips on Creating Testable Flash and Flex Applications topic you can find some additional recommendations on how to make your Flash and Flex applications more test-friendly.

6、

Running Flash and Flex Applications with the Runtime Loader Utility

In order to get access to Flash or Flex applications’ internals using the Runtime Loader helper utility, you have to run the tested application under the Runtime Loader utility. To prepare your application properly, you have to do the following:

1. Copy Runtime Loader Files to the Tested Server

In order for Runtime Loader to be able 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 <TestComplete>\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. For a detailed description of how to open the page and specify the tested application manually and how to automate this process, see Runtime Loader Page Description.

7、如上所述

Runtime Loader files目录下的三个文件全部拷贝到被测对象的安装目录下D:\SAP\SCC-3_2\services\EmbeddedWebContainer\container\Jetty-7.6.2.v20120308\work\jetty-0.0.0.0-8282-scc.war-_scc-any-\webapp,在这里有我们的main.swf和index.html。

8、然后采用RuntimeLoader.html代替原有的index.html才启动网页。

https://dewdfgwd00812:8283/scc改为https://dewdfgwd00812:8283/scc/RuntimeLoader.html

之后填写main.swf

完整的地址为:https://dewdfgwd00812:8283/scc/RuntimeLoader.html?url=main.swf&useNetwork=true

9、录制完成以后

10、点击运行

11、



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值