1 Reply Latest reply on Apr 20, 2011 4:15 PM by ssilvert

    JSFUnit2 disable javascript processing on HtmlUnit

    susmit_shukla

      Using JSFUnit2, how can I disable Javascript processing on WebClient on embedded HttpUnit. I tried with old jsfunit 1.3 style code to get hold of WebClientSpec and disable JS but that did not work with jsfunit2 / Arquillian

      With pure JSFUnit 2 test can we get hold of HttpUnit objects to enable/disable its features?

       

      P.S. I'm getting following errors while getting the page (using FF browser annotation):

      EcmaError: lineNumber=[4086] column=[0] lineSource=[<no source>] name=[TypeError] sourceName=[script in http://localhost:9090/test/index.jsf?_nkw=ipod from (948, 106) to (12907, 10)] message=[TypeError: Object's getDefaultValue() method returned an object. (script in http://localhost:9090/test/index.jsf?_nkw=ipod from (948, 106) to (12907, 10)#4086)]

      com.gargoylesoftware.htmlunit.ScriptException: TypeError: Object's getDefaultValue() method returned an object.

       

      With default browser, error is this

      Caused by: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: com.gargoylesoftware.htmlunit.javascript.background.JavaScriptFunctionJob

          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1332)

        • 1. JSFUnit2 disable javascript processing on HtmlUnit
          ssilvert

          You should be able to disable javascript using the old JSFUnit 1.3 code instead of using the annotations.  I can't think of any reason why this would not work.  It does bring to mind that we probably need a @JSFUnitFactory annotation that allows you to further customize the JSFSession before it is created.

           

          Stan