Micro Focus QTP (UFT) Forums
swfwindow object name getting changed after each run - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: swfwindow object name getting changed after each run (/Thread-swfwindow-object-name-getting-changed-after-each-run)



swfwindow object name getting changed after each run - saniya - 08-07-2018

Hello,

I have a windows based application that looks like attached(SWFWindow.jpg).

Everytime i spy objects inside this window using object spy and try to add objects to my repository it gives a new name to the parent window
for example if i try to add a combo box on this page to the repository, for the first time it gets saved in the repository as :
 SwfWindow("Volvo Product Simulator").SwfComboBox("comboBox1")
but when i run this script, it complains that object cannot be found. On spying it again, it shows it as

 SwfWindow("Volvo Product Simulator_2").SwfComboBox("comboBox1")
on the third time as 
 SwfWindow("Volvo Product Simulator_3").SwfComboBox("comboBox1")

and so on ........

Please help why is this happening ?


RE: swfwindow object name getting changed after each run - TheGlovner - 10-10-2018

Sounds like multiple instances of the object being created so it's incrementing the name in order to be able to tell the difference.

I'm guessing that your script isn't killing off the object fully, so when it goes to launch in a subsequent run then it increments the name and your static naming doesn't recognise it following the launch.

Although I stress I'm new to all this so you may want to wait for someone else to confirm if my thinking is correct.