[Wtr-general] Referencing dynamically generated objects

Dave Munns forum-watir-users at openqa.org
Tue Jan 2 18:39:58 EST 2007


Happy New Year!
<p>
I have a question that concerns dynamically generated html tags and how to reference them. In a specific frame, a certain operation creates a new object. This object was given a name by my automation tool to make it unique and recognizable by my tool.
<p>
I can reference the object using ...image( :id,'imgTreeNodePlusMinus_8158' ) which is a product generated identifier which is a value that I cannot predict. What I want to use is the identifier that my tool generates, in this case 'A0MGdyn0.78108587205286'.
<p>
The html for the object is:
<p>
Active Element: [SPAN], Frame: [fraNavigation], Index: [150] 
<SPAN> class=DATAZONE-TREE-NODE-TEXT id=spnNodeText_8158 onmouseover=treeItemMouseOver(); style="COLOR: #7d69d6; TEXT-DECORATION: underline" onclick=navToASPPageForNode(); onmouseout=treeItemMouseOut(); udefModuleID="8" udefNodeDesc="A0MGdyn0.78108587205286 for DEV2003DC" udefModuleName="Administration " udefNodeID="158" udefASP="" udefContext="machines" udefNodeTitle="A0MGdyn0.78108587205286" udefHelp="AdminMachMngrMGDynam.htm" udefParentNodeID="7"> A0MGdyn0.78108587205286</SPAN>
<p>
The only unchanging identifier for this object is the value 'A0MGdyn0.78108587205286'.
Is there a way to reference the object using this value?
<p>
I have tried:
     .image( :id, /A0MGdyn0.78108587205286/ ).click
     .image( :id, 'A0MGdyn0.78108587205286' ).click
     .image( :title, 'A0MGdyn0.78108587205286' ).click
as well as .span with the above parameters.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5974&messageID=16727#16727


More information about the Wtr-general mailing list