Micro Focus QTP (UFT) Forums

Full Version: Non standard HTML attributes.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,

does anyone know if QTP can read/retrive any non-standard HTML attributes?

For example, I have a DIV component, it can have some attributes called " uniquename", "hasChildren" etc.
say if the DIV has an html id as "div 1" ,uniquename as "Accounts" I can locate the DIV by doing calling :
Code:
Browser("title:=InfoView").Page("title:=InfoView").Fram("title:=InfoView").WebElement("html id:=div 1").Click()
When I write:
msgbox Browser("title:=InfoView").Page("title:=InfoView").Fram("title:=InfoView").WebElement("html id:=div 1").GetROProperty("uniquename")

I got an empty string. The same if I am using GetTOProperty("uniquename")

Also using Object Spy, I can not fetch the value for the attrubute even I have modified the object identification to specifically add in the "uniquename" as my mandatory display element attribute.

Many thanks for your insight.

Carol
carol ,
are you sure that the attribute is uniquename
if it is uniqueid then you can use
Code:
msgbox  browser("Browser").Page("Page").WebElement("This is stuff inside the").Object.[color=#0000FF]uniqueid[/color]
i have searched for uniquename property but could not find it.
can you give a reference?
Hi Sreekanth,

Due to the complexity of the webapplication, sometimes developers has to put in some attributs for the needs of implementation.

Here is an example for a DIV:

Code:
<div ismeasure="true" istime="false" numancestors="0" haschildren="true" hierarchy="@Accounts" unselectable="on" class="datatab_node_div" style="-moz-user-select: none; height: 18px; margin-left: 19px;" type="member" expression="/measures/members[@name='Accounts']" uniquename="Accounts" id="designerForm:mde1_Accounts_member_node"> Accounts</div>
here you can see, some no-standard attributes has been added, such as :ismeasure, istime, numancestors, haschildren, type, and uniquename ect. Hence I desperate to know if QTP can find a way to see these attributes. as I have tried something as :
Code:
msgbox Browser("title:=InfoView").Page("title:=InfoView").Fram("title:=InfoView").WebElement("html id:=div 1").GetROProperty("uniquename")
faile to get me the content of the attributes so is Object Spy.

Many thanks for your suggestion

Carol
hey carol,
use object method
for Ex:
Code:
set obj=Browser("Browser").Page("Page").WebElement("Accounts").Object

msgbox obj.ismeasure
Thank you sreekanth. It work perfect for me. Smile