ok, actually last time this forum is not posted my code. It is specied that my code has some tags '<' which are not allowble. This time also i dont know whether sending of this new message. ok now i coming to problem
this is httpunit test code
transferForm.setCheckbox("until",true);
transferPage.getLinkWithID("calendarLink").click();
my page contains some textbox besides one 'calendarLink' button. in above httpunit code i am clicking on that button. At bottom i am furnishing my javascript corresponding to my click event. This click function will call one aws_calendar.jsp page. this page contains onload() which will call one local function named as setDate(); Here i am getting the following error at the time of running my httpunit testcase. But through Browser this onclick function is working fine.
see my javscript function
function setDate() {
if(window.dialogArguments!=null) {
parentWinObj = window.dialogArguments;
}else{
parentWinObj = window.opener;
}
styleFlag = document.calControl.style?1:0;
dateObj = parentWinObj.dateObj;
dateField = dateObj.dateField;
dateFormat = dateObj.dateFormat;
dateField = trim(dateField);
if((dateField != null) && (dateField != "") ){
old = new Date(dateField);
}
else {
old = new Date();// set calender to present date.
}
day = old.getDate();
var month = old.getMonth();
var year = old.getFullYear();
setSelectedTime(old);
focusDay = day;
document.calControl.month.selectedIndex = month;
document.calControl.year.value = year;
displayCalendar(day, month, year);
setDateField(day, month,year);
}
The above function related to the page aws_calendar.jsp. If we click 'ok' then it will send selected date to the parent page. First of all at the time of loading this aws_calendar.jsp, this setDate() function is not working.
See my ERROR report i am getting like .The undefined value has no properties.
org.mozilla.javascript.EvaluatorException: The undefined value has no properties.
at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:61)
at org.mozilla.javascript.Context.reportRuntimeError(Context.java:549)
at org.mozilla.javascript.Context.reportRuntimeError(Context.java:587)
at org.mozilla.javascript.Context.reportRuntimeError0(Context.java:557)
at org.mozilla.javascript.Undefined.reportError(Undefined.java:136)
at org.mozilla.javascript.Undefined.getPrototype(Undefined.java:98)
at org.mozilla.javascript.ScriptRuntime.setProp(ScriptRuntime.java:835)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1817)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:88)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1222)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1950)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:88)
at com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.performEvent(JavaScript.java:172)
at com.meterware.httpunit.scripting.ScriptableDelegate.doEvent(ScriptableDelegate.java:56)
at com.meterware.httpunit.WebResponse$Scriptable.load(WebResponse.java:689)
at com.meterware.httpunit.javascript.JavaScript.load(JavaScript.java:89)
at com.meterware.httpunit.javascript.JavaScriptEngineFactory.load(JavaScriptEngineFactory.java:58)
at com.meterware.httpunit.RequestContext.runScripts(RequestContext.java:44)
at com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:122)
at com.meterware.httpunit.WebResponse$Scriptable.open(WebResponse.java:698)
at com.meterware.httpunit.javascript.JavaScript$Window.jsFunction_open(JavaScript.java:474)
at inv1.invoke()
at org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:517)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:433)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1222)
at org.mozilla.javascript.gen.c3.call(httpunit:19)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1222)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1950)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:88)
at com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.performEvent(JavaScript.java:172)
at com.meterware.httpunit.scripting.ScriptableDelegate.doEvent(ScriptableDelegate.java:56)
at com.meterware.httpunit.WebRequestSource.submitRequest(WebRequestSource.java:232)
at com.meterware.httpunit.WebLink.click(WebLink.java:98)
at com.actiontech.jmetro.admin.TransferTest.testForFixingProblems(TransferTest.java:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
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:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:325)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:524)
org.mozilla.javascript.JavaScriptException: com.meterware.httpunit.ScriptException: Event 'setDate1()' f
at org.mozilla.javascript.JavaScriptException.wrapException(JavaScriptException.java:78)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:437)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1222)
at org.mozilla.javascript.gen.c3.call(httpunit:19)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1222)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1950)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:88)
at com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.performEvent(JavaScript.java:172)
at com.meterware.httpunit.scripting.ScriptableDelegate.doEvent(ScriptableDelegate.java:56)
at com.meterware.httpunit.WebRequestSource.submitRequest(WebRequestSource.java:232)
at com.meterware.httpunit.WebLink.click(WebLink.java:98)
at com.actiontech.jmetro.admin.TransferTest.testForFixingProblems(TransferTest.java:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
******************End test:******************testForFixingProblems
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 3.469 sec
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:325)
see script i wrote in parent
jsp page
calWindowObjRef = window.open('aws_calendar.jsp', "SelectDate","titilebar = no,status=no,toolbar=no,directories=no,menubar=no,scrollbars=no,center=yes,dialog=yes,resizable=yes,modal=yes,dependent=yes,minimizable=no,width=280px,height=440px");
Please any One who knows solution can help me. I spent already 2 days to fix this.But still am not able to resolve.
Thanks.