Micro Focus QTP (UFT) Forums
How to get the Webelement object name. - 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: How to get the Webelement object name. (/Thread-How-to-get-the-Webelement-object-name)



How to get the Webelement object name. - Shilpa Gorantla - 07-29-2016

Hi All,

I am new to UFT and very much new to web browser automation.

So , I want to store the webelement name in a variable. 
(Need: I need to get the UTC time increment value from google. Im googling with "BKK time". And there will be a value like this - "GTM+7". And I need that "7 " value. I am trying to store this value in a variable.)


 Im trying the this:
================

Code:
SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe", "https://www.google.com"


Browser("Google Search").Page("Google Search").WebEdit("Search").Set "BKK time"
Browser("Google Search").Page("Google Search").WebEdit("Search").Submit
Browser("Google Search").Page("Google Search").WebElement("(GMT+.*)").highlight

 val = Browser("Google Search").Page("Google Search").WebElement("(GMT+.*)").{****}


print val


====================
What can I replace {****} with to get the required information.

Please help me .


Thanks,
Shilpa G


RE: How to get the Webelement object name. - Shilpa Gorantla - 07-29-2016

Its ok. I am able to get the webelement name Smile  GetROProperty("innertext") will do the work
Ans:

Code:
val = Browser("Google Search").Page("Google Search").WebElement("(GMT+.*)").GetROProperty("innertext")