Menu

SyntaxError: missing ; before statement

Help
navarrot
2006-04-27
2013-04-26
  • navarrot

    navarrot - 2006-04-27

    I am getting the following at the top of my Exeception stack trace:<tt>
    Script ... failed: SyntaxError: missing ; before statement (httpunit; )
        at com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.handleScriptException(JavaScript.java:192)
        at com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.executeScript(JavaScript.java:126)
        at com.meterware.httpunit.scripting.ScriptableDelegate.runScript(ScriptableDelegate.java:64)
    </tt>

    I am using HttpUnit to simulate a third-party website, and the Exception occurs when the following function is loaded as I attempt to get a WebResponse from a webpage:
    <tt>Function HaveMapViewer()

       Dim map

       HaveMapViewer = False
       On Error Resume Next
       Set map = CreateObject("Autodesk.MGMap.1")
       HaveMapViewer = IsObject(map)

    End Function
    Function GetViewerAPI()

       Dim map
       GetViewerAPI = 0
       On Error Resume Next
       Set map = CreateObject("Autodesk.MGMap.1")
       GetViewerAPI = map.getApiVersion()

    End Function</tt>

    I'm not sure if this is due to a bug in the website, or the inability of HttpUnit to handle these scripts at all.

    I have tried calling "HttpUnitOptions.setScriptingEnabled(false);" but when I do that, the webpage from which I'm am trying to acquire a WebResponse displays a VBScript runtime error "Object required: 'ExecSQL(...)' ". So it seems that I need some scripting to run, but I don't know how to get around the scripts that HttpUnit can't handle. In the past I have been able to turn off all scripting and manually execute the scripts that I need, but It doesn't seem that I'll be able to do that here, as a script is executed upon loading the webpage, and that script execute others which lie in outside of the page source.

    Sorry this was so long, but I hope that my thorough-ness will help someone understand my problem.

    Thanks in advance!

     
    • navarrot

      navarrot - 2006-04-27

      Please ignore the <tt> tags, as I did not take heed of the warning that "HTML tags will display in your post as text" when I used them.

       

Log in to post a comment.

MongoDB Logo MongoDB