",is,not,defined." /> HttpUnit: ReferenceError: "ValidationSummaryOnSubmit" is not defined. - Problems and solutions to issues related to Software : Business, Database, Firewalls, Office, Graphics, Security, System, Server.

Question : HttpUnit: ReferenceError: "ValidationSummaryOnSubmit" is not defined.

Hi there,

I'm trying to test a webpage using HttpUnit and Junit. I have these lines of code I've used before to open pages (and they've worked):

WebConversation wc = new WebConversation();
WebResponse   resp = wc.getResponse("http://cbrint78/dms_test_new_code/ProjectsDisc.aspx?id=1726");            
assertNotNull("Page hasn't been found.", resp);
System.out.println("Found Ana's Test Project page");

But now they don't open the page. I get this message (complaining about the third line, webResponse):

line 79 column 57 - Error: <o:p> is not recognized!
line 82 column 58 - Error: <o:p> is not recognized!
line 84 column 58 - Error: <o:p> is not recognized!
line 176 column 62 - Error: <iewc:treenode> is not recognized!
line 176 column 161 - Error: <iewc:treenode> is not recognized!
This document has errors that must be fixed before
using HTML Tidy to generate a tidied up version.
org.mozilla.javascript.EcmaError: ReferenceError: "ValidationSummaryOnSubmit" is not defined.
      at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3229)
      at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3219)
      at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3292)
      at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1636)
      at org.mozilla.javascript.ScriptRuntime.getNameFunctionAndThis(ScriptRuntime.java:1906)
      at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:2923)
      at script.x(httpunit)
      at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2251)
      at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:161)
      at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:340)
      at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2758)
      at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:159)
      at com.meterware.httpunit.javascript.ScriptingEngineImpl.doEventScript(ScriptingEngineImpl.java:131)
      at com.meterware.httpunit.scripting.ScriptableDelegate.doEventScript(ScriptableDelegate.java:70)
      at com.meterware.httpunit.WebResponse$Scriptable.load(WebResponse.java:819)
      at com.meterware.httpunit.javascript.JavaScript.load(JavaScript.java:80)
      at com.meterware.httpunit.javascript.JavaScriptEngineFactory.load(JavaScriptEngineFactory.java:62)
      at com.meterware.httpunit.RequestContext.runScripts(RequestContext.java:44)
      at com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:159)
      at com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:125)
      at com.meterware.httpunit.WebClient.getResponse(WebClient.java:96)
      at tryingAgainDMS.SecondAttempt.main(SecondAttempt.java:24)
Exception: com.meterware.httpunit.ScriptException: Event 'ValidationSummaryOnSubmit()' failed: org.mozilla.javascript.EcmaError: ReferenceError: "ValidationSummaryOnSubmit" is not defined.

Anyone any idea why? Has anything to do with security?

Thank you,

Ana


Answer : HttpUnit: ReferenceError: "ValidationSummaryOnSubmit" is not defined.


Hmm the easiest way to do this....

Configure a new web-site in IIS, and set up the Host Header (website identity) as "mail.domain.org". After it's created head back into the properties and select the Host Directory tab. Change it to a redirection to a URL, and enter https://mail.domain.org/exchange.

Because HTTPS will be answered by the Default Web Site (that's where the IP and certificate are bound) you won't run into problems with forwarding like this unless you also need to provide access to standard HTTP services on the same name.

Chris
Random Solutions  
 
programming4us programming4us