[Webtest] innerHTML undefined

Florian Felgenhauer (DHL CZ) webtest@lists.canoo.com
Wed, 14 Jun 2006 14:59:59 +0200


This is a multi-part message in MIME format.

------_=_NextPart_001_01C68FB2.71464087
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

I am trying to access the innerHTML attribute of some div tag:

=20

<div id=3D"divDutiable"></div>

=20

function displayDutiable(shouldDisplay)

  {

    var divToDisplay =3D document.getElementById("divDutiable");

    if (shouldDisplay)

    {

      divToDisplay.innerHTML =3D txt_divDutiable;

    }

    else

    {

      divToDisplay.innerHTML =3D txt_empty;

    }

  }

=20

<scriptStep language=3D"javascript">                         }
step.setWebtestProperty('doIfStep',document.getHtmlElementById('divDutia
ble').innerHTML);

</scriptStep>

=20

<verifyProperty name=3D"doIfStep" text=3D"gaga"/>

=20

leads to=20

=20

     [java] Test step verifyProperty
(C:\eclipse\workspace\svcpoint\webtests\tests\Non-account-Customer.xml:6
4: )  named "<unknown>" failed with message "Incorrect property value
found! Expected "gaga" but got "undefined""

=20

how can I get the innerHTML attribute

=20


------_=_NextPart_001_01C68FB2.71464087
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:st1=3D"schemas.1und1.de/SoftPhone" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<o:SmartTagType namespaceuri=3D"schemas.1und1.de/SoftPhone" =
name=3D"Rufnummer"
 downloadurl=3D" "/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
@page Section1
	{size:595.3pt 841.9pt;
	margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext=3D"edit">
  <o:idmap v:ext=3D"edit" data=3D"1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DCS =
style=3D'font-size:10.0pt;
font-family:Arial'>I am trying to access the innerHTML attribute of some =
div
tag:<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DCS =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier New"'>&lt;div
id=3D&quot;divDutiable&quot;&gt;&lt;/div&gt;</span></font><font size=3D2
face=3D"Courier New"><span =
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier New"'>function
displayDutiable(shouldDisplay)<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier New"'>&nbsp; =
{<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp; =
var
divToDisplay =3D =
document.getElementById(&quot;divDutiable&quot;);<o:p></o:p></span></font=
></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp; =
if
(shouldDisplay)<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp; =
{<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
divToDisplay.innerHTML =3D txt_divDutiable;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp; =
}<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp; =
else<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp; =
{<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
divToDisplay.innerHTML =3D txt_empty;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp; =
}<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier New"'>&nbsp; =
}<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier New"'>&lt;scriptStep
language=3D&quot;javascript&quot;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
step.setWebtestProperty('doIfStep',document.getHtmlElementById('divDutiab=
le').innerHTML);<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>&lt;/scriptStep&gt;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier New"'>&lt;verifyProperty
name=3D&quot;doIfStep&quot; =
text=3D&quot;gaga&quot;/&gt;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier New"'>leads to =
<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>&nbsp;&nbsp;&nbsp;&nbsp; [<u>java</u>]
Test step verifyProperty =
(C:\eclipse\workspace\svcpoint\webtests\tests\Non-account-Customer.xml:<s=
t1:Rufnummer
w:st=3D"on">64</st1:Rufnummer>: )&nbsp; named =
&quot;&lt;unknown&gt;&quot; failed
with message &quot;Incorrect property value found! Expected =
&quot;gaga&quot;
but got &quot;undefined&quot;&quot;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span lang=3DCS
style=3D'font-size:10.0pt;font-family:"Courier New"'>how can I get the =
innerHTML
attribute</span></font><font size=3D2 face=3DArial><span lang=3DCS =
style=3D'font-size:
10.0pt;font-family:Arial'><o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DCS =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>

------_=_NextPart_001_01C68FB2.71464087--