[Webtest] Xpath Not Finding Applet Tag

Rich Toulouse Rich Toulouse" <Rich.Toulouse@Attachmate.com
Tue, 22 May 2007 13:12:57 -0700


This is a multi-part message in MIME format.

------_=_NextPart_001_01C79CAD.9714FB00
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi there,
=20
I'm having a bit of a problem trying to get webtest to find the applet
in the page.  I've tried the following:
/html/body/div/applet[@name=3D'Launcher']
/html/body/div[@id=3D'appletdiv']/applet[@name=3D"'Launcher']
//div[@id=3D'appletdiv']/applet[@name=3D'Launcher"]
//div[@id=3D'appletdiv']/applet[1]
=20
None of those work.  I keep getting an error like this:
=20
Running with: Canoo Webtest: R_1562.
Exception thrown from this class:
com.canoo.webtest.engine.StepFailedException
Message was: The specified element <//div[@id=3D'appletdiv']/applet[1]>
was not found.
Running with: Canoo Webtest: R_1562.
=20
Does anyone see what I might be doing wrong?
=20
Thanks!
=20
Rich
=20
Here's the HTML.
=20

<html>
<head>
<meta HTTP-EQUIV=3D"Cache-Control" CONTENT=3D"no-cache">
<meta HTTP-EQUIV=3D"Pragma" CONTENT=3D"no-cache">
<meta HTTP-EQUIV=3D"Expires" CONTENT=3D"0">
<script language=3D"JavaScript" type=3D"text/javascript">
</script>
<script language=3D"JavaScript" type=3D"text/javascript"
src=3D"/rweb/gm/writeapplets.js"></script>
=20
<title>Reflection</title>
<style type=3D"text/css">
</style>
</head>
<body onload=3D"testForJava();">
=20
<IMG src=3D"./RWeb_M.gif" alt=3D"Reflection"><BR>
<div id=3D"appletdiv">
=20

<applet name=3D"tester" code=3D"com.wrq.util.browser.JavaTest" =
codebase=3D""
height=3D0 width=3D0 archive=3D"JavaTestApplet.jar">
</applet>
<applet MAYSCRIPT name=3D"Launcher" code=3D"Launcher.class" archive=3D""
        codebase=3D""
        width=3D"500"
        height=3D"440">
    <param name=3D"cabbase" value=3D"Launcher.cab">
 <param name=3D"launcher.id" value=3D"1">
 <param name=3D"ServletURL" value=3D">
 <param name=3D"jsessionid" value=3D"">
 <param name=3D"launcher.sessionurl" value=3D"">
   <param name=3D"smartcardDllNames" value=3D"">
   <param name=3D"cache_archive" value=3D"">
=20
=20
=20
   <param name=3D"cache_version" value=3D"9.6.10.016">
</applet>
=20
</div>
<div id=3D"msg">
=20
</div>
</body>
</html>


------_=_NextPart_001_01C79CAD.9714FB00
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.6000.16441" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D580090220-22052007><FONT face=3DArial size=3D2>Hi=20
there,</FONT></SPAN></DIV>
<DIV><SPAN class=3D580090220-22052007><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D580090220-22052007><FONT face=3DArial size=3D2>I'm =
having a bit of=20
a problem trying to get webtest to find the applet in the page.&nbsp; =
I've tried=20
the following:</FONT></SPAN></DIV>
<DIV><SPAN class=3D580090220-22052007><FONT face=3DArial=20
size=3D2>/html/body/div/applet[@name=3D'Launcher']</FONT></SPAN></DIV>
<DIV><SPAN class=3D580090220-22052007><FONT face=3DArial=20
size=3D2>/html/body/div[@id=3D'appletdiv']/applet[@name=3D"'Launcher']</F=
ONT></SPAN></DIV>
<DIV><SPAN class=3D580090220-22052007><FONT face=3DArial=20
size=3D2>//div[@id=3D'appletdiv']/applet[@name=3D'Launcher"]</FONT></SPAN=
></DIV>
<DIV><SPAN class=3D580090220-22052007><FONT face=3DArial=20
size=3D2>//div[@id=3D'appletdiv']/applet[1]</FONT></SPAN></DIV>
<DIV><SPAN class=3D580090220-22052007><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D580090220-22052007><FONT face=3DArial size=3D2>None =
of those=20
work.&nbsp; I keep getting an error like this:</FONT></SPAN></DIV>
<DIV><SPAN class=3D580090220-22052007><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D580090220-22052007><FONT face=3DArial =
size=3D2>Running with: Canoo=20
Webtest: R_1562.<BR>Exception thrown from this class:=20
com.canoo.webtest.engine.StepFailedException<BR>Message was: The =
specified=20
element &lt;//div[@id=3D'appletdiv']/applet[1]&gt; was not =
found.<BR>Running with:=20
Canoo Webtest: R_1562.</FONT></SPAN></DIV>
<DIV><SPAN class=3D580090220-22052007><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D580090220-22052007><FONT face=3DArial size=3D2>Does =
anyone see what=20
I might be doing wrong?</FONT></SPAN></DIV>
<DIV><SPAN class=3D580090220-22052007><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D580090220-22052007><FONT face=3DArial=20
size=3D2>Thanks!</FONT></SPAN></DIV>
<DIV><SPAN class=3D580090220-22052007><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D580090220-22052007><FONT face=3DArial=20
size=3D2>Rich</FONT></SPAN></DIV>
<DIV><SPAN class=3D580090220-22052007><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D580090220-22052007><FONT face=3DArial size=3D2>Here's =
the=20
HTML.</FONT></SPAN></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV><SPAN =
class=3D580090220-22052007>
<DIV><BR><FONT face=3DArial =
size=3D2>&lt;html&gt;<BR>&lt;head&gt;<BR>&lt;meta=20
HTTP-EQUIV=3D"Cache-Control" CONTENT=3D"no-cache"&gt;<BR>&lt;meta=20
HTTP-EQUIV=3D"Pragma" CONTENT=3D"no-cache"&gt;<BR>&lt;meta =
HTTP-EQUIV=3D"Expires"=20
CONTENT=3D"0"&gt;<BR>&lt;script language=3D"JavaScript"=20
type=3D"text/javascript"&gt;<BR>&lt;/script&gt;<BR>&lt;script=20
language=3D"JavaScript" type=3D"text/javascript"=20
src=3D"/rweb/gm/writeapplets.js"&gt;&lt;/script&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>&lt;title&gt;Reflection&lt;/title&gt;<BR>&lt;style=20
type=3D"text/css"&gt;<BR>&lt;/style&gt;<BR>&lt;/head&gt;<BR>&lt;body=20
onload=3D"testForJava();"&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;IMG src=3D"./RWeb_M.gif"=20
alt=3D"Reflection"&gt;&lt;BR&gt;<BR>&lt;div =
id=3D"appletdiv"&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><BR><FONT face=3DArial size=3D2>&lt;applet name=3D"tester"=20
code=3D"com.wrq.util.browser.JavaTest" codebase=3D"" height=3D0 =
width=3D0=20
archive=3D"JavaTestApplet.jar"&gt;<BR>&lt;/applet&gt;<BR>&lt;applet =
MAYSCRIPT=20
name=3D"Launcher" code=3D"Launcher.class"=20
archive=3D""<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
codebase=3D""<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
width=3D"500"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
height=3D"440"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;param name=3D"cabbase"=20
value=3D"Launcher.cab"&gt;<BR>&nbsp;&lt;param name=3D"launcher.id"=20
value=3D"1"&gt;<BR>&nbsp;&lt;param name=3D"ServletURL"=20
value=3D"&gt;<BR>&nbsp;&lt;param name=3D"jsessionid" value=3D<SPAN=20
class=3D580090220-22052007>"</SPAN>"&gt;<BR>&nbsp;&lt;param=20
name=3D"launcher.sessionurl" value=3D""&gt;<BR>&nbsp;&nbsp; &lt;param=20
name=3D"smartcardDllNames" value=3D""&gt;<BR>&nbsp;&nbsp; &lt;param=20
name=3D"cache_archive" value=3D"</FONT><FONT face=3DArial =
size=3D2>"&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; &lt;param =
name=3D"cache_version"=20
value=3D"9.6.10.016"&gt;<BR>&lt;/applet&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;/div&gt;<BR>&lt;div=20
id=3D"msg"&gt;<BR>&nbsp;<BR>&lt;/div&gt;<BR>&lt;/body&gt;<BR>&lt;/html&gt=
;<BR></FONT></SPAN></DIV></BODY></HTML>

------_=_NextPart_001_01C79CAD.9714FB00--