Micro Focus QTP (UFT) Forums
Problem in identifying the object - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Problem in identifying the object (/Thread-Problem-in-identifying-the-object)



Problem in identifying the object - Paras Singh - 04-20-2013

Hi,

I am trying to identify the gmail objects with the following code in dp:

Code:
y = Browser("title:=Gmail").GetROProperty("name")
msgbox y
Above code is executing correctly and displaying the output.
But the below code on the same page is throwing the error,attached the screenshot of the error.
x = Browser("name:=Inbox (2,397) - paras.sidhu@gmail.com - Gmail#inbox").GetROProperty("name")
msgbox x

Please help.

Thanks,
Paras


RE: Problem in identifying the object - ravi.gajul - 04-21-2013

Hi Paras,
it fails because "(", ")" , "." has got special meaning..hence it is handled through escape sequence "\" to consider their literal meaning.however this fails when the number changes.To handle that use regular expression.
Code:
x = Browser("name:=Inbox \(2,397\) - paras\.sidhu@gmail\.com - Gmail#inbox").GetROProperty("name")
msgbox x
or
Code:
msgbox Browser("CreationTime:=0").GetROProperty("name")



RE: Problem in identifying the object - Paras Singh - 04-21-2013

Thanks Ravi... Its working fine.

Another small issue, while I am executing any of the script, when i click on the 'OK' button on the Run Dialog box, it is displaying some error message, attached the screenshot.

However, on clicking on the 'OK' button, code is getting executed properly. But not sure why that error is coming. Also, in include folder , there is no inc directory present.


RE: Problem in identifying the object - ravi.gajul - 04-22-2013

Never encountered this error before.Not sure what's in that folder.