QTP UFT航班预订无法识别对象“HPE MyFlight Sample Applicatio”

时间:2017-07-16 23:43:11

标签: wpf qtp

我正在尝试使用UFT QTP和战斗样本应用程序记录场景。 我使用本教程https://www.youtube.com/watch?v=fWmfmqzW35w

安装了WPF插件

已成功安装。但是在录制之后,我得到的代码没有wpf对象。

Window("HPE MyFlight Sample Applicatio").Click 203,223
Window("HPE MyFlight Sample Applicatio").Type "john"
Window("HPE MyFlight Sample Applicatio").Click 216,280
Window("HPE MyFlight Sample Applicatio").Type "hp"
Window("HPE MyFlight Sample Applicatio").Click 186,348
Window("HPE MyFlight Sample Applicatio_2").Close

执行代码后,我收到此错误:

Cannot identify the object "HPE MyFlight Sample Applicatio" (of class Window).
Verify that this object's properties match an object currently displayed in your application.


Description 


Cannot identify the object "HPE MyFlight Sample Applicatio" (of class Window).
Verify that this object's properties match an object currently displayed in your application.

Object's physical description:
regexpwndtitle = HPE MyFlight Sample Application
regexpwndclass = HwndWrapper[FlightsGUI.exe;;a3bd17a0-f90c-492a-8183-ec384ab007cb]
is owned window = 0
is child window = 0 

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

您需要检查三件事。

  1. 确保在启动航班应用程序之前启动UFT。 (始终在AUT之前启动UFT)
  2. 加载测试后,转到"文件>设置>属性"然后检查“关联加载项”'框。确保WPF存在并已检查。如果没有,请单击“修改”按钮并选择“WPF”。
  3. 转到"录制>录制并运行设置..."。对于每个显示的选项卡,选择顶部单选按钮,显示"记录并在任何打开的情况下运行测试"
  4. 完成上述操作后,请尝试重新录制。代码应如下所示:

    WpfWindow("HP MyFlight Sample Application").WpfEdit("agentName").Set "john"
    WpfWindow("HP MyFlight Sample Application").WpfEdit("password").SetSecure "597f38ad85b47efe95f1"
    WpfWindow("HP MyFlight Sample Application").WpfButton("OK").Click