|
我刚接触RFT,目前使用RFT v6.1,由于测试对象经常变化,采用动态的对象识别(使用find方法)。尝试将一些常用的操作放在helper类中,但是总是找不到对象(在测试脚本中正常)。我对此进行了实验,发现无论是直接在普通java类(继承Object)中,还是在自己建立的继承RationalTestScript的类中,都无法正常使用find方法,这两种类都是在RFT的java视图下建立的。现在只有在RFT功能测试视图下使用新建->空测试脚本,才能正常调用find方法。请问这是什么原因?
下面是测试代码和错误输出:
import com.rational.test.ft.object.interfaces.TestObject;
import com.rational.test.ft.script.RationalTestScript;
public class Test {
public static void main(String[] args) {
TestObject[] to = RationalTestScript.find(RationalTestScript.atChild("class", "org.eclipse.swt.widgets.Shell"));
System.out.print(to.length);
}
}
============================================================
Exception in thread "main" java.lang.UnsatisfiedLinkError: getIvoryInstallNative
at com.rational.test.ft.bootstrap.Bootstrap.getIvoryInstall(Unknown Source)
at com.rational.test.ft.services.FtInstallOptions.getInstallDir(Unknown Source)
at com.rational.test.ft.sys.LoadNative.load(Unknown Source)
at com.rational.test.ft.sys.LoadNative.load(Unknown Source)
at com.rational.test.ft.sys.OperatingSystem.<clinit>(Unknown Source)
at com.rational.test.ft.application.ScriptPlayback.<clinit>(Unknown Source)
at com.rational.test.ft.application.rational_ft_impl.getPlaybackMonitor(Unknown Source)
at com.rational.test.ft.object.interfaces.RootTestObject.find(Unknown Source)
at com.rational.test.ft.script.RationalTestScript.find(Unknown Source)
at com.rational.test.ft.script.RationalTestScript.find(Unknown Source)
at Test.main(Test.java:6) |
|