[Webtest] innerHTML undefined

Florian Felgenhauer (DHL CZ) webtest@lists.canoo.com
Mon, 19 Jun 2006 14:39:16 +0200


Actually I am doing something like:

var txt_divDutiable =3D '';

txt_divDutiable +=3D 'dutiable';


that was the reason I got an error with text " evaluates to: , expected
value is: gaga"

but now

<verifyXPath xpath=3D"//*[@id =3D 'divDutiable']/text()" =
text=3D".*dutiable*."
regex=3D"true"/>

does not work also.

Cheers

Florian

-----Original Message-----
From: Florian Felgenhauer (DHL CZ)=20
Sent: Wednesday, June 14, 2006 5:48 PM
To: 'webtest@gate2.canoo.com'
Subject: RE: [Webtest] innerHTML undefined

Hi Marc,

I tried it with the "verifyXPath step.

The javascript function is called in two different ways:

1. With a script at the end of the page

   <div id=3D"divNotDutiable" class=3D"inputrow">gaga</div>
<script type=3D"text/javascript">
var txt_divNotDutiable =3D 'not dutiable';
</script>

   <div id=3D"divDutiable"></div>
<script type=3D"text/javascript">
var txt_divDutiable =3D 'dutiable';
  <c:choose>
  <c:when test=3D"${doCash.dutiable}">
    displayDutiable(true);
    displayNonDutiable(false);
  </c:when>
  <c:otherwise>
    displayDutiable(false);
    displayNonDutiable(true);
  </c:otherwise>
  </c:choose>
</script>

2. By some ajax request

But both does not change the text of the div, because the "verifyXPath"
step evaluates an empty string.

Am I still working on the DOM that was returned by the server. What do I
have to do to work on the changed DOM?

Cheers

Florian

-----Original Message-----
From: webtest-admin@gate2.canoo.com
[mailto:webtest-admin@gate2.canoo.com] On Behalf Of Marc Guillemot
Sent: Wednesday, June 14, 2006 3:58 PM
To: webtest@gate2.canoo.com
Subject: Re: [Webtest] innerHTML undefined


Hi Florian,

your scriptStep works on htmlunit's DOM. innerHTML is not a property of
a
DOM node but of an associated host host object. It is possible to access
the
associated host object (have a look at htmlunit's API) and therefore to
call
the jsx_GetInnerHTML() method, but I'm not sure that it makes really
sense.

In your case I would rather write a test like:
<verifyXPath xpath=3D""//*[@id =3D 'divDutiable']/text()" =
text=3D"gaga"/>

Marc.
--
View this message in context:
http://www.nabble.com/innerHTML-undefined-t1786010.html#a4865333
Sent from the WebTest forum at Nabble.com.

_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest