Micro Focus QTP (UFT) Forums
QTP Can't recognize the WinObject second time - 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 Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: QTP Can't recognize the WinObject second time (/Thread-QTP-Can-t-recognize-the-WinObject-second-time)



QTP Can't recognize the WinObject second time - Ajit.2k6 - 04-13-2010

Hi All,

When i run my script after recording or deug, QTP do not recognize the object. Following is the codeSadin BOLD)

Window("SiPass integrated -- AUSYDW221").Dialog("Cardholder").WinButton("Add Card").Click

a = Window("SiPass integrated -- AUSYDW221").Dialog("Cardholder").ActiveX("CardsView").WinObject("WindowsForms10.EDIT.app.0.225e691").GetROProperty ("text")

Please help,

Thanks,

Ajit


RE: QTP Can't recognize the WinObject second time - manishbhalshankar - 04-13-2010

Check if you get the same object properties for WinObject everytime it is opened. If not use regular expression.


RE: QTP Can't recognize the WinObject second time - Ajit.2k6 - 04-13-2010

Hi Again,

What i found is, the WinObject is not being focused on by QTP. When i click on this winobject script continues.

Now how can i make QTP focused on this object?

Thanks,

Ajit


RE: QTP Can't recognize the WinObject second time - Tarik Sheth - 04-14-2010

Hi Try following code.

Setfocus method should be useful for getting the RO text property.

Code:
Window("SiPass integrated -- AUSYDW221").Dialog"Cardholder").WinButton("Add Card").Click


Window("SiPass integrated -- AUSYDW221").Dialog("Cardholder").ActiveX("CardsView").WinObject("WindowsForms10.EDIT.app.0.225e691").setfocus

a = Window("SiPass integrated -- AUSYDW221").Dialog("Cardholder").ActiveX("CardsView").WinObject("WindowsForms10.EDIT.app.0.225e691").GetROProperty ("text")



RE: QTP Can't recognize the WinObject second time - Ajit.2k6 - 04-20-2010

Sorry, didn't work. saying object not in repository. the only way it works is when u manually click on the WinObject

Please help.
Ajit


RE: QTP Can't recognize the WinObject second time - manishbhalshankar - 04-20-2010

Try:
Code:
Window("SiPass integrated -- AUSYDW221").Dialog("Cardholder").ActiveX("CardsView").WinObject("WindowsForms10.EDIT.app.0.225e691").Activate

a = Window("SiPass integrated -- AUSYDW221").Dialog("Cardholder").ActiveX("CardsView").WinObject("WindowsForms10.EDIT.app.0.225e691").GetROProperty ("text")



RE: QTP Can't recognize the WinObject second time - Tarik Sheth - 04-21-2010

Hi,
Could you try using descriptive programming and adding several more properties of the object.
Also you can use ".Activate " to activate win object and then try to identify the object using more properties.