51Testing软件测试论坛

标题: 求助:无法识别测试对象 [打印本页]

作者: honglink    时间: 2008-10-27 16:21
标题: 求助:无法识别测试对象
用Function Tester测试java的应用,该应用的界面控件是用java的SWT,当使用验证点时,Tester无法识别控件,请问用什么方法才能使Tester能够识别,谢谢
作者: 刀客    时间: 2008-11-3 13:01
请问:你有没有enable被测的swt application?

再试试:
To enable an SWT application for testing, the following code should be called from the UI thread of the application. Typically this is the code that first creates the application Shell. We currently do NOT support testing multiple Displays within a single application. Should someone have a need for testing multiple Displays please ask for such support from the product management team.

Here is the code:

try
{
// Self-enable this application. The object passed to
// enableSwtUi must be an object or class whose classLoader
// has access to the SWT classes.
// enableSwtUi() must be called from the SWT UI Thread.
// If the JRE in which the application is running is enabled
// by IBM Rational Functional Tester it will then be testable.
// If the JRE is not enabled, a ClassNotFoundException will
// be caught here and the application will load as usual but
// it will not be testable.
com.rational.test.ft.bootstrap.Bootstrap.enableSwtUi(this);
}
catch (Throwable e) {}
作者: honglink    时间: 2008-11-5 09:13
多谢,我在网上找了这篇文章,解决了我的问题,供大家参考http://www.ibm.com/developerwork ... cn-rftaopswt/#list2




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2