org.mozilla.javascript.EcmaError: TypeError:

2009-05-15
2013-04-26
  • tarun narang
    tarun narang
    2009-05-15

    Hi

    I am facing the below error after updating the httpunit jar to the latest one i.e 1.7. Any help will be really appreciated.

    Thanks
    Tarun

    Testcase: testGetCompletedSurveys took 7.328 sec
        Caused an ERROR
    Script 'document.domain = document.domain.substring(document.domain.indexOf('.') + 1);' failed: org.mozilla.javascript.EcmaError: TypeError: Cannot call method "substring" of undefined
    com.meterware.httpunit.ScriptException: Script 'document.domain = document.domain.substring(document.domain.indexOf('.') + 1);' failed: org.mozilla.javascript.EcmaError: TypeError: Cannot call method "substring" of undefined
        at com.meterware.httpunit.javascript.ScriptingEngineImpl.handleScriptException(ScriptingEngineImpl.java:64)
        at com.meterware.httpunit.javascript.ScriptingEngineImpl.runScript(ScriptingEngineImpl.java:95)
        at com.meterware.httpunit.scripting.ScriptableDelegate.runScript(ScriptableDelegate.java:88)
        at com.meterware.httpunit.ParsedHTML.interpretScriptElement(ParsedHTML.java:364)
        at com.meterware.httpunit.ParsedHTML$ScriptFactory.recordElement(ParsedHTML.java:533)
        at com.meterware.httpunit.ParsedHTML$2.processElement(ParsedHTML.java:744)
        at com.meterware.httpunit.NodeUtils$PreOrderTraversal.perform(NodeUtils.java:241)
        at com.meterware.httpunit.ParsedHTML.loadElements(ParsedHTML.java:760)
        at com.meterware.httpunit.ParsedHTML.getFrames(ParsedHTML.java:1101)
        at com.meterware.httpunit.WebResponse.getFrames(WebResponse.java:1285)
        at com.meterware.httpunit.WebResponse.getFrameRequests(WebResponse.java:1024)
        at com.meterware.httpunit.FrameHolder.updateFrames(FrameHolder.java:179)
        at com.meterware.httpunit.WebWindow.updateFrameContents(WebWindow.java:315)
        at com.meterware.httpunit.WebClient.updateFrameContents(WebClient.java:526)
        at com.meterware.httpunit.WebWindow.updateWindow(WebWindow.java:201)
        at com.meterware.httpunit.WebWindow.getSubframeResponse(WebWindow.java:183)
        at com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:158)
        at com.meterware.httpunit.WebWindow.updateWindow(WebWindow.java:199)
        at com.meterware.httpunit.WebWindow.getSubframeResponse(WebWindow.java:183)
        at com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:158)
        at com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:125)
        at com.meterware.httpunit.WebClient.getResponse(WebClient.java:96)
        at com.xch.xarchitecture.AbstractEndToEndTest.login(AbstractEndToEndTest.java:77)
        at com.xch.baseportal.survey.SurveyWebSystemTest.testGetCompletedSurveys(SurveyWebSystemTest.java:15)