Dear kesav,

you might want to read the FAQ and the comments on the sourceforge project main page.
Javascript is only partly supported by httpunit. You might want to switch the java script parser off as outlined in the FAQ.
If the websites you need to test are using heavyweight javascript httpunit might not be the right tool for the task.

I'm going to again post the FAQ  in a minute.

Wolfgang

Am 15.12.11 14:06, schrieb kesav reddy:
Hi HttpUnit Developers,

  I am validating HttpUnit for my project use to just see HttpUnit can be used for my next project. During this, i am facing problem. Hope some one can help me out with this. Thanks in Advance.

Problem:: I am getting below exception when i try to invoke "http://search.yahoo.com/search?p=fbi+most+wanted" . I am attaching my source code along with the mail.
 
  com.meterware.httpunit.ScriptException: Script 'var pL=0, pUrl='http://ybinst9.ec.yimg.com/ec/fd/ls/l?IG=4a06755fc6924b6aa94ee9ebc4398ae8&CID=4a06755fc6924b6aa94ee9ebc4398ae8&Type=Event.CPT';function SLB(s,pUrl){var url,img=new Image(),dat='&DATA=';dat+=s?'%7B%22pp%22%3A%7B%22S%22%3A%22A%22%7D%7D':'%7B%22pp%22%3A%7B%22S%22%3A%22L%22%7D%7D';url=pUrl+dat;img.src=url+'&'+(new Date()).getTime();pL=1}window.onbeforeunload=function(){(!pL)?SLB("A",pUrl):""};window.onload=function(){SLB("",pUrl)};(function(){var h=document.documentElement;h.className+=" js";(new Image()).src='http://l.yimg.com/pv/static/img/metro_sprite-201109271557.png';})();' failed: org.mozilla.javascript.EcmaError: TypeError: Cannot read property "className" from 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.parsing.NekoDOMParser.runScript(NekoDOMParser.java:151)
    at com.meterware.httpunit.parsing.ScriptFilter.getTranslatedScript(ScriptFilter.java:150)
    at com.meterware.httpunit.parsing.ScriptFilter.endElement(ScriptFilter.java:131)
    at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:249)
    at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:367)
    at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1015)
    at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:888)
    at org.cyberneko.html.HTMLScanner$SpecialScanner.scan(HTMLScanner.java:2831)
    at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:809)
    at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:478)
    at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:431)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at com.meterware.httpunit.parsing.NekoHTMLParser.parse(NekoHTMLParser.java:48)
    at com.meterware.httpunit.HTMLPage.parse(HTMLPage.java:271)
    at com.meterware.httpunit.WebResponse.getReceivedPage(WebResponse.java:1301)
    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.WebClient.getResponse(WebClient.java:122)
    at com.yahoo.sample.httpUnit.Example.main(Example.java:17)



------------------------------------------------------------------------------
10 Tips for Better Server Consolidation
Server virtualization is being driven by many needs.  
But none more important than the need to reduce IT complexity 
while improving strategic productivity.  Learn More! 
http://www.accelacomm.com/jaw/sdnl/114/51507609/


_______________________________________________
Httpunit-develop mailing list
Httpunit-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/httpunit-develop

-- 

BITPlan - smart solutions
Wolfgang Fahl
Pater-Delp-Str. 1, D-47877 Willich Schiefbahn
Tel. +49 2154 811-480, Fax +49 2154 811-481
Web: http://www.bitplan.de
BITPlan GmbH, Willich - HRB 6820 Krefeld, Steuer-Nr.: 10258040548, Geschäftsführer: Wolfgang Fahl