Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Non standard HTML attributes.
#1
Solved: 11 Years, 4 Months ago
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
Reply
#2
Solved: 11 Years, 4 Months ago
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?
Reply
#3
Solved: 11 Years, 4 Months ago
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
Reply
#4
Solved: 11 Years, 4 Months ago
hey carol,
use object method
for Ex:
Code:
set obj=Browser("Browser").Page("Page").WebElement("Accounts").Object

msgbox obj.ismeasure
Reply
#5
Solved: 11 Years, 4 Months ago Smile 
Thank you sreekanth. It work perfect for me. Smile
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can we test Salesforce Standard form using QTP? yona34 0 1,072 05-22-2018, 10:57 AM
Last Post: yona34
  Customized HTML reports in QTP azeem 11 49,432 12-31-2016, 02:57 PM
Last Post: chevronneraji
  [UFT] Get text into DIV through HTML tag robertosalemi 2 5,517 03-29-2016, 09:43 PM
Last Post: robertosalemi
  How to attach HTML file to Email Naresh 0 3,062 04-06-2015, 02:04 PM
Last Post: Naresh
  User defined Objects(Can't map standard grid object in to table object ) madhavanr 0 2,594 01-14-2014, 03:46 PM
Last Post: madhavanr

Forum Jump:


Users browsing this thread: 1 Guest(s)