Wpf 为什么存储对话框的变量不关闭UFT中的应用程序?

Wpf 为什么存储对话框的变量不关闭UFT中的应用程序?,wpf,vbscript,hp-uft,uft14,Wpf,Vbscript,Hp Uft,Uft14,我使用UFT录制功能录制了示例航班应用程序,令人惊讶的是,下面提到的代码除了关闭应用程序外,还完成了所有操作,即x.close不会关闭应用程序 在关闭wpfWindow之前,再次设置对象引用,如下所示 单击OK按钮后,窗口已“刷新”(我应该说?),并且您仍在使用对该窗口的现有引用 Set x = WpfWindow("HPE MyFlight Sample Applicatio") x.WpfEdit("agentName").Set "John" x.WpfEdit("password").

我使用UFT录制功能录制了示例航班应用程序,令人惊讶的是,下面提到的代码除了关闭应用程序外,还完成了所有操作,即x.close不会关闭应用程序



在关闭wpfWindow之前,再次设置对象引用,如下所示

单击OK按钮后,窗口已“刷新”(我应该说?),并且您仍在使用对该窗口的现有引用

Set x = WpfWindow("HPE MyFlight Sample Applicatio")
x.WpfEdit("agentName").Set "John"
x.WpfEdit("password").SetSecure "59533cbffdbec3d9d0ff"
x.WpfButton("OK").Click
Set x = WpfWindow("HPE MyFlight Sample Applicatio")    'Added this line just after clicking on OK button but before closing the wpfWindow
x.Close

在关闭wpfWindow之前,再次设置对象引用,如下所示

单击OK按钮后,窗口已“刷新”(我应该说?),并且您仍在使用对该窗口的现有引用

Set x = WpfWindow("HPE MyFlight Sample Applicatio")
x.WpfEdit("agentName").Set "John"
x.WpfEdit("password").SetSecure "59533cbffdbec3d9d0ff"
x.WpfButton("OK").Click
Set x = WpfWindow("HPE MyFlight Sample Applicatio")    'Added this line just after clicking on OK button but before closing the wpfWindow
x.Close

您得到的错误是什么。这通常发生在登录后窗口的属性发生更改时。应用程序是否导航到正确的页面?比较登录页面和登录后的属性。嗨,Mithilesh,我没有收到任何错误。它只是没有关闭应用程序。如果我用
WpfWindow(“HPE MyFlight示例应用程序”)替换x。在上一条语句中关闭
,它会工作,您得到的错误是什么。这通常发生在登录后窗口的属性发生更改时。应用程序是否导航到正确的页面?比较登录页面和登录后的属性。嗨,Mithilesh,我没有收到任何错误。它只是没有关闭应用程序。如果我用
WpfWindow(“HPE MyFlight示例应用程序”)替换x。在上一条语句中关闭
,它会工作