UFT - Getting text from a wpfobject field
I have a read only field which is being recognised as a wpfobject and I'm trying to retrieve the text out of it. When I try .WpfObject("myObject").GetROProperty("text") it returns a blank value. When I try .WpfObject("myObject").GetVisibleText I get the text back however some of the characters are slight different. For example the text is diaplyed as 'NO LONGER REQ" but retruned as 'NO LONGER R5Q'. Another exapmple is the text 'E54670035' is retruned as 'E5467O035' where a zero have been changed to the letter O
Any ideas on how to correct capture the text wlould be very appreciated. I'm trying to use the .WpfObject("myObject").Object methods now however there are 100s of them and I'm not sure where to look
Check with the developers, they will be able to help you out
Thanks for the reply. I did check with the developers here but they were unable to help as the wpf development was done in USA and we are in Australia so I'm unable to leveredge of there knowledge
Tarun, are you suggestion there should be some event I could hook into which would retrieve the text. Also, any idea why GetVisibleText changes the text slightly.
GetVisibleText is a OCR attempt to read the text. And it will never be 100% reliable. There may be some way to dig in and fetch the text. But is not just a piece of cake to find out the same. So you will need to find a way to reach from top level (ur SwfObject), down to the object which is displaying that text
You may not like this, OCR relaibility is questionable and not recommeneded by HP.
Re: Get visibleText
Also take a look on HP Guide on GetVisibleText Method.
Tags for this Thread