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

QTP UFT flight reservation Cannot identify the object "HPE MyFlight Sample Applicatio"

我正在尝试使用带有战斗示例应用程序的 UFT QTP 来记录场景。 我使用本教程安装了 WPF 插件 https://www.youtube.com/watch?v=fWmfmqzW35w

安装成功。但是在录制之后,我得到了一个没有 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 

感谢您的帮助。

您需要检查 3 项内容。

  1. 确保在启动飞行应用程序之前启动 UFT。 (始终在 AUT 之前启动 UFT)
  2. 加载测试后,转到 "File>Settings>Properties",然后选中 'Associated add-ins' 框。确保 WPF 存在并已选中。如果没有,请单击“修改”按钮和 select WPF。
  3. 前往 "Record>Record And Run Settings..."。对于每个选项卡,select 顶部单选按钮显示 "Record and run test on any open "

完成上述操作后,再次尝试录制。代码应如下所示:

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