Micro Focus QTP (UFT) Forums
difference - 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 Interview Questions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Interview-Questions)
+--- Thread: difference (/Thread-difference)



difference - Arul - 01-18-2012

Hi,
What is the difference between below two steps.

Code:
Browser("Googgle").Page("Google").WebEdit("Search").Set "QTP"

Browser("Googgle").Page("Google").WebEdit("Search").Object.

First line is normally we r using.in second step how we can approach

Regards,
Arul


RE: difference - rajpes - 01-31-2012

second line is to get handle to the web object in the html DOM (in your case it's webeidt).Through this you can get/set any property listed in the "run time object properties" when you spy on the webeidt.

eg:msgbox Browser("Googgle").Page("Google").WebEdit("Search").Object.isContentEditable 'isContentEditable is a property which you can not retrieve through GetRoProperty



RE: difference - basanth27 - 01-31-2012

RajPes -
The above statement holds 90% correct except for the last line. "You can retrieve all of the properties using the GetRoproperty as to what you can do through the DOM as well. For eg: oVal = Browser().Page().Webedit().GetRoproperty("isContentEditable") will return a Value 1 or 0 depending upon the settings".
However, the other ease in using the .object is to aid in clear programming.
Code:
Set oObj = Browser().Page().Webedit().object
msgbox oObj.IsContenteditable