Non standard HTML attributes. - 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: Non standard HTML attributes. (/Thread-Non-standard-HTML-attributes) |
Non standard HTML attributes. - Carol - 03-15-2008 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() 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 RE: Non standard HTML attributes. - sreekanth - 03-15-2008 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] can you give a reference? RE: Non standard HTML attributes. - Carol - 03-18-2008 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> Code: msgbox Browser("title:=InfoView").Page("title:=InfoView").Fram("title:=InfoView").WebElement("html id:=div 1").GetROProperty("uniquename") Many thanks for your suggestion Carol RE: Non standard HTML attributes. - sreekanth - 03-18-2008 hey carol, use object method for Ex: Code: set obj=Browser("Browser").Page("Page").WebElement("Accounts").Object RE: Non standard HTML attributes. - Carol - 03-19-2008 Thank you sreekanth. It work perfect for me. |