[Webtest] Javascript failing

Brandon Moore webtest@lists.canoo.com
Tue, 1 Jul 2003 14:39:44 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_0000_01C33FDE.9EABE1A0
Content-Type: text/plain;
	charset="utf-8"
Content-Transfer-Encoding: quoted-printable

I do have js.jar in my classpath. Javascript attached to forms works =
fine.
onsubmit actions exectute and possibly prevent a clickbutton from taking =
you
anywhere, etc. The exception is thrown inside rhino code (In an object =
built
to be a function objects invoker), so I'm pretty webtest sees rhino on =
the
classpath. No one else has trouble with javascript on links?

I can't figure out what is happening here. Does anyone else see symptoms
like this:

I put up a test webpage that looks like this:

<html>
  <head>
    <title>Javascript Test</title>
  </head>
  <body>
    <form id=3D"testForm" action=3D"http://www.google.com">
      <input name=3D"button" type=3D"SUBMIT">
    </form>
    <a href=3D"javascript:document.forms[0].submit()">click</a>

  </body>
</html>

My test script invokes the page, uses clicklink with label "click", and
crashed:

java.lang.NoClassDefFoundError:
com/meterware/httpunit/javascript/JavaScript$Form
	at inv1.invoke()
	at
org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:498)
	at
org.mozilla.javascript.FunctionObject.call(FunctionObject.java:413)
	at
org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1191)
	at org.mozilla.javascript.gen.c1.call(httpunit:0)
	at org.mozilla.javascript.gen.c1.exec(httpunit)
	at org.mozilla.javascript.Context.evaluateReader(Context.java:820)
	at org.mozilla.javascript.Context.evaluateString(Context.java:784)
	at
com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.getURLConte=
nts
(JavaScript.java:176)
	at
com.meterware.httpunit.scripting.ScriptableDelegate.evaluateURL(Scriptabl=
eDe
legate.java:70)
	at com.meterware.httpunit.WebWindow.getResource(WebWindow.java:157)
	at
com.meterware.httpunit.WebWindow.getSubframeResponse(WebWindow.java:117)
	at com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:110)
	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:263)
	at
com.canoo.webtest.steps.request.Target.gotoTarget(Target.java:219)
	at
com.canoo.webtest.steps.request.Target.gotoTarget(Target.java:186)
	at
com.canoo.webtest.steps.request.ClickLink.doExecute(ClickLink.java:48)
	at com.canoo.webtest.steps.Step.execute(Step.java:59)
	at com.canoo.webtest.engine.Engine.executeSteps(Engine.java:32)
	at
com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificationTask=
.ja
va:55)
	at org.apache.tools.ant.Task.perform(Task.java:341)
	at org.apache.tools.ant.Target.execute(Target.java:309)
	at org.apache.tools.ant.Target.performTasks(Target.java:336)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
	at org.apache.tools.ant.Main.runBuild(Main.java:609)
	at org.apache.tools.ant.Main.start(Main.java:196)
	at org.apache.tools.ant.Main.main(Main.java:235)

Brandon

-----Original Message-----
From: webtest-admin@lists.canoo.com
[mailto:webtest-admin@lists.canoo.com]On Behalf Of Thakkar, Hetal
Sent: Tuesday, July 01, 2003 10:46 AM
To: webtest@gate.canoo.com
Subject: RE: [Webtest] How to invoke Javascript from canoo?


This might happen because you don't have js.jar in your classpath. Most
probably the problem is occurring because one of the jar files is not in
your classpath.

As for my case, yes javascript is submitting a form that should make the
server change the database.

Hetal

-----Original Message-----
From: Brandon Moore [mailto:bmoore@commcode.com]
Sent: Monday, June 30, 2003 10:32 AM
To: webtest@gate.canoo.com
Subject: RE: [Webtest] How to invoke Javascript from canoo?


You could try using the verifyxpath task to compare the contents of the
<a> tag with a string, so you can see what the xpath engine canoo uses
comes up with. You don't have any trouble following the link if you use
an empty label? Any time I try to write a test that follows a link canoo
dies with a NoClassDefFound exception inside rhino, missing
Javascript$Form from HttpUnit. Any idea why that would be happening?
I'm using the latest version.

I would try coding the test in HttpUnit and see if that hits the =
database.
What do you mean the javascript should change the database? Do you mean
the javascript should submit a form that should make the server change
the database?

Brandon

-----Original Message-----
From: webtest-admin@lists.canoo.com
[mailto:webtest-admin@lists.canoo.com]On Behalf Of Thakkar, Hetal
Sent: Monday, June 30, 2003 12:19 PM
To: webtest@gate.canoo.com
Subject: RE: [Webtest] How to invoke Javascript from canoo?


Hi Brandon,

When I use "" as label of link then the test runs without any error, but
this function "SubmitWithDisclosure" is supposed to update a database, =
which
is not being done, so I don't think it is invoked.
When I use "Submit" or " Submit " as label of the link then I get link =
not
found error.
The xpath returns "\u00A0Submit\u00A0", which is unicode for =
"=C3=A1Submit=C3=A1", I
tried using that and I get the same link not found error with text
"=C3=9FSubmit=C3=9F". I think the problem here is that for some reason =
when I put "=C3=A1"
in my tests it is changed to "=C3=9F" when comparing, so it does not =
work.

Thanks for your reply,
Hetal
Y zfj)b?	b?m7X=1AA=1Chm+- (Y?b ~y^

------=_NextPart_000_0000_01C33FDE.9EABE1A0
Content-Type: application/ms-tnef;
	name="winmail.dat"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	filename="winmail.dat"

eJ8+Ii8TAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEIgAcAGAAAAElQTS5NaWNy
b3NvZnQgTWFpbC5Ob3RlADEIAQaAAwAOAAAA0wcHAAEADgAnACwAAgBFAQENgAQAAgAAAAIAAgAB
A5AGAPgQAAA0AAAAAwA2AAAAAAADAASACCAGAAAAAADAAAAAAAAARgAAAABShQAAc3kBAB4ABYAI
IAYAAAAAAMAAAAAAAABGAAAAAFSFAAABAAAABAAAADkuMAALAA+ACCAGAAAAAADAAAAAAAAARgAA
AAAGhQAAAACDAAMABoAIIAYAAAAAAMAAAAAAAABGAAAAAAGFAAAAAAAACwADgAggBgAAAAAAwAAA
AAAAAEYAAAAAA4UAAAAAAAALAAeACCAGAAAAAADAAAAAAAAARgAAAAAOhQAAAAAAAAMAAIAIIAYA
AAAAAMAAAAAAAABGAAAAABCFAAAAAAAAAwAIgAggBgAAAAAAw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