You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(6) |
Jul
(17) |
Aug
(18) |
Sep
(22) |
Oct
(16) |
Nov
(6) |
Dec
(11) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(11) |
Feb
(10) |
Mar
(34) |
Apr
(26) |
May
(6) |
Jun
(22) |
Jul
(14) |
Aug
(4) |
Sep
(47) |
Oct
(69) |
Nov
(23) |
Dec
(21) |
2005 |
Jan
(53) |
Feb
(33) |
Mar
(92) |
Apr
(65) |
May
(63) |
Jun
(57) |
Jul
(43) |
Aug
(132) |
Sep
(61) |
Oct
(75) |
Nov
(60) |
Dec
(130) |
2006 |
Jan
(74) |
Feb
(87) |
Mar
(101) |
Apr
(58) |
May
(54) |
Jun
(42) |
Jul
(31) |
Aug
(67) |
Sep
(61) |
Oct
(71) |
Nov
(28) |
Dec
(58) |
2007 |
Jan
(53) |
Feb
(50) |
Mar
(96) |
Apr
(66) |
May
(55) |
Jun
(130) |
Jul
(99) |
Aug
(115) |
Sep
(37) |
Oct
(78) |
Nov
(24) |
Dec
(70) |
2008 |
Jan
(94) |
Feb
(85) |
Mar
(197) |
Apr
(274) |
May
(119) |
Jun
(143) |
Jul
(193) |
Aug
(99) |
Sep
(160) |
Oct
(120) |
Nov
(178) |
Dec
(109) |
2009 |
Jan
(238) |
Feb
(169) |
Mar
(115) |
Apr
(109) |
May
(131) |
Jun
(167) |
Jul
(144) |
Aug
(193) |
Sep
(155) |
Oct
(154) |
Nov
(97) |
Dec
(127) |
2010 |
Jan
(108) |
Feb
(127) |
Mar
(176) |
Apr
(113) |
May
(130) |
Jun
(200) |
Jul
(115) |
Aug
(80) |
Sep
(92) |
Oct
(101) |
Nov
(124) |
Dec
(53) |
2011 |
Jan
(67) |
Feb
(144) |
Mar
(88) |
Apr
(60) |
May
(89) |
Jun
(54) |
Jul
(68) |
Aug
(81) |
Sep
(48) |
Oct
(40) |
Nov
(10) |
Dec
(20) |
2012 |
Jan
(21) |
Feb
(28) |
Mar
(17) |
Apr
(35) |
May
(41) |
Jun
(44) |
Jul
(68) |
Aug
(67) |
Sep
(89) |
Oct
(58) |
Nov
(47) |
Dec
(56) |
2013 |
Jan
(49) |
Feb
(28) |
Mar
(46) |
Apr
(31) |
May
(28) |
Jun
(37) |
Jul
(34) |
Aug
(52) |
Sep
(42) |
Oct
(108) |
Nov
(59) |
Dec
(56) |
2014 |
Jan
(41) |
Feb
(72) |
Mar
(46) |
Apr
(21) |
May
(19) |
Jun
(17) |
Jul
(15) |
Aug
(40) |
Sep
(11) |
Oct
(3) |
Nov
(5) |
Dec
(31) |
2015 |
Jan
(11) |
Feb
(12) |
Mar
(19) |
Apr
(19) |
May
(38) |
Jun
(54) |
Jul
(14) |
Aug
(42) |
Sep
(14) |
Oct
(16) |
Nov
(26) |
Dec
(14) |
2016 |
Jan
(3) |
Feb
(1) |
Mar
(24) |
Apr
(5) |
May
(15) |
Jun
(14) |
Jul
(33) |
Aug
(19) |
Sep
(8) |
Oct
(10) |
Nov
|
Dec
(2) |
2017 |
Jan
(16) |
Feb
(12) |
Mar
(23) |
Apr
(8) |
May
(11) |
Jun
(20) |
Jul
(21) |
Aug
(20) |
Sep
|
Oct
(6) |
Nov
(9) |
Dec
(2) |
2018 |
Jan
(7) |
Feb
(5) |
Mar
(6) |
Apr
(5) |
May
(1) |
Jun
(2) |
Jul
(2) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
|
Dec
(4) |
2019 |
Jan
(2) |
Feb
(2) |
Mar
(3) |
Apr
(4) |
May
|
Jun
(4) |
Jul
(9) |
Aug
(2) |
Sep
|
Oct
(4) |
Nov
(1) |
Dec
(7) |
2020 |
Jan
(2) |
Feb
(6) |
Mar
(9) |
Apr
(1) |
May
(1) |
Jun
(15) |
Jul
(1) |
Aug
(1) |
Sep
(2) |
Oct
(6) |
Nov
(3) |
Dec
(5) |
2021 |
Jan
(3) |
Feb
(1) |
Mar
(2) |
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(1) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(6) |
2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Brad C. <bc...@bo...> - 2003-08-04 16:20:30
|
Found myself debugging the wrong code today so I added a snipit to build.xml to generate a source jar file. I'm not sure if/how maven could do this so I'll just post it here for now. Index: build.xml =================================================================== RCS file: /cvsroot/htmlunit/htmlunit/build.xml,v retrieving revision 1.41 diff -u -r1.41 build.xml --- build.xml 16 Jun 2003 21:01:05 -0000 1.41 +++ build.xml 4 Aug 2003 16:17:21 -0000 @@ -166,6 +166,11 @@ manifest="build/${version}/META-INF/MANIFEST.MF"/> <delete file="build/${version}/META-INF/MANIFEST.MF"/> + <jar + jarfile="build/${version}/lib/HtmlUnit-src.jar" + basedir="src/java" + includes="**/*.java"/> + <javadoc sourcepath="src/java" destdir="build/${version}/docs/api" |
From: Brad C. <bc...@bo...> - 2003-08-01 15:48:04
|
That took my total test time from 170 seconds to 100 seconds...not as much as I had hoped for but it definitely solved that particular problem. Thanks Brad C At 10:04 AM 8/1/2003, Mike Bowler wrote: >Brad Clarke wrote: >>I have a login form in my application that is currently a POST. When I >>run my login test against it (which logs in about 10 times) it takes 50+ >>seconds to run. When I simply change the method on that form to a GET the >>running time drops to 18 seconds. A bit of debugging showed about a 3 >>second delay in calls to HtmlInput.click() in the POST but not in the GET. >>I'm testing against a custom web server so I really don't know where the >>problem is. I'm just looking for a little help tracking down the issue >>right now. From what I can tell HtmlUnit doesn't do much (if anything) >>different because it's a POST, so I figure the problem is between >>http-commons and our web server. > >commons-httpclient RC1 was released yesterday so I'd recommend upgrading >to that to see if it fixes the problem. > >http://jakarta.apache.org/builds/jakarta-commons/release/commons-httpclient/v2.0/commons-httpclient-2.0-rc1.zip > > >I can't think of anything offhand that would cause a performance >difference like this. |
From: Mike B. <mb...@Ga...> - 2003-08-01 15:11:37
|
Brad Clarke wrote: > > I have a login form in my application that is currently a POST. When I > run my login test against it (which logs in about 10 times) it takes 50+ > seconds to run. When I simply change the method on that form to a GET > the running time drops to 18 seconds. A bit of debugging showed about a > 3 second delay in calls to HtmlInput.click() in the POST but not in the > GET. > > I'm testing against a custom web server so I really don't know where the > problem is. I'm just looking for a little help tracking down the issue > right now. From what I can tell HtmlUnit doesn't do much (if anything) > different because it's a POST, so I figure the problem is between > http-commons and our web server. commons-httpclient RC1 was released yesterday so I'd recommend upgrading to that to see if it fixes the problem. http://jakarta.apache.org/builds/jakarta-commons/release/commons-httpclient/v2.0/commons-httpclient-2.0-rc1.zip I can't think of anything offhand that would cause a performance difference like this. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: Brad C. <bc...@bo...> - 2003-08-01 14:33:05
|
I have a login form in my application that is currently a POST. When I run my login test against it (which logs in about 10 times) it takes 50+ seconds to run. When I simply change the method on that form to a GET the running time drops to 18 seconds. A bit of debugging showed about a 3 second delay in calls to HtmlInput.click() in the POST but not in the GET. I'm testing against a custom web server so I really don't know where the problem is. I'm just looking for a little help tracking down the issue right now. From what I can tell HtmlUnit doesn't do much (if anything) different because it's a POST, so I figure the problem is between http-commons and our web server. Any ideas/suggestions/past experiences? Thanks Brad C |
From: <th...@cy...> - 2003-07-30 09:25:49
|
Mike Bowler <mb...@Ga...> schrieb am 30.07.2003, 01:14:15: > th...@cy... wrote: > > Well, what happens if the option I want to select is no longer > > available? I should have the possibility to catch this error, shouldn't > > I? > > Looking at the source, I see that it will throw an > IllegalArgumentException if you are specifying a name that doesn't > exist. Is this what you meant? Thats what I mean, yeah. Thanks. > By "no longer available" did you mean disabled or just not there? I mean just not there. |
From: Mike B. <mb...@Ga...> - 2003-07-29 23:14:18
|
th...@cy... wrote: > Well, what happens if the option I want to select is no longer > available? I should have the possibility to catch this error, shouldn't > I? Looking at the source, I see that it will throw an IllegalArgumentException if you are specifying a name that doesn't exist. Is this what you meant? By "no longer available" did you mean disabled or just not there? -- 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-07-29 21:56:50
|
Mike Bowler <mb...@Ga...> schrieb am 29.07.2003, 15:22:10: > th...@cy... wrote: > > if I run the following command, how will I know, that this operation was > > successful? > > > > HtmlSelect select; > > ... > > page = (HtmlPage)select.setSelectedAttribute(optionValue, true); > > > > According to the API documentation, there is no exception thrown. But I > > think it would be useful to throw some Exceptions at this point for > > recognizing failures. > > I don't understand what you're trying to do. What kind of a failure are > you expecting? Well, what happens if the option I want to select is no longer available? I should have the possibility to catch this error, shouldn't I? |
From: Mike B. <mb...@Ga...> - 2003-07-29 16:20:46
|
th...@cy... wrote: > if I run the following command, how will I know, that this operation was > successful? > > HtmlSelect select; > ... > page = (HtmlPage)select.setSelectedAttribute(optionValue, true); > > According to the API documentation, there is no exception thrown. But I > think it would be useful to throw some Exceptions at this point for > recognizing failures. I don't understand what you're trying to do. What kind of a failure are you expecting? -- 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-07-29 13:08:47
|
Hi, if I run the following command, how will I know, that this operation was successful? HtmlSelect select; ... page = (HtmlPage)select.setSelectedAttribute(optionValue, true); According to the API documentation, there is no exception thrown. But I think it would be useful to throw some Exceptions at this point for recognizing failures. best regards Thomas Bartz Berlin |
From: Mike B. <mb...@Ga...> - 2003-07-25 16:03:30
|
Alexei Goussev wrote: > Is there something like ConfirmHandler, that could be registered with > the web client to handle window.open, so that "click()"-call will > return me a new HtmlPage enclosed in a new Window? Or what should i do > instead if i want to execute the JavaScript correct and get a new > Window and a new Page? You want to register a WindowEventListener with the WebClient. This isn't javascript specific btw. Check out the documentation http://htmlunit.sourceforge.net/window-howto.html The docs aren't fantastic but they do cover basic stuff like what you're trying to do. Feedback on what could be done to improve the documentation is always welcome. Patches with changes to the documentation would be even better ;-) -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: <Gou...@ne...> - 2003-07-25 14:44:07
|
Hello all! Here is a next JavaScript question for the community: I have a HtmlAnchor element with onclick="javascript:var win = window.open('','myWindow','height=500,width=650, top='+((screen.height-(screen.height/1.618))-(500/2))+',left='+((screen.width-650)/2)+',scrollbars,resizable');win.focus()" which pops up a new window that contains a desired HtmlPage. Is there something like ConfirmHandler, that could be registered with the web client to handle window.open, so that "click()"-call will return me a new HtmlPage enclosed in a new Window? Or what should i do instead if i want to execute the JavaScript correct and get a new Window and a new Page? Is there a kind of documentation somewhere about what should someone use to handle different JavaScript functions? Thanks Alexei Goussev __________________________________________________________________ McAfee VirusScan Online from the Netscape Network. Comprehensive protection for your entire computer. Get your free trial today! http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397 Get AOL Instant Messenger 5.1 free of charge. Download Now! http://aim.aol.com/aimnew/Aim/register.adp?promo=380455 |
From: Brad C. <bc...@bo...> - 2003-07-23 14:21:10
|
We ended up just keeping our own Map of the WebWindows we knew about so whatever happens to the real names of the windows will be transparent to us. Any new TopLevelWindow we create would also have no name. This should more closely resemble the real world situation you observed in Mozilla and IE. thx Brad C At 08:00 PM 7/22/2003, Mike Bowler wrote: >Brad Clarke wrote: > > Is there a reason the default WebWindow has an empty string for a > > name? > >I see from experimentation that Mozilla and IE both use an empty string >for the name of the initial window so most likely that was the reason. I >can't remember for sure but this seems reasonable ;-) > > > We're looking to use the name as a way to manage concurrent windows > > and I can't really decide what to do about the default window. If it > > had a name of "Default Window", "Main Top Level Window", or something > > of that nature the code would look a lot more explicit. > >The problem with these names is that this window is just the one that will >be used during page load if no window was specified. You can change the >current window at any time with WebClient.setCurrentWindow() so calling >this the "main top level window" would be misleading. > >Could you create a new TopLevelWindow with a name of your choice and then >use that as the current? > >-- >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: VM Ware >With VMware you can run multiple operating systems on a single machine. >WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the >same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 >_______________________________________________ >Htmlunit-user mailing list >Htm...@li... >https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Mike B. <mb...@Ga...> - 2003-07-23 01:01:05
|
Brad Clarke wrote: > Is there a reason the default WebWindow has an empty string for a > name? I see from experimentation that Mozilla and IE both use an empty string for the name of the initial window so most likely that was the reason. I can't remember for sure but this seems reasonable ;-) > We're looking to use the name as a way to manage concurrent windows > and I can't really decide what to do about the default window. If it > had a name of "Default Window", "Main Top Level Window", or something > of that nature the code would look a lot more explicit. The problem with these names is that this window is just the one that will be used during page load if no window was specified. You can change the current window at any time with WebClient.setCurrentWindow() so calling this the "main top level window" would be misleading. Could you create a new TopLevelWindow with a name of your choice and then use that as the current? -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: Brad C. <bc...@bo...> - 2003-07-22 21:32:27
|
Is there a reason the default WebWindow has an empty string for a name? We're looking to use the name as a way to manage concurrent windows and I can't really decide what to do about the default window. If it had a name of "Default Window", "Main Top Level Window", or something of that nature the code would look a lot more explicit. Brad C |
From: Mike B. <mb...@Ga...> - 2003-07-22 14:53:30
|
Alexei Goussev wrote: > I have a HtmlAnchor element on my page and invoke .click() method on > it. If there were no JavaScript, it would return a Page found by URL > from 'href' attribute. But there is a script > onclick="javascript: return confirm("Log Out ...?");" > that pops up a confirm dialog with 'yes' and 'no' buttuns. > What should i do to simulate a click on each of this buttons? Register a ConfirmHandler with the web client - see WebClient.setConfirmHandler(ConfirmHandler) > And how can i get a HtmlPage that appears after this click? Your initial call to HtmlAnchor.click() will return the new page if one was loaded or the current page if nothing new was loaded. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: <Gou...@ne...> - 2003-07-22 14:01:32
|
Hello all! I have a question for the community: I have a HtmlAnchor element on my page and invoke .click() method on it. If there were no JavaScript, it would return a Page found by URL from 'href' attribute. But there is a script onclick="javascript: return confirm("Log Out ...?");" that pops up a confirm dialog with 'yes' and 'no' buttuns. What should i do to simulate a click on each of this buttons? And how can i get a HtmlPage that appears after this click? Thanks Alexei Goussev __________________________________________________________________ McAfee VirusScan Online from the Netscape Network. Comprehensive protection for your entire computer. Get your free trial today! http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397 Get AOL Instant Messenger 5.1 free of charge. Download Now! http://aim.aol.com/aimnew/Aim/register.adp?promo=380455 |
From: Mike B. <mb...@Ga...> - 2003-07-21 17:44:52
|
Brad Clarke wrote: > For some reason submits with the "type" in anything but lowercase fail > to work. Here is a reference that marks the value as [CI] or > case-insensitive: > http://www.w3.org/TR/html401/interact/forms.html#adef-type-INPUT <snipped> > Any ideas before I go digging through the code? I did a quick grep through the code to see if I was getting the type attribute in a way that wouldn't already be lowercase but I don't see anything obviously wrong. Are you using the latest code from CVS or the last release (1.2.2)? -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: Brad C. <bc...@bo...> - 2003-07-21 16:14:18
|
<html> <body> For some reason submits with the "type" in anything but lowercase fail to work. Here is a reference that marks the value as [CI] or case-insensitive:<br> <a href="http://www.w3.org/TR/html401/interact/forms.html#adef-type-INPUT" eudora="autourl">http://www.w3.org/TR/html401/interact/forms.html#adef-type-INPUT</a><br><br> A good example I found was this change to the existing test for submit input that makes it fail:<br><br> Index: HtmlSubmitInputTest.java<br> ===================================================================<br> RCS file: /cvsroot/htmlunit/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/html/HtmlSubmitInputTest.java,v<br> retrieving revision 1.5<br> diff -u -r1.5 HtmlSubmitInputTest.java<br> --- HtmlSubmitInputTest.java<x-tab> </x-tab>10 Jun 2003 11:57:01 -0000<x-tab> </x-tab>1.5<br> +++ HtmlSubmitInputTest.java<x-tab> </x-tab>21 Jul 2003 16:06:47 -0000<br> @@ -71,7 +71,7 @@<br> = "<html><head><title>foo</title></head><body>"<br> + "<form id='form1'>"<br> + "<input type='submit' name='aButton' value='foo'/>"<br> - + "<input type='submit' name='button' value='foo'/>"<br> + + "<input type='SuBmIt' name='button' value='foo'/>"<br> + "<input type='submit' name='anotherButton' value='foo'/>"<br> + "</form></body></html>";<br> final WebClient client = new WebClient();<br><br> <br><br> Any ideas before I go digging through the code?<br><br> Brad C</body> </html> |
From: Mike B. <mb...@Ga...> - 2003-07-21 13:15:17
|
> I was doing some debugging of one of my tests and I found a rather > interesting thing: if I place a <font> tag inside an anchor <a> tag, > then the parser duplicates that anchor. But, according to the > Transitional DTD for HTML 4.01, it is valid to place a <font> inside > a <a>. I just tried this with the latest version of NekoHTML (the parser used inside HtmlUnit) and it appears to be doing the right thing. The output I get is: org.apache.html.dom.HTMLDocumentImpl org.apache.html.dom.HTMLHtmlElementImpl org.apache.xerces.dom.TextImpl org.apache.html.dom.HTMLHeadElementImpl org.apache.xerces.dom.TextImpl org.apache.html.dom.HTMLTitleElementImpl org.apache.xerces.dom.TextImpl org.apache.xerces.dom.TextImpl org.apache.html.dom.HTMLMetaElementImpl org.apache.xerces.dom.TextImpl org.apache.xerces.dom.TextImpl org.apache.html.dom.HTMLBodyElementImpl org.apache.xerces.dom.TextImpl org.apache.html.dom.HTMLParagraphElementImpl org.apache.html.dom.HTMLAnchorElementImpl org.apache.html.dom.HTMLFontElementImpl org.apache.xerces.dom.TextImpl org.apache.xerces.dom.TextImpl org.apache.html.dom.HTMLParagraphElementImpl org.apache.html.dom.HTMLFontElementImpl org.apache.html.dom.HTMLAnchorElementImpl org.apache.xerces.dom.TextImpl org.apache.xerces.dom.TextImpl If you are using the HtmlUnit code from CVS then you will already have the latest version of NekoHTML. If not, then you can download it from http://www.apache.org/~andyc/neko/doc/html/index.html Let me know if this latest NekoHTML isn't fixing your problem. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: Mike B. <mb...@Ga...> - 2003-07-21 13:00:03
|
Despite that fact that I was the one who created this mailing list, it appears that sourceforge didn't add me as a user to the list. As a result, I have just now discovered that people have been posting here. I'm going through the archive now to see what I've missed. <sigh> -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: Brad C. <bc...@bo...> - 2003-07-10 17:56:46
|
I tried to run the junitui target in the ant build.xml and it doesn't look like it's been updated in a while. I the updated it to look like the junit target (with the exception of the swingui runner) and it gives 1 failure and 191 errors by default. I ran the junit target to make sure and all the tests passed without error. Unchecking the "Reload classes every run" box (which I can't figure out how to do without running all the tests once first) makes all but one test pass. I then found this on the junit site (which, along with most sf.net sites seems to be down right now...): http://junit.sourceforge.net/doc/faq/faq.htm#running_8 Curious, I tried making this file exclude all items and putting it in the classpath at the top of base.class.path, but it didn't work. I suspect it's because it still wasn't getting into the classpath before junit.jar meaning this isn't something that easily can be changed from inside the build process. I was considering trying to use junitx.util.DirectorySuiteBuilder to build the test suite in MainTestSuite instead of the gsbase stuff (only because I don't know anything about gsbase yet) but I thought I'd bring it up here before I go screwing with things. Has this kind of thing happened before? It should be noted that I don't really see much use in the swingui for this project either, but I'd like to use it for another project where the people who should run the tests are not Java developers and a gui test runner would make things easier on them. I figure this one wouldn't be here unless -somebody- wanted it so I may as well try and fix it in the process :) Brad C |
From: Glanville, J. <Jay...@Na...> - 2003-06-04 14:13:14
|
I was doing some debugging of one of my tests and I found a rather interesting thing: if I place a <font> tag inside an anchor <a> tag, then the parser duplicates that anchor. But, according to the Transitional DTD for HTML 4.01, it is valid to place a <font> inside a <a>. I have included in this email three things: the original HTML document that I'm testing, the test case method and the results of the System.out output. As you can see by my HTML document, I only have two anchor tags, but you can see in the output I've been told that there are three anchors. When you look at the output of the HtmlPage.asXml() method, you see that the parser has taken copied the anchor tag outside of the font tag and placed the copy inside the font tag. This doesn't match my source code. As a test, I've validated my original document through the HTML validator at http://validator.w3.org/ with the stated results that "This Page Is Valid HTML 4.01 Transitional!" Is this expected behaviour, or should I enter this as a bug on the SourceForge web site? JDG ----- start of html document ----- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Bad HTML</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-5" > </head> <body> <p><a href="http://www.google.ca"><font size="+1">Google</font></a> <p><font size="+1"><a href="http://www.google.ca">Google</a></font> </body> </html> ----- start of html document ----- ----- start of test ----- public final void testBadHtml() throws Exception { final WebClient client = new WebClient(); final URL url = new URL( "http://localhost:8080/dummyserver/badhtml.html" ); final HtmlPage page = (HtmlPage) client.getPage( url ); assertEquals( "Bad HTML", page.getTitleText() ); List anchors = page.getAnchors(); for ( int i = 0; i < anchors.size(); i++ ) { HtmlAnchor currentAnchor = (HtmlAnchor) anchors.get( i ); System.out.println( "current anchor: " + currentAnchor ); System.out.println( "current anchor text: " + currentAnchor.asText() ); } System.out.println( page.asXml() ); } ----- end of test ----- ----- start of output ----- current anchor: HtmlAnchor[<a href="http://www.google.ca">] current anchor text: current anchor: HtmlAnchor[<a href="http://www.google.ca">] current anchor text: Google current anchor: HtmlAnchor[<a href="http://www.google.ca">] current anchor text: Google <html> <head> <title> Bad HTML </title> <meta content="text/html; charset=ISO-8859-5" http-equiv="Content-Type"/> </head> <body> <p> <a href="http://www.google.ca"/> <font size="+1"> <a href="http://www.google.ca"> Google </a> </font> </p> <p> <font size="+1"> <a href="http://www.google.ca"> Google </a> </font> </p> </body> </html> ----- end of output ----- -- Jay Glanville Web Developer jay...@na... (613) 725-2030 x393 |
From: Glanville, J. <Jay...@Na...> - 2003-06-04 13:24:40
|
Thanks again to both Barnaby and Brad, the HtmlPage.getFirstAnchorByText() works great. JDG > Wow! Two answers within a short time, and they concurred! > Yup, the user's group is alive. > > Thanks, I'll try your suggestions tomorrow. > > JDG > |
From: Glanville, J. <Jay...@Na...> - 2003-06-03 18:56:56
|
Wow! Two answers within a short time, and they concurred! Yup, the user's group is alive. Thanks, I'll try your suggestions tomorrow. JDG |
From: Brad C. <bc...@bo...> - 2003-06-03 18:44:14
|
1: Sounds like you want HTMLPage.getFirstAnchorByText() 2: I think it's HtmlElement.asText() but I haven't done java testing in a couple of months so I could be mistaken :) Brad C At 01:32 PM 6/3/2003, Glanville, Jay wrote: >Hello all. Nice new list! > >I have a question or two for the community: > >There is an HTMLPage.getAnchorByHref() function, and an >HTMLPage.getAnchorByName() function, but there isn't an >HTMLPage.getAnchorByText() function. The reason I need this is because the >name attribute isn't used, and I can't guarantee what the href value will be >(it will contain the user's id, which is dynamically created). > >I know that the web app will reply with something like this: > > <a href=".../someJsp.jsp?id=66">Edit John</a> > >So, I thought to myself, I'd write a utility method that uses the >HTMLPage.getAnchors() method, goes through the list of resulting HTMLAnchor >objects looking for something with the content of "Edit John". However, I >can't figure out how to get the content of an A element out of the >HTMLAnchor object. > >So, question one: is there an easy way to get an HTMLAnchor object out of an >HTMLPage by querying based on the content of the tag? > >Question two (if question one forces me to write my utility method): how do >I get the content of an A tag out of the HTMLAnchor object? > >Thankx > >JDG > >PS: Hopefully enough of the designers mailing list has signed up to the >users list so that there is enough of a population to read my query. ;-) > >-- >Jay Glanville >Web Developer >jay...@na... >(613) 725-2030 x393 > > > >------------------------------------------------------- >This SF.net email is sponsored by: eBay >Get office equipment for less on eBay! >http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 >_______________________________________________ >Htmlunit-user mailing list >Htm...@li... >https://lists.sourceforge.net/lists/listinfo/htmlunit-user |