You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(10) |
Aug
(30) |
Sep
(15) |
Oct
(26) |
Nov
(12) |
Dec
(17) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(7) |
Feb
(27) |
Mar
(73) |
Apr
(17) |
May
(17) |
Jun
(78) |
Jul
(67) |
Aug
(60) |
Sep
(89) |
Oct
(140) |
Nov
(173) |
Dec
(46) |
2004 |
Jan
(39) |
Feb
(7) |
Mar
(21) |
Apr
(31) |
May
(13) |
Jun
(86) |
Jul
(14) |
Aug
(14) |
Sep
(53) |
Oct
(184) |
Nov
(186) |
Dec
(319) |
2005 |
Jan
(336) |
Feb
(274) |
Mar
(226) |
Apr
(102) |
May
(196) |
Jun
(130) |
Jul
(119) |
Aug
(143) |
Sep
(76) |
Oct
(85) |
Nov
(70) |
Dec
(159) |
2006 |
Jan
(125) |
Feb
(100) |
Mar
(80) |
Apr
(39) |
May
(55) |
Jun
(58) |
Jul
(50) |
Aug
(76) |
Sep
(55) |
Oct
(101) |
Nov
(163) |
Dec
(85) |
2007 |
Jan
(56) |
Feb
(53) |
Mar
(180) |
Apr
(221) |
May
(290) |
Jun
(199) |
Jul
(322) |
Aug
(515) |
Sep
(121) |
Oct
(297) |
Nov
(177) |
Dec
(103) |
2008 |
Jan
(516) |
Feb
(315) |
Mar
(586) |
Apr
(615) |
May
(197) |
Jun
(381) |
Jul
(390) |
Aug
(195) |
Sep
(603) |
Oct
(499) |
Nov
(622) |
Dec
(350) |
2009 |
Jan
(313) |
Feb
(338) |
Mar
(507) |
Apr
(317) |
May
(197) |
Jun
(375) |
Jul
(235) |
Aug
(424) |
Sep
(410) |
Oct
(338) |
Nov
(286) |
Dec
(306) |
2010 |
Jan
(367) |
Feb
(339) |
Mar
(371) |
Apr
(172) |
May
(233) |
Jun
(264) |
Jul
(421) |
Aug
(110) |
Sep
(218) |
Oct
(189) |
Nov
(185) |
Dec
(168) |
2011 |
Jan
(145) |
Feb
(213) |
Mar
(205) |
Apr
(64) |
May
(159) |
Jun
(67) |
Jul
(104) |
Aug
(126) |
Sep
(144) |
Oct
(106) |
Nov
(154) |
Dec
(225) |
2012 |
Jan
(111) |
Feb
(87) |
Mar
(131) |
Apr
(102) |
May
(180) |
Jun
(160) |
Jul
(412) |
Aug
(315) |
Sep
(311) |
Oct
(369) |
Nov
(464) |
Dec
(284) |
2013 |
Jan
(343) |
Feb
(165) |
Mar
(174) |
Apr
(120) |
May
(153) |
Jun
(134) |
Jul
(202) |
Aug
(105) |
Sep
(228) |
Oct
(332) |
Nov
(192) |
Dec
(219) |
2014 |
Jan
(348) |
Feb
(194) |
Mar
(189) |
Apr
(188) |
May
(297) |
Jun
(206) |
Jul
(79) |
Aug
(279) |
Sep
(111) |
Oct
(159) |
Nov
(61) |
Dec
(78) |
2015 |
Jan
(152) |
Feb
(145) |
Mar
(239) |
Apr
(223) |
May
(248) |
Jun
(296) |
Jul
(172) |
Aug
(189) |
Sep
(338) |
Oct
(217) |
Nov
(131) |
Dec
(184) |
2016 |
Jan
(118) |
Feb
(221) |
Mar
(414) |
Apr
(412) |
May
(303) |
Jun
(133) |
Jul
(129) |
Aug
(121) |
Sep
(136) |
Oct
(67) |
Nov
(89) |
Dec
(245) |
2017 |
Jan
(349) |
Feb
(90) |
Mar
(328) |
Apr
(430) |
May
(284) |
Jun
(199) |
Jul
(164) |
Aug
(120) |
Sep
(57) |
Oct
(105) |
Nov
(108) |
Dec
(146) |
2018 |
Jan
(85) |
Feb
(48) |
Mar
(97) |
Apr
(62) |
May
(64) |
Jun
(136) |
Jul
(123) |
Aug
(87) |
Sep
(17) |
Oct
(27) |
Nov
(9) |
Dec
(16) |
2019 |
Jan
(9) |
Feb
(17) |
Mar
(18) |
Apr
(14) |
May
(8) |
Jun
|
Jul
(6) |
Aug
(12) |
Sep
(5) |
Oct
|
Nov
(2) |
Dec
|
2020 |
Jan
(8) |
Feb
|
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
(4) |
Oct
(1) |
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(4) |
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2023 |
Jan
|
Feb
(6) |
Mar
(9) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <no...@us...> - 2003-07-19 18:19:42
|
Log Message: ----------- New method HtmlPage.getAllForms() as per feature request 742515 Modified Files: -------------- /cvsroot/htmlunit/htmlunit/src/xdocs: changes.xml /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html: HtmlPageTest.java /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/html: HtmlPage.java Revision Data ------------- Index: changes.xml =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/xdocs/changes.xml,v retrieving revision 1.116 retrieving revision 1.117 diff -u -d -r1.116 -r1.117 --- changes.xml 18 Jul 2003 13:04:10 -0000 1.116 +++ changes.xml 19 Jul 2003 18:19:36 -0000 1.117 @@ -142,6 +142,9 @@ <action type="update" dev="mbowler"> Upgraded the xerces to 2.4 </action> + <action type="new" dev="mbowler" id="742515"> + New method HtmlPage.getAllForms() + </action> </release> </body> Index: HtmlPageTest.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlPageTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- HtmlPageTest.java 10 Jun 2003 11:57:01 -0000 1.5 +++ HtmlPageTest.java 19 Jul 2003 18:19:36 -0000 1.6 @@ -927,5 +927,39 @@ assertEquals("Shift_JIS", page.getPageEncoding()); } + + + public void testGetAllForms() throws Exception { + + final String content + = "<html>" + + "<head><title>foo</title></head>" + + "<body>" + + "<form name='one'>" + + "<a id='c' accesskey='c'>foo</a>" + + "</form>" + + "<form name='two'>" + + "<a id='c' accesskey='c'>foo</a>" + + "</form>" + + "<input name='foo' type='submit' disabled='disabled' id='foo' accesskey='f'/>" + + "<input name='bar' type='submit' id='bar'/>" + + "</form></body></html>"; + + final WebClient client = new WebClient(); + + final FakeWebConnection webConnection = new FakeWebConnection( client ); + webConnection.setContent( content ); + client.setWebConnection( webConnection ); + + final HtmlPage page = ( HtmlPage )client.getPage( + new URL( "http://www.gargoylesoftware.com" ), + SubmitMethod.POST, Collections.EMPTY_LIST ); + + final List expectedForms = Arrays.asList( new HtmlForm[]{ + page.getFormByName("one"), + page.getFormByName("two") + } ); + assertEquals( expectedForms, page.getAllForms() ); + } } Index: HtmlPage.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/html/HtmlPage.java,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- HtmlPage.java 16 Jun 2003 21:03:24 -0000 1.47 +++ HtmlPage.java 19 Jul 2003 18:19:36 -0000 1.48 @@ -484,7 +484,14 @@ } } - + /** + * Return a list of all the forms in the page. + * @return All the forms. + */ + public List getAllForms() { + return getHtmlElementsByTagNames( Arrays.asList(new String[]{"form"}) ); + } + /** * Return the WebClient that originally loaded this page * |
From: <no...@us...> - 2003-07-19 17:17:32
|
Log Message: ----------- Fixed deprecated warnings Modified Files: -------------- /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit: HttpWebConnection.java Revision Data ------------- Index: HttpWebConnection.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- HttpWebConnection.java 16 Jul 2003 20:11:21 -0000 1.12 +++ HttpWebConnection.java 19 Jul 2003 17:17:30 -0000 1.13 @@ -274,10 +274,10 @@ // Disable certificate caching within HttpClient final HttpState httpState = new HttpState() { public void setCredentials( - final String realm, final Credentials credentials ) { + final String realm, final String host, final Credentials credentials ) { } - public Credentials getCredentials( final String realm ) { + public Credentials getCredentials( final String realm, final String host ) { return null; } }; @@ -287,9 +287,9 @@ final HostConfiguration hostConfiguration = new HostConfiguration(); final URI uri; try { - uri = new URI(url); + uri = new URI(url.toExternalForm()); } - catch( URIException e ) { + catch( final URIException e ) { // Theoretically impossible but .... throw new IllegalStateException("Unable to create URI from URL: "+url.toExternalForm()); } |
From: <no...@us...> - 2003-07-19 13:49:53
|
Log Message: ----------- Removed dependency on deprecated class StringBufferInputStream Modified Files: -------------- /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit: TextUtilTest.java /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit: TextUtil.java Revision Data ------------- Index: TextUtilTest.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/TextUtilTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- TextUtilTest.java 10 Jun 2003 11:57:00 -0000 1.3 +++ TextUtilTest.java 19 Jul 2003 13:49:47 -0000 1.4 @@ -37,6 +37,10 @@ */ package com.gargoylesoftware.htmlunit; +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; + /** * Tests for TextUtil. * @@ -128,6 +132,36 @@ assertFalse( "stringToCheck=["+stringToCheck+"] prefix=["+prefix+"]", TextUtil.startsWithIgnoreCase(stringToCheck, prefix)); + } + } + + public void testToInputStream_null() throws Exception { + try { + TextUtil.toInputStream(null); + fail("Expected NullPointerException"); + } + catch( final NullPointerException e ) { + // Expected path + } + } + + + public void testToInputStream() throws Exception { + final String[][] data = { + {"", null}, + {"a", "a"}, + {"abcdefABCDEF", "abcdefABCDEF"}, + }; + final String encoding = "ISO-8859-1"; + + for( int i=0; i<data.length; i++ ) { + final String input = data[i][0]; + final String expectedResult = data[i][1]; + + final InputStream inputStream = TextUtil.toInputStream(input, encoding); + final String actualResult + = new BufferedReader( new InputStreamReader(inputStream, encoding) ).readLine(); + assertEquals( expectedResult, actualResult); } } } Index: TextUtil.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/TextUtil.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- TextUtil.java 10 Jun 2003 11:56:56 -0000 1.9 +++ TextUtil.java 19 Jul 2003 13:49:47 -0000 1.10 @@ -37,7 +37,12 @@ */ package com.gargoylesoftware.htmlunit; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; import java.io.InputStream; +import java.io.OutputStreamWriter; +import java.io.UnsupportedEncodingException; /** * Utility methods relating to text. @@ -80,6 +85,43 @@ * @return The resulting input stream. */ public static InputStream toInputStream( final String content ) { - return new java.io.StringBufferInputStream(content); + try { + return toInputStream(content, "ISO-8859-1"); + } + catch( final UnsupportedEncodingException e ) { + throw new IllegalStateException( + "ISO-8859-1 is an unsupported encoding! You may have a corrupted installation of java."); + } + } + + /** + * Convert a string into an input stream. + * @param content The string + * @return The resulting input stream. + */ + public static InputStream toInputStream( + final String content, + final String encoding ) + throws + UnsupportedEncodingException { + + try { + final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(content.length()*2); + final OutputStreamWriter writer = new OutputStreamWriter(byteArrayOutputStream, encoding); + writer.write(content); + writer.flush(); + + final byte[] byteArray = byteArrayOutputStream.toByteArray(); + return new ByteArrayInputStream(byteArray); + } + catch( final UnsupportedEncodingException e ) { + throw e; + } + catch( final IOException e ) { + // Theoretically impossible since all the "IO" is in memory but it's a + // checked exception so we have to catch it. + e.printStackTrace(); + throw new IllegalStateException("Exception when converting a string to an input stream: "+e); + } } } |
From: SourceForge.net <no...@so...> - 2003-07-18 21:55:40
|
Feature Requests item #773552, was opened at 2003-07-18 11:59 Message generated for change (Comment added) made by rjwittams You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448269&aid=773552&group_id=47038 Category: None Group: None Status: Open Priority: 5 Submitted By: Robert Wittams (rjwittams) Assigned to: Nobody/Anonymous (nobody) Summary: Support proxy better - use http client more Initial Comment: Use http clients abilities more. The proxy server and credential apis are too simple. Eg NTLM auth, etc. Why not expose the HttpClient credential api? ---------------------------------------------------------------------- >Comment By: Robert Wittams (rjwittams) Date: 2003-07-18 22:38 Message: Logged In: YES user_id=270100 Surely the least ugly way to do this is to give WebClient a constructor taking an implementation of WebConnection. The setWebConnection is a pretty ugly way to do it imo... And deprecate the proxy settings constructor. Its misleading as it implies thats all the proxy settings you'll ever need. The cred stuff should just go. It either needs expanding to cover all the auth methods, which just duplicates HttpClient, or removal... I vote number 2. That kind of stuff is in my mind closely tied to the WebConnection, should be all part and parcel of that.. ---------------------------------------------------------------------- Comment By: Christian Sell (csell) Date: 2003-07-18 21:15 Message: Logged In: YES user_id=105319 a little comment: I have recently used HttpWebconnction to adapt HtmlUnit to another web client API (a descendant of W3Cs Jigsaw). I found this a rather easy process, despite the warnings about the "internal" character of HttpWebconnction. I would appreciate if this interface would remained intact - and maybe promoted to official status. HttpClient does have shortcomings, IMO. Christian ---------------------------------------------------------------------- Comment By: Mike Bowler (mbowler) Date: 2003-07-18 20:52 Message: Logged In: YES user_id=46756 The original plan was to completely isolate commons-httpclient so that it could be replaced if needed. At the time, it was not being actively maintained so this seemed a reasonable precaution. Today commons-httpclient is being very actively maintained so this decision doesn't make as much sense as it used to. Exposing the api isn't quite as simple as it sounds as there isn't a one-to-one mapping of WebClient to HttpClient. This was due to weaknesses in the httpclient api at the time the WebConnection was initially written. I believe that this could be changed today but it would require pretty much a rewrite of HttpWebConnection. I'll have to give this some thought. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448269&aid=773552&group_id=47038 |
From: <no...@us...> - 2003-07-18 20:24:52
|
Log Message: ----------- Converted dependency list to use the new maven format. Modified Files: -------------- /cvsroot/htmlunit/htmlunit: project.xml Revision Data ------------- Index: project.xml =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/project.xml,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- project.xml 18 Jul 2003 13:04:11 -0000 1.24 +++ project.xml 18 Jul 2003 20:24:51 -0000 1.25 @@ -107,7 +107,8 @@ <dependencies> <dependency> - <id>junit</id> + <groupId>junit</groupId> + <artifactId>junit</artifactId> <version>3.8.1</version> <url>http://www.junit.org/</url> <properties> @@ -116,7 +117,8 @@ </properties> </dependency> <dependency> - <id>junitperf</id> + <groupId>junitperf</groupId> + <artifactId>junitperf</artifactId> <version>1.8</version> <url>http://www.clarkware.com</url> <properties> @@ -125,8 +127,9 @@ </properties> </dependency> <dependency> - <id>commons-jelly</id> - <version>SNAPSHOT</version> + <groupId>commons-jelly</groupId> + <artifactId>commons-jelly</artifactId> + <version>20030711.034327</version> <url>http://jakarta.apache.org/commons/jelly</url> <properties> <htmlunit.group>jelly</htmlunit.group> @@ -134,8 +137,9 @@ </properties> </dependency> <dependency> - <id>commons-jelly+tags-log</id> - <version>SNAPSHOT</version> + <groupId>commons-jelly</groupId> + <artifactId>commons-jelly-tags-log</artifactId> + <version>20030211.142821</version> <url>http://jakarta.apache.org/commons/jelly</url> <properties> <htmlunit.group>Jelly</htmlunit.group> @@ -143,8 +147,9 @@ </properties> </dependency> <dependency> - <id>commons-jexl</id> - <version>SNAPSHOT</version> + <groupId>commons-jexl</groupId> + <artifactId>commons-jexl</artifactId> + <version>1.0-beta-1</version> <url>http://jakarta.apache.org/commons/jexl</url> <properties> <htmlunit.group>jelly</htmlunit.group> @@ -152,8 +157,9 @@ </properties> </dependency> <dependency> - <id>commons-cli</id> - <version>SNAPSHOT</version> + <groupId>commons-cli</groupId> + <artifactId>commons-cli</artifactId> + <version> 1.0-beta-2</version> <url>http://jakarta.apache.org/commons/cli</url> <properties> <htmlunit.group>jelly</htmlunit.group> @@ -161,7 +167,8 @@ </properties> </dependency> <dependency> - <id>dom4j</id> + <groupId>dom4j</groupId> + <artifactId>dom4j</artifactId> <version>1.4-dev-8</version> <url>http://www.dom4j.org/</url> <properties> @@ -170,7 +177,8 @@ </properties> </dependency> <dependency> - <id>commons-collections</id> + <groupId>commons-collections</groupId> + <artifactId>commons-collections</artifactId> <version>2.1</version> <url>http://jakarta.apache.org/commons/collections.html</url> <properties> @@ -179,7 +187,8 @@ </properties> </dependency> <dependency> - <id>commons-beanutils</id> + <groupId>commons-beanutils</groupId> + <artifactId>commons-beanutils</artifactId> <version>1.6.1</version> <url>http://jakarta.apache.org/commons/beanutils</url> <properties> @@ -188,7 +197,8 @@ </properties> </dependency> <dependency> - <id>commons-httpclient</id> + <groupId>commons-httpclient</groupId> + <artifactId>commons-httpclient</artifactId> <version>2.0-beta2</version> <url>http://jakarta.apache.org/commons/httpclient</url> <properties> @@ -197,7 +207,8 @@ </properties> </dependency> <dependency> - <id>gsbase</id> + <groupId>gsbase</groupId> + <artifactId>gsbase</artifactId> <version>2.0</version> <url>http://gsbase.sourceforge.net</url> <properties> @@ -216,27 +227,28 @@ </properties> </dependency> <dependency> - <id>xerces</id> + <groupId>xerces</groupId> + <artifactId>xercesImpl</artifactId> <version>2.4.0</version> <url>http://xml.apache.org/xerces2-j/index.html</url> - <jar>xercesImpl-2.4.0.jar</jar> <properties> <htmlunit.group>required</htmlunit.group> <htmlunit.description>XML Parser</htmlunit.description> </properties> </dependency> <dependency> - <id>xerces+parserAPIs</id> + <groupId>xerces</groupId> + <artifactId>xmlParserAPIs</artifactId> <version>2.2.1</version> <url>http://xml.apache.org/xerces2-j/index.html</url> - <jar>xmlParserAPIs-2.2.1.jar</jar> <properties> <htmlunit.group>required</htmlunit.group> <htmlunit.description>XML Parser</htmlunit.description> </properties> </dependency> <dependency> - <id>nekohtml</id> + <groupId>nekohtml</groupId> + <artifactId>nekohtml</artifactId> <version>0.7.7</version> <properties> <htmlunit.group>required</htmlunit.group> @@ -244,7 +256,8 @@ </properties> </dependency> <dependency> - <id>commons-logging</id> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> <version>1.0.2</version> <url>http://jakarta.apache.org/commons/logging.html</url> <properties> |
From: SourceForge.net <no...@so...> - 2003-07-18 20:22:34
|
Feature Requests item #773552, was opened at 2003-07-18 10:59 Message generated for change (Comment added) made by csell You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448269&aid=773552&group_id=47038 Category: None Group: None Status: Open Priority: 5 Submitted By: Robert Wittams (rjwittams) Assigned to: Nobody/Anonymous (nobody) Summary: Support proxy better - use http client more Initial Comment: Use http clients abilities more. The proxy server and credential apis are too simple. Eg NTLM auth, etc. Why not expose the HttpClient credential api? ---------------------------------------------------------------------- Comment By: Christian Sell (csell) Date: 2003-07-18 20:15 Message: Logged In: YES user_id=105319 a little comment: I have recently used HttpWebconnction to adapt HtmlUnit to another web client API (a descendant of W3Cs Jigsaw). I found this a rather easy process, despite the warnings about the "internal" character of HttpWebconnction. I would appreciate if this interface would remained intact - and maybe promoted to official status. HttpClient does have shortcomings, IMO. Christian ---------------------------------------------------------------------- Comment By: Mike Bowler (mbowler) Date: 2003-07-18 19:52 Message: Logged In: YES user_id=46756 The original plan was to completely isolate commons-httpclient so that it could be replaced if needed. At the time, it was not being actively maintained so this seemed a reasonable precaution. Today commons-httpclient is being very actively maintained so this decision doesn't make as much sense as it used to. Exposing the api isn't quite as simple as it sounds as there isn't a one-to-one mapping of WebClient to HttpClient. This was due to weaknesses in the httpclient api at the time the WebConnection was initially written. I believe that this could be changed today but it would require pretty much a rewrite of HttpWebConnection. I'll have to give this some thought. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448269&aid=773552&group_id=47038 |
From: SourceForge.net <no...@so...> - 2003-07-18 20:12:46
|
Feature Requests item #756086, was opened at 2003-06-17 14:06 Message generated for change (Comment added) made by mbowler You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448269&aid=756086&group_id=47038 Category: None Group: Next Release (example) >Status: Closed Priority: 5 Submitted By: JHoltman (jholtman) >Assigned to: Mike Bowler (mbowler) Summary: Please implement window.setTimeout(..) Initial Comment: Please implement the window.setTimeout(...) feature. This method is called quite often in the websites I like to test. Because it returns "not found" I can't test these websites. The current implementation in the source code is commented. (At the moment I don't have the time to dig deep in the source code to suggest a patch). ---------------------------------------------------------------------- >Comment By: Mike Bowler (mbowler) Date: 2003-07-18 15:42 Message: Logged In: YES user_id=46756 Done ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448269&aid=756086&group_id=47038 |
From: SourceForge.net <no...@so...> - 2003-07-18 19:52:49
|
Feature Requests item #773552, was opened at 2003-07-18 06:59 Message generated for change (Comment added) made by mbowler You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448269&aid=773552&group_id=47038 Category: None Group: None Status: Open Priority: 5 Submitted By: Robert Wittams (rjwittams) Assigned to: Nobody/Anonymous (nobody) Summary: Support proxy better - use http client more Initial Comment: Use http clients abilities more. The proxy server and credential apis are too simple. Eg NTLM auth, etc. Why not expose the HttpClient credential api? ---------------------------------------------------------------------- >Comment By: Mike Bowler (mbowler) Date: 2003-07-18 15:52 Message: Logged In: YES user_id=46756 The original plan was to completely isolate commons-httpclient so that it could be replaced if needed. At the time, it was not being actively maintained so this seemed a reasonable precaution. Today commons-httpclient is being very actively maintained so this decision doesn't make as much sense as it used to. Exposing the api isn't quite as simple as it sounds as there isn't a one-to-one mapping of WebClient to HttpClient. This was due to weaknesses in the httpclient api at the time the WebConnection was initially written. I believe that this could be changed today but it would require pretty much a rewrite of HttpWebConnection. I'll have to give this some thought. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448269&aid=773552&group_id=47038 |
From: <no...@us...> - 2003-07-18 15:38:38
|
Log Message: ----------- - Added google search bar - Moved sourceforge logo to the bottom of the page Modified Files: -------------- /cvsroot/htmlunit/htmlunit/src/xdocs: navigation.xml Revision Data ------------- Index: navigation.xml =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/xdocs/navigation.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- navigation.xml 16 Apr 2003 13:52:53 -0000 1.5 +++ navigation.xml 18 Jul 2003 15:38:37 -0000 1.6 @@ -9,11 +9,12 @@ </properties> <body> + <search/> + <menu name="SourceForge.net"> <item name="SourceForge project page" - href="http://www.sourceforge.net/projects/htmlunit" - img="http://sourceforge.net/sflogo.php?group_id=47038&type=2"/> + href="http://www.sourceforge.net/projects/htmlunit"/> <item name="Download" href="http://sourceforge.net/project/showfiles.php?group_id=47038"/> </menu> <menu name="How do I..."> @@ -34,6 +35,15 @@ <item name="JavaScript engine" href="/javascript.html"/> <item name="TODO" href="/todo.html"/> </menu> + + <footer> + <div style="text-align: right"> + Project hosting by:<br /> + <a href="http://sourceforge.net/projects/htmlunit"> + <img src="http://sourceforge.net/sflogo.php?group_id=47038&type=2" alt="Sourceforge Logo" border="0" /> + </a> + </div> + </footer> </body> </project> |
From: SourceForge.net <no...@so...> - 2003-07-18 14:14:43
|
Bugs item #772954, was opened at 2003-07-17 08:46 Message generated for change (Comment added) made by mbowler You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=772954&group_id=47038 Category: None Group: None >Status: Closed Resolution: None Priority: 5 Submitted By: Jacky (tuple) >Assigned to: Mike Bowler (mbowler) Summary: HTML unit hangs Initial Comment: Executing final WebClient webClient = new WebClient(); final URL url = new URL (applicationURL); final HtmlPage page = (HtmlPage) webClient.getPage(url); makes HTML unit hang. He's in an infinte loop in WebClient getPage Any idea ? Tx Dirk dir...@po... ---------------------------------------------------------------------- >Comment By: Mike Bowler (mbowler) Date: 2003-07-18 10:14 Message: Logged In: YES user_id=46756 I'm going to close this bug since the "hanging" problem is fixed. Please open new bugs with stack traces for any javascript problems you're seeing. The error "specified row could not be found in table" is an assertion that should never happen. It means that a <td> tag has been found *outside* of a <tr> which shouldn't be possible. ---------------------------------------------------------------------- Comment By: Jacky (tuple) Date: 2003-07-18 09:44 Message: Logged In: YES user_id=818234 The basic problem was a classpath problem. This stops the hanging. Now I can go to some pages, others gives me javascript exceptions. If I disable javascript, I can no longer simulate my buttons-clicks because in the onClick there's javascript. So I tried page.executeJavaScriptIfPossible(onClick, input.getNameAttribute(), false, input); before the call, I enabled javascript and after the call I disable it again. In some pages I still get Exceptions : e.g. com.gargoylesoftware.htmlunit.ScriptException: WrappedException of com.gargoylesoftware.htmlunit.ScriptException: specified row could not be found in table The javascript seems very sensitive ---------------------------------------------------------------------- Comment By: Mike Bowler (mbowler) Date: 2003-07-17 08:57 Message: Logged In: YES user_id=46756 Try disabling javascript support and see if it still hangs. webClient.setJavaScriptEnabled(false) If it still hangs with javascript disabled then I'd guess you have a classpath problem. Make sure you don't have other versions of the jar files that ship with HtmlUnit in your classpath. If it doesn't hang when javascript is disabled then it is likely due to a javascript method/attribute that hasn't been implemented yet. In this case, we would have to selectively eliminate parts of the javascript to identify exactly what is the problem. Let me know what the results are. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=772954&group_id=47038 |
From: SourceForge.net <no...@so...> - 2003-07-18 14:02:54
|
Bugs item #757225, was opened at 2003-06-19 09:33 Message generated for change (Comment added) made by barnabycourt You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=757225&group_id=47038 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Barnaby Court (barnabycourt) Assigned to: Nobody/Anonymous (nobody) Summary: Javascript: Support changing the TYPE,ID and NAME attributes Initial Comment: Add support for changing the type of INPUT elments and the ID and NAME of all html elements through javascript. Attached is a test case for the desired functionality. ---------------------------------------------------------------------- >Comment By: Barnaby Court (barnabycourt) Date: 2003-07-18 10:02 Message: Logged In: YES user_id=591975 I have had some degree of success with this but I have found certain cases where use of with (element) {} expression in javascript causes problems. There are 2 problems with it that I have encountered. The first is with the SimpleScriptable.put(...) method. put(...) is being called on the parent scriptable object. I replaced if( htmlElement_ == null ) { super.put(name, start, newValue); return; } with if( htmlElement_ == null ) { super.put(name, start, newValue); if (start != null && start != this) { start.put(name, start, newValue); } return; } and that appeared to fix half the problems. The 2nd is with the SimplScriptable.setName(...) method. The "bound" variable is null and the variable found was incorrect. I am still working on finding a solution for this problem. The test case I used for this is the following: public void testId() throws Exception { final String content = "<html><head><title>foo</title><script>" + "var testElement1 = document.createElement( 'INPUT' );" + "testElement1.id = 'testID1';" + "alert(testElement1.id);" + "var testElement2 = document.createElement( 'INPUT' );" + "with (testElement2) {id = 'testID2';}" + "alert(testElement2.id);" + "</script></head><body>" + "<p>hello world</p>" + "</body></html>"; final List collectedAlerts = new ArrayList(); final HtmlPage page = loadPage(content, collectedAlerts); assertEquals("foo", page.getTitleText()); final List expectedAlerts = Arrays.asList( new String[]{ "testID1","testID2" }); assertEquals( expectedAlerts, collectedAlerts ); } ---------------------------------------------------------------------- Comment By: Mike Bowler (mbowler) Date: 2003-07-18 09:33 Message: Logged In: YES user_id=46756 I seem to recall discussing this one with you via private email but I don't have those emails with me (different machine) and my memory is failing. Can you post a summary of where this bug stands right now? As I recall you were investigating why some elements weren't being initialized correctly. ---------------------------------------------------------------------- Comment By: Barnaby Court (barnabycourt) Date: 2003-06-20 09:21 Message: Logged In: YES user_id=591975 Tha attached patch adds the methods needed to support this functionality. For some reason not all the methods are getting called. Perhaps someone could take a look at the patch and see why. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=757225&group_id=47038 |
From: SourceForge.net <no...@so...> - 2003-07-18 13:44:59
|
Bugs item #772954, was opened at 2003-07-17 12:46 Message generated for change (Comment added) made by tuple You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=772954&group_id=47038 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jacky (tuple) Assigned to: Nobody/Anonymous (nobody) Summary: HTML unit hangs Initial Comment: Executing final WebClient webClient = new WebClient(); final URL url = new URL (applicationURL); final HtmlPage page = (HtmlPage) webClient.getPage(url); makes HTML unit hang. He's in an infinte loop in WebClient getPage Any idea ? Tx Dirk dir...@po... ---------------------------------------------------------------------- >Comment By: Jacky (tuple) Date: 2003-07-18 13:44 Message: Logged In: YES user_id=818234 The basic problem was a classpath problem. This stops the hanging. Now I can go to some pages, others gives me javascript exceptions. If I disable javascript, I can no longer simulate my buttons-clicks because in the onClick there's javascript. So I tried page.executeJavaScriptIfPossible(onClick, input.getNameAttribute(), false, input); before the call, I enabled javascript and after the call I disable it again. In some pages I still get Exceptions : e.g. com.gargoylesoftware.htmlunit.ScriptException: WrappedException of com.gargoylesoftware.htmlunit.ScriptException: specified row could not be found in table The javascript seems very sensitive ---------------------------------------------------------------------- Comment By: Mike Bowler (mbowler) Date: 2003-07-17 12:57 Message: Logged In: YES user_id=46756 Try disabling javascript support and see if it still hangs. webClient.setJavaScriptEnabled(false) If it still hangs with javascript disabled then I'd guess you have a classpath problem. Make sure you don't have other versions of the jar files that ship with HtmlUnit in your classpath. If it doesn't hang when javascript is disabled then it is likely due to a javascript method/attribute that hasn't been implemented yet. In this case, we would have to selectively eliminate parts of the javascript to identify exactly what is the problem. Let me know what the results are. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=772954&group_id=47038 |
From: SourceForge.net <no...@so...> - 2003-07-18 13:33:05
|
Bugs item #757225, was opened at 2003-06-19 09:33 Message generated for change (Comment added) made by mbowler You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=757225&group_id=47038 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Barnaby Court (barnabycourt) Assigned to: Nobody/Anonymous (nobody) Summary: Javascript: Support changing the TYPE,ID and NAME attributes Initial Comment: Add support for changing the type of INPUT elments and the ID and NAME of all html elements through javascript. Attached is a test case for the desired functionality. ---------------------------------------------------------------------- >Comment By: Mike Bowler (mbowler) Date: 2003-07-18 09:33 Message: Logged In: YES user_id=46756 I seem to recall discussing this one with you via private email but I don't have those emails with me (different machine) and my memory is failing. Can you post a summary of where this bug stands right now? As I recall you were investigating why some elements weren't being initialized correctly. ---------------------------------------------------------------------- Comment By: Barnaby Court (barnabycourt) Date: 2003-06-20 09:21 Message: Logged In: YES user_id=591975 Tha attached patch adds the methods needed to support this functionality. For some reason not all the methods are getting called. Perhaps someone could take a look at the patch and see why. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=757225&group_id=47038 |
From: <no...@us...> - 2003-07-18 13:09:59
|
Log Message: ----------- Removed unused variable Modified Files: -------------- /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host: WindowTest.java Revision Data ------------- Index: WindowTest.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/WindowTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- WindowTest.java 18 Jul 2003 13:01:06 -0000 1.4 +++ WindowTest.java 18 Jul 2003 13:09:58 -0000 1.5 @@ -461,8 +461,8 @@ new URL("http://first"), firstContent, 200, "OK", "text/html", Collections.EMPTY_LIST ); webClient.setWebConnection( webConnection ); - final HtmlPage firstPage = ( HtmlPage )webClient.getPage( - new URL( "http://first" ), SubmitMethod.POST, Collections.EMPTY_LIST ); + webClient.getPage( + new URL( "http://first" ), SubmitMethod.POST, Collections.EMPTY_LIST ); final int waitTime = 50; final int maxTime = 1000; |
From: SourceForge.net <no...@so...> - 2003-07-18 13:04:19
|
Bugs item #675597, was opened at 2003-01-27 13:16 Message generated for change (Comment added) made by mbowler You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=675597&group_id=47038 Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Mike Bresnahan (gudujarlson) Assigned to: Mike Bowler (mbowler) Summary: window.setTimeout not defined Initial Comment: It appears window.setTimeout() has not been implemented in HtmlUnit 1.1. See the following HTML and stacktrace. <html> <body> <script language="JavaScript"> window.setTimeout('alert("Yo!")',0); </script> </body> </html> com.gargoylesoftware.htmlunit.ScriptException: undefined is not a function. at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngin e.execute(JavaScriptEngine.java:162) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeS criptTagsIfNeeded(HtmlPage.java:748) at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize (HtmlPage.java:102) at com.gargoylesoftware.htmlunit.WebClient.getPage (WebClient.java:359) at com.gargoylesoftware.htmlunit.WebClient.getPage (WebClient.java:238) at com.gargoylesoftware.htmlunit.WebClient.getPage (WebClient.java:180) at Test.main(Test.java:16) I've done some research on the topic and it appears that Rhino does not support the function and that it is up to Rhino's container to handle it. Note that the page works fine in IE 5.5 and Netscape 4.7. ---------------------------------------------------------------------- >Comment By: Mike Bowler (mbowler) Date: 2003-07-18 09:04 Message: Logged In: YES user_id=46756 Fixed. ---------------------------------------------------------------------- Comment By: Brad Clarke (yourgod) Date: 2003-02-19 13:42 Message: Logged In: YES user_id=257129 We're having the same problem. Has there been any progress on this? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=675597&group_id=47038 |
From: <no...@us...> - 2003-07-18 13:04:14
|
Log Message: ----------- Upgraded the rhino javascript engine to 1.5R4.1 Modified Files: -------------- /cvsroot/htmlunit/htmlunit/src/xdocs: changes.xml /cvsroot/htmlunit/htmlunit/dist/lib: js.jar /cvsroot/htmlunit/htmlunit: project.xml Revision Data ------------- Index: changes.xml =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/xdocs/changes.xml,v retrieving revision 1.115 retrieving revision 1.116 diff -u -d -r1.115 -r1.116 --- changes.xml 18 Jul 2003 13:01:06 -0000 1.115 +++ changes.xml 18 Jul 2003 13:04:10 -0000 1.116 @@ -136,6 +136,12 @@ <action type="new" dev="mbowler" id="675597"> Added support for the javascript method Window.setTimeout() </action> + <action type="update" dev="mbowler"> + Upgraded the rhino engine to 1.5R4.1 + </action> + <action type="update" dev="mbowler"> + Upgraded the xerces to 2.4 + </action> </release> </body> Index: js.jar =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/dist/lib/js.jar,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 Binary files /tmp/cvswt5GZC and /tmp/cvsycLcb9 differ Index: project.xml =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/project.xml,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- project.xml 3 Jul 2003 19:29:51 -0000 1.23 +++ project.xml 18 Jul 2003 13:04:11 -0000 1.24 @@ -206,10 +206,10 @@ </properties> </dependency> <dependency> - <id>rhino</id> - <version>1.5R4-RC3</version> + <groupId>rhino</groupId> + <artifactId>js</artifactId> + <version>1.5R4.1</version> <url>http://www.mozilla.org/rhino</url> - <jar>js-1.5R4-RC3.jar</jar> <properties> <htmlunit.group>optional</htmlunit.group> <htmlunit.description>Needed for javascript support</htmlunit.description> @@ -237,7 +237,7 @@ </dependency> <dependency> <id>nekohtml</id> - <version>0.7.6</version> + <version>0.7.7</version> <properties> <htmlunit.group>required</htmlunit.group> <htmlunit.description>Converts html into an XML DOM model</htmlunit.description> |
From: <no...@us...> - 2003-07-18 13:01:09
|
Log Message: ----------- Added support for Window.setTimeout() Modified Files: -------------- /cvsroot/htmlunit/htmlunit/src/xdocs: changes.xml /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/javascript/host: Window.java /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host: WindowTest.java Revision Data ------------- Index: changes.xml =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/xdocs/changes.xml,v retrieving revision 1.114 retrieving revision 1.115 diff -u -d -r1.114 -r1.115 --- changes.xml 16 Jul 2003 20:11:20 -0000 1.114 +++ changes.xml 18 Jul 2003 13:01:06 -0000 1.115 @@ -133,6 +133,9 @@ <action type="new" dev="mbowler"> Added read-only support for Document.cookie. </action> + <action type="new" dev="mbowler" id="675597"> + Added support for the javascript method Window.setTimeout() + </action> </release> </body> Index: Window.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- Window.java 4 Jul 2003 15:21:02 -0000 1.21 +++ Window.java 18 Jul 2003 13:01:06 -0000 1.22 @@ -217,9 +217,6 @@ */ public static Object jsFunction_setTimeout( final Context context, final Scriptable scriptable, final Object[] args, final Function function ) { - ((Window)scriptable).getLog().debug( "Window.setTimeout() not implemented" ); - return NOT_FOUND; -/* commented out for now as this doesn't work - come back to it later final String script = getStringArg(0, args, null); final int timeout = getIntArg(1, args, 0); @@ -229,17 +226,23 @@ try { Thread.sleep(timeout); + // Register this thread with the rhino engine + Context.enter(); final HtmlPage htmlPage = window.document_.getHtmlPage(); - htmlPage.executeJavaScriptIfPossible(script, "Window.setTimeout()", true, null); + htmlPage.executeJavaScriptIfPossible( + script, "Window.setTimeout()", true, htmlPage); } catch( final Exception e ) { window.getLog().error("Caught exception in Window.setTimeout()", e); } + finally { + // Deregister this thread with the rhino engine + Context.exit(); + } } }; new Thread(runnable).start(); return null; -*/ } Index: WindowTest.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/WindowTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- WindowTest.java 4 Jul 2003 15:21:02 -0000 1.3 +++ WindowTest.java 18 Jul 2003 13:01:06 -0000 1.4 @@ -447,10 +447,6 @@ public void testSetTimeout() throws Exception { - if(true) { - notImplemented(); - return; - } final WebClient webClient = new WebClient(); final FakeWebConnection webConnection = new FakeWebConnection( webClient ); final List collectedAlerts = Collections.synchronizedList(new ArrayList()); @@ -458,7 +454,7 @@ webClient.setAlertHandler(new CollectingAlertHandler(collectedAlerts)); final String firstContent - = "<html><body><script language='JavaScript'>window.setTimeout('alert(\"Yo!\")',0);" + = "<html><body><script language='JavaScript'>window.setTimeout('alert(\"Yo!\")',1);" + "</script></body></html>"; webConnection.setResponse( |
From: SourceForge.net <no...@so...> - 2003-07-18 10:59:43
|
Feature Requests item #773552, was opened at 2003-07-18 11:59 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448269&aid=773552&group_id=47038 Category: None Group: None Status: Open Priority: 5 Submitted By: Robert Wittams (rjwittams) Assigned to: Nobody/Anonymous (nobody) Summary: Support proxy better - use http client more Initial Comment: Use http clients abilities more. The proxy server and credential apis are too simple. Eg NTLM auth, etc. Why not expose the HttpClient credential api? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448269&aid=773552&group_id=47038 |
From: SourceForge.net <no...@so...> - 2003-07-17 12:57:32
|
Bugs item #772954, was opened at 2003-07-17 08:46 Message generated for change (Comment added) made by mbowler You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=772954&group_id=47038 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jacky (tuple) Assigned to: Nobody/Anonymous (nobody) Summary: HTML unit hangs Initial Comment: Executing final WebClient webClient = new WebClient(); final URL url = new URL (applicationURL); final HtmlPage page = (HtmlPage) webClient.getPage(url); makes HTML unit hang. He's in an infinte loop in WebClient getPage Any idea ? Tx Dirk dir...@po... ---------------------------------------------------------------------- >Comment By: Mike Bowler (mbowler) Date: 2003-07-17 08:57 Message: Logged In: YES user_id=46756 Try disabling javascript support and see if it still hangs. webClient.setJavaScriptEnabled(false) If it still hangs with javascript disabled then I'd guess you have a classpath problem. Make sure you don't have other versions of the jar files that ship with HtmlUnit in your classpath. If it doesn't hang when javascript is disabled then it is likely due to a javascript method/attribute that hasn't been implemented yet. In this case, we would have to selectively eliminate parts of the javascript to identify exactly what is the problem. Let me know what the results are. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=772954&group_id=47038 |
From: SourceForge.net <no...@so...> - 2003-07-17 12:46:41
|
Bugs item #772954, was opened at 2003-07-17 12:46 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=772954&group_id=47038 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jacky (tuple) Assigned to: Nobody/Anonymous (nobody) Summary: HTML unit hangs Initial Comment: Executing final WebClient webClient = new WebClient(); final URL url = new URL (applicationURL); final HtmlPage page = (HtmlPage) webClient.getPage(url); makes HTML unit hang. He's in an infinte loop in WebClient getPage Any idea ? Tx Dirk dir...@po... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=772954&group_id=47038 |
From: SourceForge.net <no...@so...> - 2003-07-16 20:23:53
|
Bugs item #714861, was opened at 2003-04-03 14:56 Message generated for change (Comment added) made by mbowler You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=714861&group_id=47038 Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: bob neiman (ko6hi) >Assigned to: Mike Bowler (mbowler) Summary: cookie problem - null/no value returned Initial Comment: Trying the attached html, under htmlunit the cookie returns no or a null value. Have tried with latest nighly drop of http-client. http-client trace shows call to set cookie value. with alert(crumbs[0]) the result is "" with alert(crumbs[1] the result is "undefined" Works correctly under IE and Netscape. Using jdk 1.4.1_02 (sun) <html> <body> <script type="text/javascript" Language="javascript"> var expirationTime = new Date(new Date().getTime() + (10*60*1000)); document.cookie = "testcookie" + "=" + "Foo" + ";expires=" + expirationTime.toGMTString(); var cookieSet = document.cookie.split(';'); var setSize = cookieSet.length; var crumbs; var x=0; for (x=0;((x<setSize)); x++) { crumbs = cookieSet[x].split('='); alert ( crumbs[0] ); } </script> This is a test doc </body> </html> ---------------------------------------------------------------------- >Comment By: Mike Bowler (mbowler) Date: 2003-07-16 16:23 Message: Logged In: YES user_id=46756 Query support for Document.cookie has been implemented. Write support still isn't present but I'm going to close this defect for now since it deals specifically with query support. Support for modification hasn't been forgotten. ---------------------------------------------------------------------- Comment By: Mike Bowler (mbowler) Date: 2003-05-27 16:46 Message: Logged In: YES user_id=46756 This is not actually a problem with httpclient (although it has had issues with cookies). The javascript above doesn't work because the cookie attribute hasn't been implemented in HtmlUnit yet. It's on the todo list. ---------------------------------------------------------------------- Comment By: Vera Mickael (mvera) Date: 2003-05-27 12:45 Message: Logged In: YES user_id=787578 I had a little similar problem with httpclient, a patch has been produced, try build a new httpclient.jar from CVS and try again. Mickael ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=714861&group_id=47038 |
From: <no...@us...> - 2003-07-16 20:11:27
|
Log Message: ----------- Added support for reading Document.cookie. Modified Files: -------------- /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit: FakeWebConnection.java /cvsroot/htmlunit/htmlunit/src/xdocs: changes.xml /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host: DocumentTest.java /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit: WebConnection.java HttpWebConnection.java WebClient.java /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/javascript/host: Document.java Revision Data ------------- Index: FakeWebConnection.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/FakeWebConnection.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- FakeWebConnection.java 16 Jul 2003 13:33:17 -0000 1.4 +++ FakeWebConnection.java 16 Jul 2003 20:11:20 -0000 1.5 @@ -46,6 +46,8 @@ import java.util.List; import java.util.Map; +import org.apache.commons.httpclient.HttpState; + /** * A fake HttpProcessor for testing purposes only * @@ -97,7 +99,7 @@ private SubmitMethod lastMethod_; private List lastParameters_; - + private HttpState httpState_ = new HttpState(); /** * Create an instance @@ -246,6 +248,16 @@ */ public void setContent( final String content ) { setDefaultResponse(content, 200, "OK", "text/html"); + } + + + /** + * Return the {@link HttpState} that is being used for a given domain + * @param url The url from which the domain will be determined + * @return The state or null if no state can be found for this domain. + */ + public HttpState getStateForUrl( final URL url ) { + return httpState_; } } Index: changes.xml =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/xdocs/changes.xml,v retrieving revision 1.113 retrieving revision 1.114 diff -u -d -r1.113 -r1.114 --- changes.xml 4 Jul 2003 15:21:02 -0000 1.113 +++ changes.xml 16 Jul 2003 20:11:20 -0000 1.114 @@ -130,6 +130,9 @@ <action type="new" dev="mbowler"> Added support for the property Window.name </action> + <action type="new" dev="mbowler"> + Added read-only support for Document.cookie. + </action> </release> </body> Index: DocumentTest.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/DocumentTest.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- DocumentTest.java 16 Jul 2003 13:34:40 -0000 1.14 +++ DocumentTest.java 16 Jul 2003 20:11:20 -0000 1.15 @@ -51,6 +51,9 @@ import java.util.Collections; import java.util.List; +import org.apache.commons.httpclient.Cookie; +import org.apache.commons.httpclient.HttpState; + /** * Tests for Document * @@ -1030,12 +1033,15 @@ + "</script></head><body onload='doTest()'>" + "</body></html>"; - final List headers = Collections.singletonList( - new KeyValuePair("Set-Cookie", "one=two;three=four") ); + final URL url = new URL("http://first"); webConnection.setResponse( - new URL("http://first"), firstContent, 200, "OK", "text/html", headers ); + url, firstContent, 200, "OK", "text/html", Collections.EMPTY_LIST ); webClient.setWebConnection( webConnection ); + final HttpState state = webConnection.getStateForUrl(url); + state.addCookie( new Cookie("first", "one", "two") ); + state.addCookie( new Cookie("first", "three", "four") ); + final List collectedAlerts = new ArrayList(); webClient.setAlertHandler( new CollectingAlertHandler(collectedAlerts) ); Index: WebConnection.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/WebConnection.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- WebConnection.java 10 Jun 2003 11:56:56 -0000 1.6 +++ WebConnection.java 16 Jul 2003 20:11:21 -0000 1.7 @@ -42,6 +42,8 @@ import java.util.List; import java.util.Map; +import org.apache.commons.httpclient.HttpState; + /** * An object that handles the actual communication portion of page * retrieval/submission <p /> @@ -127,5 +129,13 @@ public final int getProxyPort() { return proxyPort_; } + + + /** + * Return the {@link HttpState} that is being used for a given domain + * @param url The url from which the domain will be determined + * @return The state or null if no state can be found for this domain. + */ + public abstract HttpState getStateForUrl( final URL url ); } Index: HttpWebConnection.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- HttpWebConnection.java 28 Jun 2003 17:24:28 -0000 1.11 +++ HttpWebConnection.java 16 Jul 2003 20:11:21 -0000 1.12 @@ -264,7 +264,6 @@ HttpClient client = ( HttpClient )httpClients_.get( key ); if( client == null ) { client = new HttpClient(); - client.getState().setCookiePolicy( CookiePolicy.COMPATIBILITY ); // Disable informational messages from httpclient final Log log = LogFactory.getLog("httpclient.wire"); @@ -273,17 +272,17 @@ } // Disable certificate caching within HttpClient - client.setState( - new HttpState() { - public void setCredentials( - final String realm, final Credentials credentials ) { - } - + final HttpState httpState = new HttpState() { + public void setCredentials( + final String realm, final Credentials credentials ) { + } - public Credentials getCredentials( final String realm ) { - return null; - } - } ); + public Credentials getCredentials( final String realm ) { + return null; + } + }; + client.setState(httpState); + httpState.setCookiePolicy( CookiePolicy.COMPATIBILITY ); final HostConfiguration hostConfiguration = new HostConfiguration(); final URI uri; @@ -302,7 +301,7 @@ // If two clients are part of the same domain then they should share the same // state (ie cookies) - final HttpState sharedState = getStateForDomain( url.getHost() ); + final HttpState sharedState = getStateForUrl( url ); if( sharedState != null ) { client.setState(sharedState); } @@ -312,7 +311,13 @@ } - private synchronized HttpState getStateForDomain( final String domain ) { + /** + * Return the {@link HttpState} that is being used for a given domain + * @param url The url from which the domain will be determined + * @return The state or null if no state can be found for this domain. + */ + public synchronized HttpState getStateForUrl( final URL url ) { + final String domain = url.getHost(); int index = domain.lastIndexOf('.'); if( index != -1 ) { index = domain.lastIndexOf(".", index-1); Index: WebClient.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/WebClient.java,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- WebClient.java 10 Jun 2003 11:56:56 -0000 1.44 +++ WebClient.java 16 Jul 2003 20:11:21 -0000 1.45 @@ -56,6 +56,7 @@ import java.util.Map; import java.util.Set; import java.util.StringTokenizer; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -167,11 +168,11 @@ /** - * Return the object that will resolve all url requests - * - * @return The UrlResolver + * <p>Return the object that will resolve all url requests<p> + * <p>INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK</p> + * @return The connection that will be used. */ - private WebConnection getWebConnection() { + public synchronized WebConnection getWebConnection() { if( webConnection_ == null ) { if( proxyHost_ == null ) { webConnection_ = new HttpWebConnection( this ); Index: Document.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/javascript/host/Document.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- Document.java 16 Jul 2003 13:34:41 -0000 1.22 +++ Document.java 16 Jul 2003 20:11:21 -0000 1.23 @@ -38,17 +38,22 @@ package com.gargoylesoftware.htmlunit.javascript.host; import com.gargoylesoftware.htmlunit.ElementNotFoundException; -import com.gargoylesoftware.htmlunit.WebResponse; +import com.gargoylesoftware.htmlunit.WebConnection; import com.gargoylesoftware.htmlunit.WebWindow; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlForm; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.javascript.DocumentAllArray; + +import java.net.URL; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.ListIterator; + +import org.apache.commons.httpclient.Cookie; +import org.apache.commons.httpclient.HttpState; import org.mozilla.javascript.Context; import org.mozilla.javascript.Function; import org.mozilla.javascript.NativeArray; @@ -174,14 +179,31 @@ } + private HttpState getHttpState() { + final HtmlPage htmlPage = getHtmlPage(); + final WebConnection connection = htmlPage.getWebClient().getWebConnection(); + final URL url = htmlPage.getWebResponse().getUrl(); + + return connection.getStateForUrl( url ); + } /** * Return the cookie attribute. Currently hardcoded to return an empty string * @return The cookie attribute */ public String jsGet_cookie() { - getLog().debug("Document.cookie not supported: returning empty string"); - final WebResponse webResponse = ((HtmlPage)getHtmlElementOrDie()).getWebResponse(); - return webResponse.getResponseHeaderValue("Set-Cookie"); + final HttpState state = getHttpState(); + final Cookie[] cookies = state.getCookies(); + final StringBuffer buffer = new StringBuffer(); + + for( int i=0; i<cookies.length; i++ ) { + if( i != 0 ) { + buffer.append(";"); + } + buffer.append( cookies[i].getName() ); + buffer.append( "=" ); + buffer.append( cookies[i].getValue() ); + } + return buffer.toString(); } |
From: <no...@us...> - 2003-07-16 13:34:44
|
Log Message: ----------- First cut at cookie support. Only reading is supported and even then it only works if the cookie was actually sent in the same request that got the page. If the cookie had been set on an earlier request then the values won't be visible here. Modified Files: -------------- /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host: DocumentTest.java /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/javascript/host: Document.java Revision Data ------------- Index: DocumentTest.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/DocumentTest.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- DocumentTest.java 10 Jun 2003 11:57:01 -0000 1.13 +++ DocumentTest.java 16 Jul 2003 13:34:40 -0000 1.14 @@ -1008,4 +1008,42 @@ "a", "b"} ); assertEquals( expectedAlerts, collectedAlerts ); } + + + public void testCookie_read() throws Exception { + final WebClient webClient = new WebClient(); + final FakeWebConnection webConnection = new FakeWebConnection( webClient ); + + final String firstContent + = "<html><head><title>First</title><script>" + + "function doTest() {\n" + + " var cookieSet = document.cookie.split(';');\n" + + " var setSize = cookieSet.length;\n" + + " var crumbs;\n" + + " var x=0;\n" + + " for (x=0;((x<setSize)); x++) {\n" + + " crumbs = cookieSet[x].split('=');\n" + + " alert ( crumbs[0] );\n" + + " alert ( crumbs[1] );\n" + + " } \n" + + "}\n" + + "</script></head><body onload='doTest()'>" + + "</body></html>"; + + final List headers = Collections.singletonList( + new KeyValuePair("Set-Cookie", "one=two;three=four") ); + webConnection.setResponse( + new URL("http://first"), firstContent, 200, "OK", "text/html", headers ); + webClient.setWebConnection( webConnection ); + + final List collectedAlerts = new ArrayList(); + webClient.setAlertHandler( new CollectingAlertHandler(collectedAlerts) ); + + final HtmlPage firstPage = ( HtmlPage )webClient.getPage( new URL( "http://first" ) ); + assertEquals( "First", firstPage.getTitleText() ); + + final List expectedAlerts = Arrays.asList( new String[] { + "one", "two", "three", "four"} ); + assertEquals( expectedAlerts, collectedAlerts ); + } } Index: Document.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/javascript/host/Document.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- Document.java 10 Jun 2003 11:56:59 -0000 1.21 +++ Document.java 16 Jul 2003 13:34:41 -0000 1.22 @@ -38,6 +38,7 @@ package com.gargoylesoftware.htmlunit.javascript.host; import com.gargoylesoftware.htmlunit.ElementNotFoundException; +import com.gargoylesoftware.htmlunit.WebResponse; import com.gargoylesoftware.htmlunit.WebWindow; import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlForm; @@ -179,7 +180,8 @@ */ public String jsGet_cookie() { getLog().debug("Document.cookie not supported: returning empty string"); - return ""; + final WebResponse webResponse = ((HtmlPage)getHtmlElementOrDie()).getWebResponse(); + return webResponse.getResponseHeaderValue("Set-Cookie"); } |
From: <no...@us...> - 2003-07-16 13:33:19
|
Log Message: ----------- Better javadoc and improved parameter checking Modified Files: -------------- /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit: FakeWebConnection.java Revision Data ------------- Index: FakeWebConnection.java =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/FakeWebConnection.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- FakeWebConnection.java 10 Jun 2003 11:57:00 -0000 1.3 +++ FakeWebConnection.java 16 Jul 2003 13:33:17 -0000 1.4 @@ -67,6 +67,17 @@ Assert.notNull("contentType", contentType); Assert.notNull("responseHeaders", responseHeaders); + // Validate that the response header list only contains KeyValuePairs + final Iterator iterator = responseHeaders.iterator(); + while( iterator.hasNext() ) { + final Object object = iterator.next(); + if( object instanceof KeyValuePair == false ) { + throw new IllegalArgumentException( + "Only KeyValuePairs may be in the response header list but found: " + + object.getClass().getName()); + } + } + content_ = content; statusCode_ = statusCode; statusMessage_ = statusMessage; @@ -184,6 +195,16 @@ } + /** + * Set the response that will be returned when the specified url is requested. + * @param url The url that will return the given response + * @param content The content to return + * @param statusCode The status code to return + * @param statusMessage The status message to return + * @param contentType The content type to return + * @param responseHeaders A list of {@KeyValuePair}s that will be returned as + * response headers. + */ public void setResponse( final URL url, final String content, @@ -199,6 +220,15 @@ } + /** + * Set the response that will be returned when a url is requested that does + * not have a specific content set for it. + * + * @param content The content to return + * @param statusCode The status code to return + * @param statusMessage The status message to return + * @param contentType The content type to return + */ public void setDefaultResponse( final String content, final int statusCode, |
From: Mike B. <mb...@Ga...> - 2003-07-16 12:32:00
|
th...@cy... wrote: > concerning the mail I send yesterday about the iframe problem. I was not > able to have a look at the traffic with a sniffer. All I could do was to > look at what happens in our app (by viewing debug output) and it just > points to the fact, that no cookie information is send by HtmlUnit as it > is by a browser. > > Unfortunately I can't send you our app or something to reproduce this. > But I'd like to test it without cookie support. So how can I disable the > cookie-support? I couldn't find any hint about that in API > documentation. Did I miss something? There is presently no way to disable the cookie support from HtmlUnit itself although support for that should probably be added in order to simulate browsers that don't have cookies enabled. For that matter, there isn't a way to disable cookie support in commons-httpclient either. Most likely the easiest way would be to create a new CookiePolicy that just ignored all incoming cookies. I've created a new feature request for this: http://sourceforge.net/tracker/index.php?func=detail&aid=772261&group_id=47038&atid=448269 -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |