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: <Mik...@su...> - 2003-02-19 19:03:39
|
FYI: The commons-httpclient.jar that comes with HtmlUnit 1.1 (final) causes some of my test cases to fail because the client sends blank strings in all request parameter values. Switching back to the jar that came with 1.1.-pre5 eliminates the problem. I haven't isolated the problem more than this. Mike Bresnahan |
From: <Mik...@su...> - 2003-02-19 18:35:40
|
> > Assuming there is not, one simple way to partially solve > > the problem is to add the following function to HtmlPage: > Take a look at page.getWebResponse().getUrl() and see if that does what > you need (for GET requests anyway). That works! > > However, this will only work for pages that are a result of a HTTP Get > > requests. It will work for pages that were a result of a Post request, > > because the URL will not contain the request parameters. > Right, the WebResponse doesn't currently retain the request parameters > which is what you'd need for a proper refresh. > At a minimum the WebResponse would have to change to retain the > parameters that were originally used and the request type > (GET/POST/etc). Then Page could additionally have a reload() method (I > want to avoid the word "refresh" as that implies updating the current > object and I'd want to return a new one). > Would this do everything you need? Yes I believe so. Note that I actually only need support for GET's currently. Mike Bresnahan |
From: Mike B. <mb...@Ga...> - 2003-02-19 18:17:37
|
Mik...@su... wrote: > I have a need to simulate the browser refresh button. I.e. I want to > reload a page. I don't see a direct way to do this in HtmlUnit 1.1. > Is there something that I am not seeing? No, you aren't overlooking anything. There is no direct support for simulating the refresh button. > Assuming there is not, one simple way to partially solve > the problem is to add the following function to HtmlPage: Take a look at page.getWebResponse().getUrl() and see if that does what you need (for GET requests anyway). > However, this will only work for pages that are a result of a HTTP Get > requests. It will work for pages that were a result of a Post request, > because the URL will not contain the request parameters. Right, the WebResponse doesn't currently retain the request parameters which is what you'd need for a proper refresh. At a minimum the WebResponse would have to change to retain the parameters that were originally used and the request type (GET/POST/etc). Then Page could additionally have a reload() method (I want to avoid the word "refresh" as that implies updating the current object and I'd want to return a new one). Would this do everything you need? -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: <Mik...@su...> - 2003-02-19 17:41:13
|
I have a need to simulate the browser refresh button. I.e. I want to reload a page. I don't see a direct way to do this in HtmlUnit 1.1. Is there something that I am not seeing? Assuming there is not, one simple way to partially solve the problem is to add the following function to HtmlPage: /** * Return the url that was used to load this page * * @return See above */ public URL getUrl() { return originatingUrl_; } However, this will only work for pages that are a result of a HTTP Get requests. It will work for pages that were a result of a Post request, because the URL will not contain the request parameters. Therefore a more complex solution is needed to solve the problem entirely. Thoughts? Mike Bresnahan |
From: Mike B. <mb...@Ga...> - 2003-02-13 14:18:42
|
> "Automated testing of web applications" <snip> > How do you > test all the stuff, HtmlUnit simply can't cover? Let me turn the question back to you. If you are building a web application and you have code that cannot be executed by a request from a web browser then why is that code there? I'm not suggesting that you should do all your testing from the outside of the servlet container with a tool like HtmlUnit, I'm just questioning your assumptions. Why would you assume that your typical webapp would have code that *cannot* be tested from the outside? I say "like HtmlUnit" because this is really a question about testing a webapp from the outside of the servlet container by simulating a browser. There are lots of tools that can perform this kind of testing. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: glopez <gl...@is...> - 2003-02-13 12:45:00
|
Hi Thomas, > My question is, how to integrate HtmlUnit in test environment. How do > you use HtmlUnit? Right now we are about to integrate htmlunit tests to the jar creation process ( using ant ) as a means of regression testing the development of a jsp custom taglib library. The idea is that every time a jar is created it is automatically tested against a number of pages designed for that matter. I hope this helps you, regards Gabriel Lopez, Montevideo, Uruguay ----- Original Message ----- From: <th...@cy...> To: <htm...@li...> Sent: Thursday, February 13, 2003 8:50 AM Subject: [HtmlUnit] How to test with HtmlUnit? > Hi everybody, > > this time I have a question addressed not only to Mike, but to all of > you who work with HtmlUnit. I going to write my thesis about "Automated > testing of web applications" and HtmlUnit seems to be the tool of choice > for this purpose. > > My question is, how to integrate HtmlUnit in test environment. How do > you use HtmlUnit? What kind of class modell did you develop? How do you > test all the stuff, HtmlUnit simply can't cover? > > I don't ask for company secrets or full detailed papers, in fact I'd > like to get an overview about the possible existing general approaches. > I very much appreciate every piece of information everyone of you can > provide. Maybe discussion this topic in the list can be helpful for > every tester subscribed here. > > And of course references to other documentation are welcome, too :) > > kind regards > Thomas Bartz > Berlin, Germany |
From: <th...@cy...> - 2003-02-13 11:50:57
|
Hi everybody, this time I have a question addressed not only to Mike, but to all of you who work with HtmlUnit. I going to write my thesis about "Automated testing of web applications" and HtmlUnit seems to be the tool of choice for this purpose. My question is, how to integrate HtmlUnit in test environment. How do you use HtmlUnit? What kind of class modell did you develop? How do you test all the stuff, HtmlUnit simply can't cover? I don't ask for company secrets or full detailed papers, in fact I'd like to get an overview about the possible existing general approaches. I very much appreciate every piece of information everyone of you can provide. Maybe discussion this topic in the list can be helpful for every tester subscribed here. And of course references to other documentation are welcome, too :) kind regards Thomas Bartz Berlin, Germany |
From: <gl...@is...> - 2003-02-08 22:39:52
|
Welcome to the Htm...@li... mailing list! To post to this list, send your email to: htm...@li... |
From: Mike B. <mb...@Ga...> - 2003-02-04 16:55:39
|
> However, I think HtmlUnit has a problem, if there are upper case > attributes in the input-element. In my example code a button like > <input type=SUBMIT .. > didn't work and behaved like described above, > while HtmlUnit accepted a button like <input type=submit ..> and > behaved correctly. Please open a bug report for this so it doesn't get lost. It certainly should work whether the type value is lowercase or not. > Will there be a patch package available soon or do I have to work with > cvs builds? I'd like to get a new release out as soon as I get the document.write support finished and some of the remaining bugs fixed but I'm not sure how much longer that is going to take. Your safest bet is to use what's in CVS. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: <th...@cy...> - 2003-02-04 11:23:28
|
Hi Mike, as I have written earlier, I have the following problem with HtmlUnit. If I have a form with more than one submit-button, HtmlUnit seems to send all buttons and their values in the post request. Our web application decides what to do after such a request, by checking, if a certain button was send or not. So, if the cancel button is send, it thinks, cancel was pressed, even if the ok button was send also. I had the problem with HtmlUnit 1.1 pre5 and I have that problem still with HtmlUnit 1.1 final with up to date commons httpclient (commons-httpclient-2.0-alpha2). Some weeks ago I have examined the whole problem a little bit closer and send you an mail. Unfortunately I sent it to the wrong address it seems, since it never reached the list. However, I think HtmlUnit has a problem, if there are upper case attributes in the input-element. In my example code a button like <input type=SUBMIT .. > didn't work and behaved like described above, while HtmlUnit accepted a button like <input type=submit ..> and behaved correctly. Would be nice if you could fix this, since its a nasty piece of work to go through our application and change everything (even though upper case html-code is not xhtml-conform). Will there be a patch package available soon or do I have to work with cvs builds? At least it would be cool, to have a package with the up to date commons http client included. You would prevent people from running into that HTTP/1.1 problem. Kind regards from Germany, Thomas Bartz |
From: <Mik...@su...> - 2003-01-27 18:06:36
|
I suspect implementing window.setTimeout() would require some changes also, due to its asynchronous nature. Mike Bresnahan |---------+--------------------------------------------> | | Mike Bowler | | | <mb...@Ga...> | | | Sent by: | | | htm...@li...ur| | | ceforge.net | | | | | | | | | 01/27/2003 11:58 AM | | | | |---------+--------------------------------------------> >--------------------------------------------------------------------------------------------------------------| | | | To: htm...@li... | | cc: | | Subject: Re: [HtmlUnit] window.setTimeout not defined | >--------------------------------------------------------------------------------------------------------------| > It appears window.setTimeout() has not been implemented in > HtmlUnit 1.1. Please open a bug for this so it doesn't get lost. I'm in the middle of a battle with document.write() and I don't want to lose any other requests. Implementing document.write() is requiring some significant changes to the way pages are loaded btw. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ HtmlUnit-develop mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-develop |
From: Mike B. <mb...@Ga...> - 2003-01-27 18:02:12
|
> It appears window.setTimeout() has not been implemented in > HtmlUnit 1.1. Please open a bug for this so it doesn't get lost. I'm in the middle of a battle with document.write() and I don't want to lose any other requests. Implementing document.write() is requiring some significant changes to the way pages are loaded btw. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: <Mik...@su...> - 2003-01-27 17:42:07
|
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.JavaScriptEngine.execute(JavaScriptEngine.java:162) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeScriptTagsIfNeeded(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. Mike Bresnahan |
From: <Mik...@su...> - 2003-01-10 18:17:17
|
Netscape and Rhino require that you prefix all form names with "document.". For example: document.myForm.myText.value = s1.toUpperCase() Mike Bresnahan |
From: Mike B. <mb...@Ga...> - 2003-01-10 18:04:22
|
Hi Mark, > An exception is thrown when an onLoad handler a form. Are there plans > to change this in a future release? The problem isn't with the onload handler. It's complaining because the variable "myForm" in the following line isn't defined. myForm.myText.value = s1.toUpperCase() I tried your sample with Mozilla and it also complained about "myForm" not being defined. Internet Explorer seemed to like it which makes me think that this is IE specific behaviour. I did a quick search to see who supports this behaviour but I can't actually find it documented anywhere. I would recommend that you use portable ways of accessing the form but if this way is important to you then please open a feature request. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com DEMATTEIS, MARK S [AG-Contractor/1000] wrote: > An exception is thrown when an onLoad handler a form. Are there plans to > change this in a future release? > >Exception >--------------- >Exception in thread "main" com.gargoylesoftware.htmlunit.ScriptException: >"myForm" is not defined. > at >com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScript >Engine.java:162) > at >com.gargoylesoftware.htmlunit.html.HtmlPage.executeScriptTagsIfNeeded(HtmlPa >ge.java:748) > at >com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:102) > at >com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:318) > at >com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:238) > at >com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:180) > at Test.testOnload(Test.java:37) > at Test.execute(Test.java:29) > at Test.main(Test.java:18) > >Code: >------------------------- > void testOnload() throws java.net.MalformedURLException, >java.io.IOException > { > String myUrl = "http://localhost:/page4.html"; > WebClient webClient = new WebClient(); > HtmlPage page = (HtmlPage) webClient.getPage(new URL(myUrl)); > } > >HTML Page >---------------------- > ><html> ><head> ><title>Fourth Page</title> ></head> > ><body onload = "changeValue()" > ><form action="" method="POST" id="myForm" > ><input type="text" name="myText" > > ><script type="text/javascript" language="JavaScript"> >s1 = new String(myForm.myText.value) > >function changeValue() { > s1 = "Hello!" > myForm.myText.value = s1.toUpperCase() >} > ></script> ></form> ></body> ></html> > >Mark Dematteis > > >------------------------------------------------------- >This SF.NET email is sponsored by: >SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! >http://www.vasoftware.com >_______________________________________________ >HtmlUnit-develop mailing list >Htm...@li... >https://lists.sourceforge.net/lists/listinfo/htmlunit-develop > > > |
From: DEMATTEIS, M. S [AG-Contractor/1000]
<mar...@mo...> - 2003-01-10 17:42:57
|
Please substitute this for my previous e-mail on the subject. > -----Original Message----- > From: DEMATTEIS, MARK S [AG-Contractor/1000] > Sent: Friday, January 10, 2003 11:30 AM > To: 'htm...@li...' > Subject: onLoad Exception > > An exception is thrown when an onLoad handler accesses a form. Are there > plans to change this in a future release? > > Exception > --------------- > Exception in thread "main" com.gargoylesoftware.htmlunit.ScriptException: > "myForm" is not defined. > at > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScri > ptEngine.java:162) > at > com.gargoylesoftware.htmlunit.html.HtmlPage.executeScriptTagsIfNeeded(Html > Page.java:748) > at > com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:102) > at > com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:318) > at > com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:238) > at > com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:180) > at Test.testOnload(Test.java:37) > at Test.execute(Test.java:29) > at Test.main(Test.java:18) > > Code: > ------------------------- > void testOnload() throws java.net.MalformedURLException, > java.io.IOException > { > String myUrl = "http://localhost:/page4.html"; > WebClient webClient = new WebClient(); > HtmlPage page = (HtmlPage) webClient.getPage(new URL(myUrl)); > } > > HTML Page > ---------------------- > > <html> > <head> > <title>Fourth Page</title> > </head> > > <body onload = "changeValue()" > > <form action="" method="POST" id="myForm" > > <input type="text" name="myText" > > > <script type="text/javascript" language="JavaScript"> > s1 = new String(myForm.myText.value) > > function changeValue() { > s1 = "Hello!" > myForm.myText.value = s1.toUpperCase() > } > > </script> > </form> > </body> > </html> > > Mark Dematteis |
From: DEMATTEIS, M. S [AG-Contractor/1000]
<mar...@mo...> - 2003-01-10 17:29:54
|
An exception is thrown when an onLoad handler a form. Are there plans to change this in a future release? Exception --------------- Exception in thread "main" com.gargoylesoftware.htmlunit.ScriptException: "myForm" is not defined. at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScript Engine.java:162) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeScriptTagsIfNeeded(HtmlPa ge.java:748) at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:102) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:318) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:238) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:180) at Test.testOnload(Test.java:37) at Test.execute(Test.java:29) at Test.main(Test.java:18) Code: ------------------------- void testOnload() throws java.net.MalformedURLException, java.io.IOException { String myUrl = "http://localhost:/page4.html"; WebClient webClient = new WebClient(); HtmlPage page = (HtmlPage) webClient.getPage(new URL(myUrl)); } HTML Page ---------------------- <html> <head> <title>Fourth Page</title> </head> <body onload = "changeValue()" > <form action="" method="POST" id="myForm" > <input type="text" name="myText" > <script type="text/javascript" language="JavaScript"> s1 = new String(myForm.myText.value) function changeValue() { s1 = "Hello!" myForm.myText.value = s1.toUpperCase() } </script> </form> </body> </html> Mark Dematteis |
From: Mike B. <mb...@Ga...> - 2002-12-18 18:30:05
|
> However, both the "gump" and 20021204 versions do not seem to > properly handle WebResponse.getContentAsString() like the version > included with HtmlUnit-1.1-pre5. Currently I let commons-httpclient do the conversion into a string but there has been talk of removing this functionality so I'll have to start handling it inside HtmlUnit. If the latest version of commons-httpclient has broken this stuff then I'll have to start handling it sooner than I'd expected. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: DEMATTEIS, M. S [AG-Contractor/1000]
<mar...@mo...> - 2002-12-18 17:33:20
|
Mike, first let me say I think you're doing a great job with HtmlUnit. After creating a "sandbox" to test my problems outside of my normal development environment, I determined that the real problem I am experiencing using the "gump" build of commons-httpclient.jar is that text input fileds set programatically using HtmlInput.setValueAttribute() are not being received on the server end when the form is submitted. I verified this with a servlet that extracts the request parameters. The parameters are being received, but the values are empty. I downloaded the latest version of commons-httpclient.jar (commons-httpclient-20021204.zip) and the problem was solved. However, both the "gump" and 20021204 versions do not seem to properly handle WebResponse.getContentAsString() like the version included with HtmlUnit-1.1-pre5. My tests revealed the following results: - pre5 creates a viewable HTML page containing the contents of page1.html as expected. - gump creates an empty file. - 20021204 creates a file containing the word "null" Here's the HTML: ----------------------------- <html> <head> <title>First Page</title> </head> <body> <h1>page1</h1> <form name=myform method="post" action="page2.html"> <input type=text name="city" maxlength="30">City <br><br> <select name="state" size="1"> <option value=""> <option value="AL">AL <option value="AK">AK </select> <br><br> <input type=submit value="Submit"> </form> <a href="page2.html">Page 2</a> <br><br> <hr> </body> </html> Here's the code: ------------------------ void testWritePageContentsToFile() throws java.io.IOException { String myUrl = "http://localhost:/page1.html"; WebClient webClient = new WebClient(); HtmlPage page = (HtmlPage) webClient.getPage(new URL(myUrl)); FileOutputStream fout; try { // Open an output stream fout = new FileOutputStream ("c:/sandbox/out.html"); // Print a line of text PrintStream psout = new PrintStream(fout); psout.println (page.getWebResponse().getContentAsString()); // Close our output stream fout.close(); } // Catches any error conditions catch (IOException e) { System.err.println ("Unable to write to file"); System.exit(-1); } } Mark Dematteis |
From: Mike B. <mb...@Ga...> - 2002-12-17 02:07:55
|
Hi Mike, Yup, that's a fairly serious bug. I'm not going to have time to look at it tonight but I'll work on it tomorrow. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: <Mik...@su...> - 2002-12-16 22:18:54
|
In HtmlUnit 1.1 the default behavior of HtmlInput.click() is to submit the enclosing form when there is no onclick event handler. That is incorrect behavior for all types of input elements except type="submit". Since HtmlCheckBox.click() simply calls the same function in the superclass, it behaves incorrectly. Mike -- begin snipet from HtmlInput.java -- /** * Submit the form that contains this input. Only a couple of the inputs * support this method so it is made protected here. Those subclasses * that wish to expose it will override and make it public. * * @return The Page that is the result of submitting this page to the * server * @exception IOException If an io error occurs * @exception ElementNotFoundException If a particular xml element could * not be found in the dom model */ protected Page click() throws IOException, ElementNotFoundException { final String onClick = getOnClickAttribute(); final HtmlPage page = getPage(); if( onClick.length() == 0 || page.getWebClient().isJavaScriptEnabled() == false ) { return getEnclosingFormOrDie().submit(this); } else { return page.executeJavaScriptIfPossible( onClick, "onClick handler for "+getClass().getName(), true).getNewPage(); } } -- end snipet from HtmlInput.java -- |
From: Mike B. <mb...@Ga...> - 2002-12-13 00:44:51
|
Hi Mark, > It appears to be related to the commons-httpclient.jar version > Oct 20/2002 gump build included with HtmlUnit-1.1. All I can suggest is that you try a newer version of commons-httpclient - the version currently in cvs is a Dec 9 build. I realize this isn't a terribly good answer but it's the best I can do right now. Commons-httpclient is undergoing rapid development and is implementing fixes that we need for HtmlUnit so I can't stick with an old version. If they were putting out more regular milestone releases then this wouldn't be as much of a problem but they aren't. > If I swap in the commons-httpclient.jar from the -pre5 > release of commons-httpclient-2.0-alpha1.zip downloaded > from jakarta-commons, everything works fine. As you've probably already figured out, alpha1 is ancient - over a year old already - which is why I've been using daily builds. If the problem shows up with the latest daily build of commons-httpclient then I'll make sure it gets fixed. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: DEMATTEIS, M. S [AG-Contractor/1000]
<mar...@mo...> - 2002-12-12 23:36:20
|
Using HtmlUnit-1.1 with commons-httpclient-2.0-alpha1.zip downloaded from jakarta-commons (unable to use commons-httpclient.jar version Oct 20/2002 gump build included with HtmlUnit-1.1) Here's the code: void test() { HtmlForm form = (HtmlForm)page.getFormByName("myform"); HtmlSelect stateSelector = form.getSelectByName("state"); System.out.println("Available options:"); List availableOptions = stateSelector.getAllOptions(); Iterator itr = availableOptions.iterator(); while (itr.hasNext()) { HtmlOption option = (HtmlOption) itr.next(); System.out.println(option.toString()); } List selectedOptions = stateSelector.getSelectedOptions(); System.out.println("selectedOptions.size()=" + selectedOptions.size()); System.out.println("Ready to call stateSelector.setSelectedAttribute"); stateSelector.setSelectedAttribute("AL", true); System.out.println("Called stateSelector.setSelectedAttribute"); selectedOptions = stateSelector.getSelectedOptions(); System.out.println("selectedOptions.size()=" + selectedOptions.size()); } Here's the output: Available options: HtmlOption[<option value="">] HtmlOption[<option value="AK">] HtmlOption[<option value="AL">] HtmlOption[<option value="AR">] HtmlOption[<option value="AZ">] HtmlOption[<option value="CA">] HtmlOption[<option value="CO">] HtmlOption[<option value="CT">] HtmlOption[<option value="DC">] HtmlOption[<option value="DE">] HtmlOption[<option value="FL">] HtmlOption[<option value="GA">] HtmlOption[<option value="GU">] HtmlOption[<option value="HI">] HtmlOption[<option value="IA">] HtmlOption[<option value="ID">] HtmlOption[<option value="IL">] HtmlOption[<option value="IN">] HtmlOption[<option value="KS">] HtmlOption[<option value="KY">] HtmlOption[<option value="LA">] HtmlOption[<option value="MA">] HtmlOption[<option value="MD">] HtmlOption[<option value="ME">] HtmlOption[<option value="MI">] HtmlOption[<option value="MN">] HtmlOption[<option value="MO">] HtmlOption[<option value="MP">] HtmlOption[<option value="MS">] HtmlOption[<option value="MT">] HtmlOption[<option value="NC">] HtmlOption[<option value="ND">] HtmlOption[<option value="NE">] HtmlOption[<option value="NH">] HtmlOption[<option value="NJ">] HtmlOption[<option value="NM">] HtmlOption[<option value="NV">] HtmlOption[<option value="NY">] HtmlOption[<option value="OH">] HtmlOption[<option value="OK">] HtmlOption[<option value="OR">] HtmlOption[<option value="PA">] HtmlOption[<option value="PR">] HtmlOption[<option value="RI">] HtmlOption[<option value="SC">] HtmlOption[<option value="SD">] HtmlOption[<option value="TN">] HtmlOption[<option value="TX">] HtmlOption[<option value="US">] HtmlOption[<option value="UT">] HtmlOption[<option value="VA">] HtmlOption[<option value="VI">] HtmlOption[<option value="VT">] HtmlOption[<option value="WA">] HtmlOption[<option value="WI">] HtmlOption[<option value="WV">] HtmlOption[<option value="WY">] selectedOptions.size()=0 Ready to call stateSelector.setSelectedAttribute Exception in thread "main" java.lang.NoSuchMethodError at com.monsanto.ag_it.gmp.systemtest.SSRptSearchCriteriaJsp.test(Unknown Source) at com.monsanto.ag_it.gmp.systemtest.SSRptSearchCriteriaJsp.<init>(Unknown Source) at com.monsanto.ag_it.gmp.systemtest.SSRptJsp.loadSSRptSearchCriteriaJsp(Unknow n Source) at com.monsanto.ag_it.gmp.systemtest.SSRptJsp.<init>(Unknown Source) at com.monsanto.ag_it.gmp.systemtest.HomeJsp.getSSRptJspForYG(Unknown Source) at com.monsanto.ag_it.gmp.systemtest.JspTestRunner.execute(Unknown Source) at com.monsanto.ag_it.gmp.systemtest.JspTestRunner.main(Unknown Source) Mark Dematteis |
From: DEMATTEIS, M. S [AG-Contractor/1000]
<mar...@mo...> - 2002-12-12 14:42:43
|
The code I have working with HtmlUnit-1.1-pre5 fails when I use HtmlUnit-1.1. When I call HtmlAnchor.click() I get a null pointer exception. It appears to be related to the commons-httpclient.jar version Oct 20/2002 gump build included with HtmlUnit-1.1. If I swap in the commons-httpclient.jar from the -pre5 release or commons-httpclient-2.0-alpha1.zip downloaded from jakarta-commons, everything works fine. Mark Dematteis |
From: Mike B. <mb...@Ga...> - 2002-12-11 20:39:22
|
> Does HtmlUnit support cookies and if not, is it planned for the near future? Yes, HtmlUnit has supported cookies since the first release. Refer to http://htmlunit.sourceforge.net/ for the list of features. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |