Re: related javascript files not fetched
Russell Gold <[email protected]> Tue, 18 Aug 2009 04:28:14 -0400
| Newsgroups | gmane.comp.web.httpunit.devel |
|---|---|
| Message-ID | <[email protected]> |
That's an interesting point. If the main file is found and one of the scripts is not, what is the correct behavior? I've mostly only returned the status from the main page (I believe this is true of frames as well), but perhaps we need an option to watch for missing sub-pages / scripts. Why don't you file an enhancement request to track this, if you think it important. On Aug 17, 2009, at 6:44 PM, <[email protected]> <[email protected] > wrote: > My prior complaint about it not loading javascript files > seems to have been transient, a SVN update has fixed it. > > However, the second part of my question was more > about a 404 on javascript files, if you look at > the following test there is no exception thrown > even though xyz.js does not exist. > > public void testBadJavascriptFile() throws Exception { > defineResource("OnCommand.html", > "<html><head>" + > "<script language='JavaScript' src='xyz.js'></script></head>" + > "<body>Hello</body></html>" ); > HttpUnitOptions.setExceptionsThrownOnErrorStatus(true); > HttpUnitOptions.setExceptionsThrownOnScriptError(true); > HttpUnitOptions.clearScriptErrorMessages(); > WebConversation wc = new WebConversation(); > wc.setExceptionsThrownOnErrorStatus(true); > try { > WebResponse response = wc.getResponse( getHostPath() + "/ > OnCommand.html" ); > fail("there should have been an exception"); > } catch (Throwable th) { > th.printStackTrace(); > // not sure what to expect here, currently no expection is > produced > } > } > > > Also HttpUnitOptions.getScriptErrorMessages() does not show > any errors, but a WebClientListener will show a 404 from the server. > > Thanks, > Dan > > >> Wolfgang Fahl wrote: >> Dan wrote: >>> The current version of HttpUnit in Subversion does not seem to be >>> fetching the related javascript files. I don't see the hits in the >>> access log of my server or in my WebClientListener.The >>> 1.7 version definitely fetched these, as did the older version I >>> have. >>> This seems like it must be a bug. It can't do any javascript >>> processing >>> if it doesn't download the javascript files. >> >> The JUnit Test ScriptingTest.java >> does have several test cases that include >> <script language='JavaScript' src='saycheese.js'> >> statements. So one question would be what kind of html statement >> you'd expect do the pickup. >> >> You might want to add a test to >> https://httpunit.svn.sourceforge.net/svnroot/httpunit/trunk/httpunit/test/com/meterware/httpunit/javascript/ScriptingTest.java >> to show what the issue is that you might want to get fixed. It >> might have to do with the bug fix for 1055450 >> that explicitly called for being able to bypass script file loading >> errors. >> >>> (my next question is going to be how to detect javascript errors >>> and missing javascript files, but it seems this has to be resolved >>> first) >> >> Hope the above helps to figure out what your needs are. > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > trial. Simplify your report design, integration and deployment - and > focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Httpunit-develop mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/httpunit-develop ----------------- Come read my webnovel, Take a Lemon <http://www.takealemon.com>, and listen to the Misfile radio play <http://www.gold-family.us/audio/misfile.html >! ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Httpunit-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/httpunit-develop