[Webtest] Javascript support ready!
Healey, Thomas
webtest@lists.canoo.com
Mon, 17 Mar 2003 12:20:23 -0500
Remove Previous post as the HTML confused everything.
Mittie,
Thanks for the help. I did remove the js.jar from the path and all is
well. Below is the HTML code that caused the "error". I hope this
helps. I don't need to test this piece of JS code, but I believe in
other parts of our app I will need to test JS. That is weeks away.
<!--
************************************************************************
***********************
<html lang=3D"en">
<head>
<LINK REL=3DStyleSheet =
HREF=3D"http://128.143.135.41/alum/style.css"
TYPE=3D"text/css" MEDIA=3Dscreen>
<LINK REL=3DStyleSheet
HREF=3D"http://128.143.135.41/alum/style2.css" TYPE=3D"text/css"
MEDIA=3Dscreen>
<META http-equiv=3D"Content-Type" content=3D"text/html;
charset=3DISO-8859-1">
<title>
Alumni System
</title>
=20
<script language=3D"JavaScript">
function popup() {
var allcookies =3D document.cookie;
var pos =3D allcookies.indexOf("poppedup");
if (pos =3D=3D -1) {
var nextyear =3D new Date();
nextyear.setFullYear(nextyear.getFullYear() + 1);
document.cookie =3D "poppedup=3Dyes; expires=3D" +
nextyear.toGMTString();
=20
window.open("http://www.darden.edu","popup",'scrollbars=3Dyes,resizable=3D=
ye
s,width=3D250,height=3D400');
}
}
</script>
=20
</head>
<body bgcolor=3D"#FFFFFF" text=3D"#000000" leftmargin=3D"0" =
topmargin=3D"0"
marginwidth=3D"0" marginheight=3D"0" onload=3D"javascript:popup();">
<!-- BEGIN EXTERNAL TABLE THAT IS CENTERED ON PAGE -->
************************************************************************
*************************************
Tom
P.S. In previous posts I asked for the location of 2 missing xml files
that are needed to successfully run the junit tests. Can you send them
to me? Also, I posted a question about setting the init value in a
repeat to something user defined so that I can traverse an XML doc using
Xpath in a loop. I.e. <repeat init=3D"1" stepid=3D"Create N events"
count=3D"10">
<storexpath=20
stepid=3D"Extract the data for the begin date"
xpath=3D"/testvalues/dataset[#{count}]/BeginDate"
property=3D"bdate"=20
/>
<setinputfield=20
stepId=3D"Filling in field Begins"=20
name=3D"begins"
value=3D"#{bdate}"
/>
</repeat>
Well, I modified the code(repeatstep.java,repeatWrapper.java) and
webtest.dtd to allow for the init value in the repeat section. This
allows the dynamic property "count"(or whatever the counter name is) to
be set to that value so that the repeat loop starts at the value
specified in "init" instead of 0. This way I can read, in my case, the
1st element in the /testvalues/dataset tree. If the "init" value is not
specified the default is zero so it will default to the way it works
now. I also fixed what "I" think is a bug in the StoreXPath.getXPath
(StoreXpath.java) that doesn't expand the dynamic properties before
calling document.selectSingleNode( fXPath ) so that the dynamic
property "count" is expanded and the correct element in the document is
retrieved.(Dynamic properties are expanded in the VerifyXPath code) So
back to my original question, I would like to run the unit tests without
error which I can't without the files to ensure that I didn't break
anything. I will also modify the junit tests to test out the new code. I
also would like to submit the changes for review and inclusion in the
build if the committers see value in the changes. I am wondering who I
can contact to do this?
-->
-----Original Message-----
From: webtest-admin@lists.canoo.com
[mailto:webtest-admin@lists.canoo.com] On Behalf Of Healey, Thomas
Sent: Friday, March 14, 2003 4:46 PM
To: webtest@lists.canoo.com
Subject: RE: [Webtest] Javascript support ready!
Thank you for the upgrade. Do I need to do anything special to my
scripts to make JS work. My problems is that I have an onload popup on
the start page of the app. And I am getting the following error: Event
'javascript:popup();' failed: ConversionError: The undefined value has
no properties. (httpunit; line 2) Stacktrace
com.meterware.httpunit.ScriptException: Event 'javascript:popup();'
failed: ConversionError: The undefined value has no properties.
(httpunit; line 2)
at
com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.handleScri
ptException(JavaScript.java:176)
at
com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.performEve
nt(JavaScript.java:151)
at
com.meterware.httpunit.scripting.ScriptableDelegate.doEvent(ScriptableDe
legate.java:46)
at
com.meterware.httpunit.WebResponse$Scriptable.load(WebResponse.java:576)
at
com.meterware.httpunit.javascript.JavaScript$Window.initialize(JavaScrip
t.java:364)
at
com.meterware.httpunit.javascript.JavaScript.run(JavaScript.java:79)
at
com.meterware.httpunit.javascript.JavaScriptEngineFactory.associate(Java
ScriptEngineFactory.java:46)
at
com.meterware.httpunit.FrameHolder.updateFrames(FrameHolder.java:82)
at
com.meterware.httpunit.WebWindow.updateFrameContents(WebWindow.java:184)
at
com.meterware.httpunit.WebClient.updateFrameContents(WebClient.java:472)
at
com.meterware.httpunit.WebWindow.updateWindow(WebWindow.java:167)
at
com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:111)
at
com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:91)
at
com.meterware.httpunit.WebClient.getResponse(WebClient.java:87)
at
com.canoo.webtest.steps.request.Target.getResponse(Target.java:257)
at
com.canoo.webtest.steps.request.Target.gotoTarget(Target.java:216)
at
com.canoo.webtest.steps.request.Target.gotoTarget(Target.java:183)
at
com.canoo.webtest.steps.request.InvokePage.doExecute(InvokePage.java:41)
at com.canoo.webtest.steps.Step.execute(Step.java:56)
at com.canoo.webtest.engine.Engine.executeSteps(Engine.java:32)
at
com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificationTas
k.java:55)
at org.apache.tools.ant.Task.perform(Task.java:317)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:334)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at
org.apache.tools.ant.Project.executeTargets(Project.java:1250)
at org.apache.tools.ant.Main.runBuild(Main.java:610)
at org.apache.tools.ant.Main.start(Main.java:196)
at org.apache.tools.ant.Main.main(Main.java:235)
TIA,
Tom Healey
-----Original Message-----
From: webtest-admin@lists.canoo.com
[mailto:webtest-admin@lists.canoo.com] On Behalf Of Dierk Koenig
Sent: Thursday, March 13, 2003 2:01 PM
To: webtest@lists.canoo.com
Cc: Andreas Henle; Marcel Ruedi; Hans Wegener; Gerd Hillebrand; Alexio
Moreno
Subject: [Webtest] Javascript support ready!
Hiall,
I'm happy to announce the first Version of CanooWebTest that also
supports JavaScript. This concerns build number 275 and higher.
I'm sure the community will find a lot of deficiencies in the JS
implementation but I hope you will appreciate it anyway.
I unexpectedly re-introduced the "testCacheBug", although I tried to
avoid it. Carsten: could you please help me with that?
I would recommend to try this build on a separate installation as some
changes may break a lot of your tests. The parser is now somewhat sloppy
(like most browsers).
happy testing
Mittie
P.S. new httpunit version in use is 1.5.3-d-12M