简体   繁体   中英

Why does the variable which stores dialog box not closing application in UFT?

I recorded the sample flight application with UFT recording feature and surprisingly, the below mentioned code does everything apart from closing the application, that is x.close does not close the application.


Set x = WpfWindow("HPE MyFlight Sample Applicatio")
x.WpfEdit("agentName").Set "John"
x.WpfEdit("password").SetSecure "59533cbffdbec3d9d0ff"
x.WpfButton("OK").Click
x.Close

Before Closing the wpfWindow, set the object reference again as shown below.

After OK button is clicked, the window has "refreshed"(should I say?) and you are still using the existing reference to that window.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM