From: Tom H. <Tom...@fu...> - 2003-06-05 08:02:23
|
Can anyone help with this? I have a form - it happens to be the login page! Here is the anchor that I am trying to use: <a name="submit" href="javascript:document.authenticateForm.submit()" onmouseover="imgOn('submitMe');" onmouseout="imgOff('submitMe');"><img name="submitMe" src="/images/nbk/imagesLang/submit_en_off.gif" alt="SUBMIT" border="0"></a> Here is the test code that I am running: // get the submit anchor HtmlAnchor submit = page.getAnchorByName("submit"); // now submit the page HtmlPage page2 = (HtmlPage)submit.click(); When I try and submit this page I get the following stack trace. ======= EXCEPTION START ======== EcmaError: lineNumber=[1] column=[0] lineSource=[GargoyleWrapper0()] name=[TypeError] sourceName=[Wrapper definition for javascript url] message=[com.gargoylesoftware.htmlunit.javascript.host.Submit@3a5c7a is not a function.] errorObject=[TypeError: com.gargoylesoftware.htmlunit.javascript.host.Submit@3a5c7a is not a function.] com.gargoylesoftware.htmlunit.ScriptException: com.gargoylesoftware.htmlunit.javascript.host.Submit@3a5c7a is not a function. at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScript Engine.java:199) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(Html Page.java:767) at com.gargoylesoftware.htmlunit.html.HtmlAnchor.click(HtmlAnchor.java:68) at test.site.testHomePage.testNBKLoginForWMO(testHomePage.java:181) at java.lang.reflect.Method.invoke(Native Method) at junit.framework.TestCase.runTest(TestCase.java:166) at junit.framework.TestCase.runBare(TestCase.java:140) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:131) at junit.framework.TestSuite.runTest(TestSuite.java:173) at junit.framework.TestSuite.run(TestSuite.java:168) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu nner.java:360) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner. java:246) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner .java:146) Enclosed exception: TypeError: com.gargoylesoftware.htmlunit.javascript.host.Submit@3a5c7a is not a function. (Wrapper definition for javascript url; line 1) at org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:597) at org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:557) at org.mozilla.javascript.NativeGlobal.typeError1(NativeGlobal.java:567) at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1182) at org.mozilla.javascript.gen.c19.call(Wrapper definition for javascript url:1) at org.mozilla.javascript.optimizer.OptRuntime.callSimple(OptRuntime.java:275) at org.mozilla.javascript.gen.c21.call(javascript url:1) at org.mozilla.javascript.gen.c21.exec(javascript url) at org.mozilla.javascript.Context.evaluateReader(Context.java:820) at org.mozilla.javascript.Context.evaluateString(Context.java:784) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScript Engine.java:191) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(Html Page.java:767) at com.gargoylesoftware.htmlunit.html.HtmlAnchor.click(HtmlAnchor.java:68) at test.site.testHomePage.testNBKLoginForWMO(testHomePage.java:181) at java.lang.reflect.Method.invoke(Native Method) at junit.framework.TestCase.runTest(TestCase.java:166) at junit.framework.TestCase.runBare(TestCase.java:140) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:131) at junit.framework.TestSuite.runTest(TestSuite.java:173) at junit.framework.TestSuite.run(TestSuite.java:168) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu nner.java:360) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner. java:246) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner .java:146) == CALLING JAVASCRIPT == GargoyleWrapper0() ======= EXCEPTION END ======== ___________________________________________________________________________ This message is intended solely for the use of the individual or organisation to whom it is addressed and may contain confidential or copyrighted information. If you have received this message in error, please reply to the originator and delete it immediately. If you are not the intended recipient, you should not use, copy, alter, disseminate, print or disclose the contents of this message. Information or opinions expressed in this message and/or any attachments are those of the author and are not necessarily those of EFSS Ltd. or its affiliates. EFSS Ltd. accepts no responsibility for loss or damage arising from its use, including damage from viruses. Note: Internet e-mails are not necessarily secure. EFSS Ltd. does not accept responsibility for changes made to this message after it was sent. ___________________________________________________________________________ |