I have a long running QTP test which does a bunch of UI actions on my WPF application. I started off creating the script by explicitly invoking the WPF objects. Like so:
WpfWindow("").WpfButton.Click
WpfWindow("").WpfList.Select 1
I wanted to know if I should change this to
Set myWindow = WpfWindow("")
myWindow.WpfButton.Click
myWindow.WpfList.Select 1
Set myWindow = NOTHING
Does version (1) prevent GC because Qtp may be holding references to the objects? Does version (2) avoid that problem?
Update: The same long running script seems to release memory or handle memory references better in UFT 11.53. I was using Qtp11 before.