0

为什么 RFT 无法识别我在 Windows 打印对话框中拥有的对象。包括几个屏幕截图。

我能够通过

测试对象 [] 到 ; IWindow activeWindow = RationalTestScript.getScreen().getActiveWindow(); System.out.println("活动窗口的类是 "+activeWindow.getCLass()): // 返回 #32770

ScreenTestObject root = RootTestObject.getScreenTestObject();

to = root.find(atLIst(atDescendant(".class", false),atChild(".class", ".Pushbutton", ".text", "Print"))) ;

显然我不能发图片。这是打印窗口和打印按钮属性屏幕截图的链接 http://www.flickr.com/photos/24358027@N07/12977082214/in/set-72157641973533994 ...分辨率太可怕了,如果有人,我可以输入所有信息需要它。抱歉,提前致谢。

4

2 回答 2

0

更新:我为此做了一个解决方法,使用选项卡进行导航。一旦 Tab 位于按钮上,我输入 Enter。所以这不再是停工问题,但我确实需要找出正确的方法来做这件事。谢谢

于 2014-03-07T20:08:07.073 回答
0

试试下面的代码片段。我尝试从记事本启动打印对话框并在脚本下方运行以找到打印按钮并单击它。希望它有所帮助。

//Find the Print button
TestObject[] to = find(atDescendant(".class",".Pushbutton",".text","Print"),true);
System.out.println(to.length);
//If you are sure you have just one print button on screen. 
if(to.length==1)
    ((GuiTestObject) to[0]).click();
//Else traverse through the found object and compare the properties of the button you want to click
于 2014-03-07T10:16:18.300 回答