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: Bruce F. <Bru...@sa...> - 2004-09-01 15:05:09
|
In the current code for HtmlUnit (i.e. the 1.3 pre-release code), the = getAnchors() method of the HtmlPage object does indeed return a list of = HtmlAnchor objects. The following code snippet was used to yield the results below: List anchorList =3D page.getAnchors(); for (Iterator iter =3D anchorList.iterator(); iter.hasNext();) { HtmlAnchor anchor =3D (HtmlAnchor) iter.next(); System.out.println("text: " + anchor.asText()); =09 System.out.println("href attribute: " + anchor.getHrefAttribute()); } text: some link name href attribute: somelink text: some link name 1 href attribute: somelink1 text: some link name 2 href attribute: somelink2 where the input HTML page looked like: <html> <body> <a href=3D"somelink">some link name</a> <a href=3D"somelink1">some link name 1</a> <a href=3D"somelink2">some link name 2</a> </body> </html> Hope this helps, Bruce -- Bruce Faulkner SAS Institute Inc. -----Original Message----- From: htm...@li... = [mailto:htm...@li...] On Behalf Of Robert = Baccus Sent: Wednesday, September 01, 2004 10:28 AM To: htm...@li... Subject: RE: [Htmlunit-user] Getting all the Anchor (HTMLLinks) on a = page? Actually looking at the code below only returns the Anchor objects not = the HtmlAnchor objects. I already looked at this and it didn't work for = me. I am not sure that the HtmlLink object is what I am looking for either = since I am trying to get the following <href a=3D"somelink">some link = name</a> in an object. I want to capture the Somelink and SomeLinkName = fields and put them in a list. Thanks. --- Bruce Faulkner <Bru...@sa...> wrote: > And, of course, if you really wanted the HtmlAnchor objects rather=20 > than the HtmlLink objects, then it is even easier: >=20 > List anchorList =3D myPage.getAnchors(); >=20 > Bruce > -- > Bruce Faulkner > SAS Institute Inc. >=20 > -----Original Message----- > From: htm...@li... > [mailto:htm...@li...] On Behalf Of Bruce=20 > Faulkner > Sent: Wednesday, September 01, 2004 8:23 AM > To: htm...@li... > Subject: RE: [Htmlunit-user] Getting all the Anchor (HTMLLinks) on a = page? >=20 >=20 > Something like the following code should give what you need: >=20 > List linkList =3D=20 > = myPage.getDocumentElement().getHtmlElementsByTagName(HtmlLink.TAG_NAME); > Where myPage is an instance of an HtmlPage. >=20 > Bruce > -- > Bruce Faulkner > SAS Institute Inc. > -----Original Message----- > From: htm...@li... > [mailto:htm...@li...] On Behalf Of Robert = > Baccus > Sent: Tuesday, August 31, 2004 8:13 PM > To: htm...@li... > Subject: [Htmlunit-user] Getting all the Anchor (HTMLLinks) on a page? >=20 >=20 > I noticed that HTMLUnit has the HtmlPage.getFirstAnchorByText(String=20 > text) method. But what I am trying to accomplish is to parse the=20 > whole page and pull out all of the HTMLLinks and put them into a list. = =20 > Can this easily be done? >=20 > Thanks. >=20 > =3D=3D=3D=3D=3D > Rob Baccus > Email: rb...@go... >=20 >=20 > =09 > __________________________________ > Do you Yahoo!? > Read only the mail you want - Yahoo! Mail SpamGuard.=20 > http://promotions.yahoo.com/new_mail >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today.=20 > http://ads.osdn.com/?ad_id=3D5047&alloc_id=3D10808&op=3Dclick > _______________________________________________ > Htmlunit-user mailing list Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today.=20 > http://ads.osdn.com/?ad_idP47&alloc_id=10808&op=3Dick > _______________________________________________ > Htmlunit-user mailing list Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today.=20 > http://ads.osdn.com/?ad_idP47&alloc_id=10808&op=3Dclick > _______________________________________________ > Htmlunit-user mailing list Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user >=20 =3D=3D=3D=3D=3D Rob Baccus Email: rb...@go... =09 _______________________________ Do you Yahoo!? Express yourself with Y! Messenger! Free. Download now.=20 http://messenger.yahoo.com ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=3D5047&alloc_id=3D10808&op=3Dclick _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Robert B. <rba...@ya...> - 2004-09-01 14:28:25
|
Actually looking at the code below only returns the Anchor objects not the HtmlAnchor objects. I already looked at this and it didn't work for me. I am not sure that the HtmlLink object is what I am looking for either since I am trying to get the following <href a="somelink">some link name</a> in an object. I want to capture the Somelink and SomeLinkName fields and put them in a list. Thanks. --- Bruce Faulkner <Bru...@sa...> wrote: > And, of course, if you really wanted the HtmlAnchor objects rather than the HtmlLink objects, > then it is even easier: > > List anchorList = myPage.getAnchors(); > > Bruce > -- > Bruce Faulkner > SAS Institute Inc. > > -----Original Message----- > From: htm...@li... > [mailto:htm...@li...] On Behalf Of Bruce Faulkner > Sent: Wednesday, September 01, 2004 8:23 AM > To: htm...@li... > Subject: RE: [Htmlunit-user] Getting all the Anchor (HTMLLinks) on a page? > > > Something like the following code should give what you need: > > List linkList = myPage.getDocumentElement().getHtmlElementsByTagName(HtmlLink.TAG_NAME); > Where myPage is an instance of an HtmlPage. > > Bruce > -- > Bruce Faulkner > SAS Institute Inc. > -----Original Message----- > From: htm...@li... > [mailto:htm...@li...] On Behalf Of Robert Baccus > Sent: Tuesday, August 31, 2004 8:13 PM > To: htm...@li... > Subject: [Htmlunit-user] Getting all the Anchor (HTMLLinks) on a page? > > > I noticed that HTMLUnit has the HtmlPage.getFirstAnchorByText(String text) method. But what I > am trying to accomplish is to parse the whole page and pull out all of the HTMLLinks and put > them into a list. Can this easily be done? > > Thanks. > > ===== > Rob Baccus > Email: rb...@go... > > > > __________________________________ > Do you Yahoo!? > Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_idP47&alloc_id808&op=ick > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_idP47&alloc_id808&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > ===== Rob Baccus Email: rb...@go... _______________________________ Do you Yahoo!? Express yourself with Y! Messenger! Free. Download now. http://messenger.yahoo.com |
From: Bruce F. <Bru...@sa...> - 2004-09-01 12:35:25
|
And, of course, if you really wanted the HtmlAnchor objects rather than = the HtmlLink objects, then it is even easier: List anchorList =3D myPage.getAnchors(); Bruce -- Bruce Faulkner SAS Institute Inc. -----Original Message----- From: htm...@li... = [mailto:htm...@li...] On Behalf Of Bruce = Faulkner Sent: Wednesday, September 01, 2004 8:23 AM To: htm...@li... Subject: RE: [Htmlunit-user] Getting all the Anchor (HTMLLinks) on a = page? Something like the following code should give what you need: List linkList =3D = myPage.getDocumentElement().getHtmlElementsByTagName(HtmlLink.TAG_NAME); Where myPage is an instance of an HtmlPage. Bruce -- Bruce Faulkner SAS Institute Inc. -----Original Message----- From: htm...@li... = [mailto:htm...@li...] On Behalf Of Robert = Baccus Sent: Tuesday, August 31, 2004 8:13 PM To: htm...@li... Subject: [Htmlunit-user] Getting all the Anchor (HTMLLinks) on a page? I noticed that HTMLUnit has the HtmlPage.getFirstAnchorByText(String = text) method. But what I am trying to accomplish is to parse the whole = page and pull out all of the HTMLLinks and put them into a list. Can = this easily be done? Thanks. =3D=3D=3D=3D=3D Rob Baccus Email: rb...@go... =09 __________________________________ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. = http://promotions.yahoo.com/new_mail=20 ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. = http://ads.osdn.com/?ad_id=3D5047&alloc_id=3D10808&op=3Dclick _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. = http://ads.osdn.com/?ad_idP47&alloc_id=10808&op=3Dick _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Bruce F. <Bru...@sa...> - 2004-09-01 12:23:29
|
Something like the following code should give what you need: List linkList =3D = myPage.getDocumentElement().getHtmlElementsByTagName(HtmlLink.TAG_NAME); Where myPage is an instance of an HtmlPage. Bruce -- Bruce Faulkner SAS Institute Inc. -----Original Message----- From: htm...@li... = [mailto:htm...@li...] On Behalf Of Robert = Baccus Sent: Tuesday, August 31, 2004 8:13 PM To: htm...@li... Subject: [Htmlunit-user] Getting all the Anchor (HTMLLinks) on a page? I noticed that HTMLUnit has the HtmlPage.getFirstAnchorByText(String = text) method. But what I am trying to accomplish is to parse the whole = page and pull out all of the HTMLLinks and put them into a list. Can = this easily be done? Thanks. =3D=3D=3D=3D=3D Rob Baccus Email: rb...@go... =09 __________________________________ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. = http://promotions.yahoo.com/new_mail=20 ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. = http://ads.osdn.com/?ad_id=3D5047&alloc_id=3D10808&op=3Dclick _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Robert B. <rba...@ya...> - 2004-09-01 00:13:22
|
I noticed that HTMLUnit has the HtmlPage.getFirstAnchorByText(String text) method. But what I am trying to accomplish is to parse the whole page and pull out all of the HTMLLinks and put them into a list. Can this easily be done? Thanks. ===== Rob Baccus Email: rb...@go... __________________________________ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail |
From: Shankar K. <sha...@ya...> - 2004-08-20 18:49:52
|
Hi all I am a new to htmlunit. I find it very good. I seem to have a problem with it though. My app is structured in such a way that A.jsp calls B.jsp which in turn calls C.jsp. This sort of redirection is achieved in the client side (rather than the server side). There is a javascript code which submits the form as soon as it is loaded and that's how redirection is achieved. I am able to go from A.jsp to B.jsp. But the redirection from B.jsp to C.jsp does not work because of the following javascript code in the output of B.jsp var cookie = document.cookie The above code results in the exception noted below: (I have gone though the faq which suggests to check the commons-httpclient.jar and I have ver 2.0.1 which is faily new I guess.) Any ideas? "======= EXCEPTION START ======== Exception class=[org.mozilla.javascript.JavaScriptException] com.gargoylesoftware.htmlunit.ScriptException: com.gargoylesoftware.htmlunit.ScriptException at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:261) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:700) at com.gargoylesoftware.htmlunit.ScriptFilter.executeScript(ScriptFilter.java:274) at com.gargoylesoftware.htmlunit.ScriptFilter.endElement(ScriptFilter.java:233) at org.cyberneko.html.HTMLTagBalancer.callEndElement(Unknown Source) at org.cyberneko.html.HTMLTagBalancer.endElement(Unknown Source) at org.cyberneko.html.HTMLScanner$SpecialScanner.scan(Unknown Source) at org.cyberneko.html.HTMLScanner.scanDocument(Unknown Source) at org.cyberneko.html.HTMLConfiguration.parse(Unknown Source) at org.cyberneko.html.HTMLConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:269) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:200) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:81) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:566) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:533) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:451) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:325) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:269) at SR43395.main(SR43395.java:138) JavaScriptException value = ======= EXCEPTION START ======== Exception class=[com.gargoylesoftware.htmlunit.ScriptException] com.gargoylesoftware.htmlunit.ScriptException at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:264) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:700) at com.gargoylesoftware.htmlunit.ScriptFilter.executeScript(ScriptFilter.java:274) at com.gargoylesoftware.htmlunit.ScriptFilter.endElement(ScriptFilter.java:233) at org.cyberneko.html.HTMLTagBalancer.callEndElement(Unknown Source) at org.cyberneko.html.HTMLTagBalancer.endElement(Unknown Source) at org.cyberneko.html.HTMLScanner$SpecialScanner.scan(Unknown Source) at org.cyberneko.html.HTMLScanner.scanDocument(Unknown Source) at org.cyberneko.html.HTMLConfiguration.parse(Unknown Source) at org.cyberneko.html.HTMLConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:269) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:200) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:81) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:566) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:533) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:418) at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:179) at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:130) at com.gargoylesoftware.htmlunit.javascript.host.Form.jsFunction_submit(Form.java:204) at inv6.invoke() at org.mozilla.javascript.FunctionObject.doInvoke(Unknown Source) at org.mozilla.javascript.FunctionObject.call(Unknown Source) at org.mozilla.javascript.ScriptRuntime.call(Unknown Source) at org.mozilla.javascript.gen.c1.call(Embedded script:1) at org.mozilla.javascript.gen.c1.exec(Embedded script) at org.mozilla.javascript.Context.evaluateReader(Unknown Source) at org.mozilla.javascript.Context.evaluateString(Unknown Source) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:256) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:700) at com.gargoylesoftware.htmlunit.ScriptFilter.executeScript(ScriptFilter.java:274) at com.gargoylesoftware.htmlunit.ScriptFilter.endElement(ScriptFilter.java:233) at org.cyberneko.html.HTMLTagBalancer.callEndElement(Unknown Source) at org.cyberneko.html.HTMLTagBalancer.endElement(Unknown Source) at org.cyberneko.html.HTMLScanner$SpecialScanner.scan(Unknown Source) at org.cyberneko.html.HTMLScanner.scanDocument(Unknown Source) at org.cyberneko.html.HTMLConfiguration.parse(Unknown Source) at org.cyberneko.html.HTMLConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:269) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:200) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:81) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:566) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:533) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:451) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:325) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:269) at SR43395.main(SR43395.java:138) Enclosed exception: ======= EXCEPTION START ======== Exception class=[java.lang.reflect.InvocationTargetException] com.gargoylesoftware.htmlunit.ScriptException at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.get(SimpleScriptable.java:393) at com.gargoylesoftware.htmlunit.javascript.host.HTMLElement.get(HTMLElement.java:155) at com.gargoylesoftware.htmlunit.javascript.host.Document.get(Document.java:496) at org.mozilla.javascript.ScriptRuntime.getProp(Unknown Source) at org.mozilla.javascript.gen.c2.call(Embedded script:56) at org.mozilla.javascript.gen.c2.exec(Embedded script) at org.mozilla.javascript.Context.evaluateReader(Unknown Source) at org.mozilla.javascript.Context.evaluateString(Unknown Source) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:256) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:700) at com.gargoylesoftware.htmlunit.ScriptFilter.executeScript(ScriptFilter.java:274) at com.gargoylesoftware.htmlunit.ScriptFilter.endElement(ScriptFilter.java:233) at org.cyberneko.html.HTMLTagBalancer.callEndElement(Unknown Source) at org.cyberneko.html.HTMLTagBalancer.endElement(Unknown Source) at org.cyberneko.html.HTMLScanner$SpecialScanner.scan(Unknown Source) at org.cyberneko.html.HTMLScanner.scanDocument(Unknown Source) at org.cyberneko.html.HTMLConfiguration.parse(Unknown Source) at org.cyberneko.html.HTMLConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:269) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:200) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:81) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:566) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:533) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:418) at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:179) at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:130) at com.gargoylesoftware.htmlunit.javascript.host.Form.jsFunction_submit(Form.java:204) at inv6.invoke() at org.mozilla.javascript.FunctionObject.doInvoke(Unknown Source) at org.mozilla.javascript.FunctionObject.call(Unknown Source) at org.mozilla.javascript.ScriptRuntime.call(Unknown Source) at org.mozilla.javascript.gen.c1.call(Embedded script:1) at org.mozilla.javascript.gen.c1.exec(Embedded script) at org.mozilla.javascript.Context.evaluateReader(Unknown Source) at org.mozilla.javascript.Context.evaluateString(Unknown Source) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:256) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:700) at com.gargoylesoftware.htmlunit.ScriptFilter.executeScript(ScriptFilter.java:274) at com.gargoylesoftware.htmlunit.ScriptFilter.endElement(ScriptFilter.java:233) at org.cyberneko.html.HTMLTagBalancer.callEndElement(Unknown Source) at org.cyberneko.html.HTMLTagBalancer.endElement(Unknown Source) at org.cyberneko.html.HTMLScanner$SpecialScanner.scan(Unknown Source) at org.cyberneko.html.HTMLScanner.scanDocument(Unknown Source) at org.cyberneko.html.HTMLConfiguration.parse(Unknown Source) at org.cyberneko.html.HTMLConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:269) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:200) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:81) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:566) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:533) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:451) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:325) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:269) at SR43395.main(SR43395.java:138) Enclosed exception: java.lang.reflect.InvocationTargetException: java.lang.NullPointerException at com.gargoylesoftware.htmlunit.javascript.host.Document.jsGet_cookie(Document.java:217) at java.lang.reflect.Method.invoke(Native Method) at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.get(SimpleScriptable.java:390) at com.gargoylesoftware.htmlunit.javascript.host.HTMLElement.get(HTMLElement.java:155) at com.gargoylesoftware.htmlunit.javascript.host.Document.get(Document.java:496) at org.mozilla.javascript.ScriptRuntime.getProp(Unknown Source) at org.mozilla.javascript.gen.c2.call(Embedded script:56) at org.mozilla.javascript.gen.c2.exec(Embedded script) at org.mozilla.javascript.Context.evaluateReader(Unknown Source) at org.mozilla.javascript.Context.evaluateString(Unknown Source) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:256) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:700) at com.gargoylesoftware.htmlunit.ScriptFilter.executeScript(ScriptFilter.java:274) at com.gargoylesoftware.htmlunit.ScriptFilter.endElement(ScriptFilter.java:233) at org.cyberneko.html.HTMLTagBalancer.callEndElement(Unknown Source) at org.cyberneko.html.HTMLTagBalancer.endElement(Unknown Source) at org.cyberneko.html.HTMLScanner$SpecialScanner.scan(Unknown Source) at org.cyberneko.html.HTMLScanner.scanDocument(Unknown Source) at org.cyberneko.html.HTMLConfiguration.parse(Unknown Source) at org.cyberneko.html.HTMLConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:269) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:200) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:81) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:566) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:533) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:418) at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:179) at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:130) at com.gargoylesoftware.htmlunit.javascript.host.Form.jsFunction_submit(Form.java:204) at inv6.invoke() at org.mozilla.javascript.FunctionObject.doInvoke(Unknown Source) at org.mozilla.javascript.FunctionObject.call(Unknown Source) at org.mozilla.javascript.ScriptRuntime.call(Unknown Source) at org.mozilla.javascript.gen.c1.call(Embedded script:1) at org.mozilla.javascript.gen.c1.exec(Embedded script) at org.mozilla.javascript.Context.evaluateReader(Unknown Source) at org.mozilla.javascript.Context.evaluateString(Unknown Source) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:256) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:700) at com.gargoylesoftware.htmlunit.ScriptFilter.executeScript(ScriptFilter.java:274) at com.gargoylesoftware.htmlunit.ScriptFilter.endElement(ScriptFilter.java:233) at org.cyberneko.html.HTMLTagBalancer.callEndElement(Unknown Source) at org.cyberneko.html.HTMLTagBalancer.endElement(Unknown Source) at org.cyberneko.html.HTMLScanner$SpecialScanner.scan(Unknown Source) at org.cyberneko.html.HTMLScanner.scanDocument(Unknown Source) at org.cyberneko.html.HTMLConfiguration.parse(Unknown Source) at org.cyberneko.html.HTMLConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:269) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:200) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:81) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:566) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:533) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:451) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:325) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:269) at SR43395.main(SR43395.java:138) ======= EXCEPTION END ======== " __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail |
From: Shankar K. <sha...@ya...> - 2004-08-20 18:37:05
|
Hi I would like to post a message to this board. Thanks Shan __________________________________ Do you Yahoo!? Y! Messenger - Communicate in real time. Download now. http://messenger.yahoo.com |
From: <ddk...@ki...> - 2004-08-02 14:03:12
|
It will return "foo" only if you have a DomNode representing the "foo" character data. This includes the DomCharacterData class and the DomText class. All other HtmlElement objects will return null, i.e., if you had an object representing "tag". Dave On Sun, Aug 01, 2004 at 10:55:22PM -0700, Jeff Wong wrote: > What does DomNode.getNodeValue() do? Does that return whatever text is > enclosed by the tag? > > i.e. on <tag>foo</tag> it returns "foo"? |
From: Jeff W. <jef...@sa...> - 2004-08-02 05:56:29
|
What does DomNode.getNodeValue() do? Does that return whatever text is enclosed by the tag? i.e. on <tag>foo</tag> it returns "foo"? |
From: Marc G. <mgu...@ya...> - 2004-07-26 16:08:01
|
Hi, I'm working on migrating Webtest (http://webtest.canoo.com) from httpunit to htmlunit and I face following problem: a xpath like /html/head/title evaluates to nothing whereas /head/title evaluates to the title of the document. - why does it work this way? I mean, it seems more logical to have the "/html" as the root of the structured document. - is there an easy way to change this behavior? Marc. |
From: <ddk...@ki...> - 2004-07-22 15:50:04
|
BTW, the cvs server expects all dates to be in the GMT (UTC) timezone. Dave On Wed, Jul 21, 2004 at 07:57:57PM -0500, David D. Kilzer wrote: > The best you're going to be able to do is to update your CVS checkout > directory to a specific date, based upon the date of the files in the > ZIP archive (either 1.2.3 or 1.3-pre1). The command would look > something like this: > > $ cd htmlunit > $ cvs update -D 2003-10-31 18:00 . |
From: <ddk...@ki...> - 2004-07-22 13:34:09
|
Are you "clicking" on links and buttons from the returned HtmlPage object, or are you creating a new HtmlPage object for ever web page (URL) that you want to load? If you are creating a new HtmlPage object each time, it would match the behavior you're describing. What you want to do is "click" on the links or buttons on the returned HtmlPage object to keep everything in the same login session. I use htmlunit at work with a form-based login, and it has no problem storing cookies in that context. (I'm using a patched htmlunit-1.3-pre1 at work, although none of the patches are related to cookies.) Dave On Thu, Jul 22, 2004 at 01:51:56PM +0200, Thorsten Suckow-Homberg wrote: > ok, here is what it does: > > When u fill out the login-form the form posts to the same site - it > then checks if the login was valid (looks into db etc.) and if so, a > user-object will be created (phpLib) and stored into the session. > Then a redirect to the appliction-start-page begins - and the session > is lost. > > I have taken a look on the server into the session- directory, and it > looks like the session is created new everytime HtmlUnit loads a > page... > > Anyone encounters similiar problems? > > Regards > > Thorsten |
From: Thorsten Suckow-H. <ts...@as...> - 2004-07-22 11:51:32
|
ok, here is what it does: When u fill out the login-form the form posts to the same site - it then ch= ecks if the login was valid (looks into db etc.) and if so, a user-object w= ill be created (phpLib) and stored into the session. Then a redirect to the= appliction-start-page begins - and the session is lost. I have taken a look on the server into the session- directory, and it looks= like the session is created new everytime HtmlUnit loads a page... Anyone encounters similiar problems? Regards=20 Thorsten |
From: Jeremie B. <jer...@ke...> - 2004-07-22 06:35:45
|
Finally i've found the solution; httpclient project (used by htmlunit) doesnt support an other charset as ISO-8859-1 in multipart context. The code is in the application but not used; i had to patch httpclient to fix charset use. Jeremie Blanc wrote: > Hi, > We have a problem with UTF8 encoding with htmlunit. > With one of our application we notice that htmlunit send data in > US-ASCII in header charset; we have seen that by logging httpclient in > wire/debug mode. > Or the server delivers UTF8 format. > Is'nt there any solution to force UTF8 encoding for all sent data in > htmlunit? > Thx. > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > -- Jeremie BLANC - Developper - KELKOO "Those who do not understand UNIX are doomed to reinvent it, poorly." - Henry Spencer |
From: <ddk...@ki...> - 2004-07-22 00:58:29
|
Typically you can find CVS tags using the "cvs log" command on a file that you know is in the distribution (or on the whole directory, and parse out a list of unique revisions). This monstrosity will do the trick: $ cvs log 2> /dev/null | perl -e 'while (<>) { if (/^symbolic names:/) { while (<>) { if (/^\s+/) { /^\s+([^:]+):/; $n{$1} = 1; } else { last; } } } } print join("\n", sort keys %n), "\n";' HtmlUnit-1dot1 HtmlUnit-1dot2 HtmlUnit-1dot2dot1 PRE_INPUT_CHANGE mbowler pre-dom-changes start Unfortunately, it doesn't look like there any tags for 1.3-pre1 (or even 1.2.3 for that matter). :( The best you're going to be able to do is to update your CVS checkout directory to a specific date, based upon the date of the files in the ZIP archive (either 1.2.3 or 1.3-pre1). The command would look something like this: $ cd htmlunit $ cvs update -D 2003-10-31 18:00 . You can then verify that the CVS directory matches the distribution by doing the following (-u is unified diff format; -r is recursive; -x CVS ignores CVS directories and their contents): $ diff -ur -x CVS htmlunit-1.2.3 htmlunit There should be NO differences (other than perhaps some new files or directories that weren't part of the ZIP file). If there ARE some differences, then you must determine which (local) revision of that file matches the released revision, then update it individually using: $ cvs update -r X.Y.Z filename.ext After doing that, you should be at the correct snapshot in CVS. NOTE TO DEVELOPERS: If you have time to do something like this, it would be very beneficial to tag the source for future use. It's never too late to tag source in CVS as long as you've got all the correct revisions of the files checked out! Dave On Wed, Jul 21, 2004 at 04:52:43PM -0700, Jeff Wong wrote: > Mike, > > The build instructions state that I should be able to build using Maven or > Ant. However, in the 1.2.3 and 1.3-pre1 zip files, I don't see any files > named maven.xml or build.xml that would provide build instructions to > tools. > > I downloaded the latest source from CVS and I notice that these files are > there. Is there anyway I can download 1.3-pre1 from CVS? Is there a CVS > tag for that? > > Jeff |
From: Jeff W. <jef...@sa...> - 2004-07-21 23:53:49
|
Mike, The build instructions state that I should be able to build using Maven or Ant. However, in the 1.2.3 and 1.3-pre1 zip files, I don't see any files named maven.xml or build.xml that would provide build instructions to tools. I downloaded the latest source from CVS and I notice that these files are there. Is there anyway I can download 1.3-pre1 from CVS? Is there a CVS tag for that? Jeff On Mon, 19 Jul 2004 htm...@li... wrote: > > Message: 3 > Date: Mon, 19 Jul 2004 21:31:18 -0400 > From: Mike Bowler <mb...@Ga...> > Organization: Gargoyle Software > To: htm...@li... > Subject: Re: [Htmlunit-user] Obtaining HTMLUnit source for 1.2.3 > Reply-To: htm...@li... > > Jeff Wong wrote: > > I looked almost all of the HTMLUnit website and I could not a link to a > > 1.2.3 source distribution. I know there is source in the compiled 1.2.3 > > version but I'd like to get a copy of 1.2.3 that comes with build scripts > > or at least instructions on how to build 1.2.3. Does such a thing exist? > > Or checking out the current version from CVS the best I can do? > > There have been a lot of fixes between 1.2.3 and the latest build so > you're really better off with more recent code. > > The build instructions are at > http://htmlunit.sourceforge.net/buildingFromCvs.html and if I recall > correctly, those instructions are also applicable for 1.2.3. |
From: Mike B. <mbr...@vi...> - 2004-07-21 14:24:24
|
I've never had any problems with cookies or sessions. Perhaps you could explain in more detail what your problem is. Mike -----Original Message----- From: htm...@li... [mailto:htm...@li...]On Behalf Of Thorsten Suckow-Homberg Sent: Wednesday, July 21, 2004 8:54 AM To: htm...@li... Subject: [Htmlunit-user] Trouble with testing PHP apps (cookies...) Hey everyone, right now I write some UnitTests for a large PHP-Application using HtmlUnit. The problem I have is that the http-client seems to append the Session-ID automatically to links etc., while it shouldn't do that (trans_sid is set to 0 in php.ini). The problem is that the UnitTest will fail right at the beginning because Login-Information do not get stored. How can I configure Cookie-Handling? Is there any way around this? Who can help? Answers appreciated :) Thx 4 ur time Regards Thorsten |
From: Thorsten Suckow-H. <ts...@as...> - 2004-07-21 13:53:27
|
Hey everyone, right now I write some UnitTests for a large PHP-Application using HtmlUnit= . The problem I have is that the http-client seems to append the Session-ID= automatically to links etc., while it shouldn't do that (trans_sid is set = to 0 in php.ini). The problem is that the UnitTest will fail right at the b= eginning because Login-Information do not get stored. How can I configure Cookie-Handling? Is there any way around this? Who can help? Answers appreciated :) Thx 4 ur time Regards=20 Thorsten |
From: Mike B. <mb...@Ga...> - 2004-07-20 01:31:25
|
Jeff Wong wrote: > I looked almost all of the HTMLUnit website and I could not a link to a > 1.2.3 source distribution. I know there is source in the compiled 1.2.3 > version but I'd like to get a copy of 1.2.3 that comes with build scripts > or at least instructions on how to build 1.2.3. Does such a thing exist? > Or checking out the current version from CVS the best I can do? There have been a lot of fixes between 1.2.3 and the latest build so you're really better off with more recent code. The build instructions are at http://htmlunit.sourceforge.net/buildingFromCvs.html and if I recall correctly, those instructions are also applicable for 1.2.3. Hope this helps -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: Jeff W. <jef...@sa...> - 2004-07-19 23:58:57
|
Hi, I looked almost all of the HTMLUnit website and I could not a link to a 1.2.3 source distribution. I know there is source in the compiled 1.2.3 version but I'd like to get a copy of 1.2.3 that comes with build scripts or at least instructions on how to build 1.2.3. Does such a thing exist? Or checking out the current version from CVS the best I can do? Jeff |
From: Jeremie B. <jer...@ke...> - 2004-07-19 14:29:42
|
Hi, We have a problem with UTF8 encoding with htmlunit. With one of our application we notice that htmlunit send data in US-ASCII in header charset; we have seen that by logging httpclient in wire/debug mode. Or the server delivers UTF8 format. Is'nt there any solution to force UTF8 encoding for all sent data in htmlunit? Thx. |
From: Sam H. <sa...@re...> - 2004-07-14 01:39:46
|
Dear All, Think Ive got the prototype of a patch to add innerHTML to htmlunit but Im very new to the code so some hand holding/sanity check before I learn the coding standards and flesh out the unit tests would be very welcome. What I have in mind is jsSet_innerHTML in HTMLElement that calls a new HTMLParser.parse method. Adapt the DOMBuilder to not construct a HtmlPage but do that in the old parse method. Small addition of a flag to tell Necko if it should treat input as fragment or not. New/changed code pasted below. Worth finishing? Ideas for none obvious unit tests...? Also would a patch to switch to using httpclient authentication mechanism rather than htmlunits own be a good idea? Cheers Sam HTMLElement method: public final void jsSet_innerHTML(final String newHTML) { try { // remove existing children DomNode node = this.getDomNodeOrDie(); while (node.getFirstChild() != null) node.getFirstChild().remove(); HTMLParser.parse(node, newHTML); } catch (IOException ex) { ex.printStackTrace(); // TODO learn what the error handling rules are } } Rearrange HTMLParser a bit: /** * parse the HTML content from the given WebResponse into an object tree representation * * @param webResponse the response data * @param webWindow the web window into which the page is to be loaded * @return the page object which forms the root of the DOM tree, or <code>null</code> if the <HTML> * tag is missing * @throws java.io.IOException io error */ public static HtmlPage parse( final WebResponse webResponse, final WebWindow webWindow) throws IOException { HtmlPage page = new HtmlPage(webResponse.getUrl(), webResponse, webWindow); webWindow.setEnclosedPage(page); HtmlUnitDOMBuilder domBuilder = new HtmlUnitDOMBuilder(page, false); XMLInputSource in = new XMLInputSource( null, webResponse.getUrl().toString(), null, webResponse.getContentAsStream(), webResponse.getContentCharSet()); domBuilder.parse(in); return page; } public static void parse(DomNode node, String content) throws IOException { HtmlUnitDOMBuilder domBuilder = new HtmlUnitDOMBuilder(node, true); XMLInputSource in = new XMLInputSource( null, node.getPage().getWebResponse().getUrl().toString(), null, new ByteArrayInputStream(content.getBytes()), "utf-8"); domBuilder.parse(in); } static HTMLConfiguration x = new HTMLConfiguration(); /** * The parser and DOM builder. This class subclasses Xerces's AbstractSAXParser and implements * the ContentHandler interface. Thus all parser APIs are kept private. The ContentHandler methods * consume SAX events to build the page DOM */ private static class HtmlUnitDOMBuilder extends AbstractSAXParser implements ContentHandler /*, LexicalHandler */ { //private final WebResponse webResponse_; //private final WebWindow webWindow_; //private final ScriptFilter scriptFilter_; private final HtmlPage page_; private Locator locator_; private final Stack stack_ = new Stack(); private DomNode currentNode_; private StringBuffer characters_; /** * create a new builder for parsing the given response contents * @param webResponse the response data * @param webWindow the web window into which the page is to be loaded */ public HtmlUnitDOMBuilder(final DomNode node, boolean fragment) { super(new HTMLConfiguration()); //webResponse_ = webResponse; //webWindow_ = webWindow; currentNode_ = node; stack_.push(currentNode_); page_ = node.getPage(); ScriptFilter scriptFilter = new ScriptFilter((HTMLConfiguration) fConfiguration); // XXX OK that different to parser? reuse? page_.setScriptFilter(scriptFilter); scriptFilter.setHtmlPage(page_); try { XMLDocumentFilter[] filters = { scriptFilter }; setProperty( "http://cyberneko.org/html/properties/filters", filters); setFeature( "http://cyberneko.org/html/features/augmentations", true); setProperty( "http://cyberneko.org/html/properties/names/elems", "lower"); setFeature( "http://cyberneko.org/html/features/report-errors", true); if (fragment) { setFeature( "http://cyberneko.org/html/features/balance-tags/document-fragment", true); } } catch (SAXException e) { throw new ObjectInstantiationException( "unable to create HTML parser", e); } } /** * parse the input source. This is the only parse() method that should be called. * * @param inputSource an XMLInputSource * @throws java.io.IOException */ public void parse(XMLInputSource inputSource) throws IOException { setContentHandler(this); //setLexicalHandler(this); comments and CDATA super.parse(inputSource); } /** * @return the document locator */ public Locator getLocator() { return locator_; } /** * set the document locator * @param locator */ public void setDocumentLocator(Locator locator) { this.locator_ = locator; } /** SAX start document event */ public void startDocument() throws SAXException { } |
From: Prabu <Pra...@Su...> - 2004-07-13 04:44:08
|
Hi, I'm evaluating some QA Tools/ Framewords for testing a webbased application. The application starts with a basic authentication. Thouth I attach the credentials to the WebClient, I'm getting the exception saying NoCredentials found. Can somebody suggest me a workaround. Thanks in advance. Prabu |
From: Elise L. <el...@ch...> - 2004-06-28 17:08:36
|
I tried, didn't work. As for the html, this is kinda big but i'll just copy the frame information, to see if there is something obviously wrong... Thx! E this is the start point (cudlQA) <html> <head> </head> <FRAMESET cols=80%,20% border=5> <FRAME SRC="http://127.0.0.1:8080/cudl/modelSelector/StartCUDL.jsp" NAME="cudl"> <FRAME SRC="test.html" NAME="test"> </FRAMESET> </html> this is the "cudl" frame with all the jsp/javascript taken out for clarity: <html> <head> <script language="Javascript"> ...bunch of javascript to update the page... </script> </head> <body> <form name="myform" method="post" action="ModelSelectDebug.jsp"> ... </form> </body> </html> after the form submits here, this is where it's redirected (ModelSelectDebug): <html> <head> <script language="Javascript"> ...bunch of javascript to update the page... </script> </head> <frameset rows="100%,0%" frameborder=0 framespacing=0> <!--frame id="informationFrame" name="informationFrame" scrolling="no" target="contents" src="blank.html"--> <frame id="displayFrame" name="displayFrame" scrolling="yes" src="blank.html"> <frame id="dataFrame" name="dataFrame" scrolling="no" src="ModelSelectData.jsp<%=dataURLParameter%>"> </frameset> </html> That's where I try to go into displayFrame and end up in blank.html. This is part of the displayFrame: <%@ page import="com.chrome.cudlpsg.ChromeSessionHandler, com.chrome.cudlpsg.modelSelector.PagingHandler"%> <html> <script language="Javascript"> ...bunch of javascript to update the page... </script> </head> <body onLoad="Javascript:updatePage();" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" > <script language="Javascript"> document.write(...write the whole doc...) </body> </html> > Try doing mainFrameset = main.getFrames(); again after you click > Other than that I can"t tell much without seeing the HTML > Brad C --- Elise Lebeau <elebeau@ch...> wrote: > First, let me preface this with a comment that the code I am testing ain"t > pretty. They"re spitting out pages, within frames, by using document.write > for the whole thing, with some JSP sprinkled all over. Oh, and it"s a MVC > model. > So let me try to narrow down the problem: > > I have 4 frames. All of which have a src=blank.html. Then a form is > submitted and one of the frames is updated with information. The problem i > am running into is that I always end up in blank.html for all the frames. > > This is the test case: > final WebClient webClient = new WebClient(); > final URL url = new > URL("http://127.0.0.1:8080/cudl/cudlQA.html"); > > // Get the first page > final HtmlPage main = (HtmlPage)webClient.getPage(url); > List mainFrameset = main.getFrames(); > final HtmlFrame testFrame = (HtmlFrame)mainFrameset.get(1); > final HtmlPage test = (HtmlPage)testFrame.getEnclosedPage(); > > //this setups some fields in the form > ((HtmlAnchor) test.getAnchors().get(0)).click(); > ((HtmlAnchor) test.getAnchors().get(1)).click(); > //this submits the form to update the display frame > ((HtmlAnchor) test.getAnchors().get(2)).click(); > > //this is to make sure that the page has time to reload > Thread.sleep(1000 * 20); > > final HtmlFrame cudlQAFrame = ((HtmlFrame)mainFrameset.get(0)); > final HtmlPage cudlQA = (HtmlPage)cudlQAFrame.getEnclosedPage(); > List modelSelectDebugFrame = cudlQA.getFrames(); > final HtmlPage display = > (HtmlPage)((HtmlFrame)modelSelectDebugFrame.get(2)).getEnclosedPage(); > System.out.println(display.getTitleText()); > > the display page is blank.html. > I thought that going back to the mainFrameset would give me an updated Frame > but it doesn"t. > Thanks for your help! > > Elise > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > digital self defense, top technical experts, no vendor pitches, > unmatched networking opportunities. Visit http://www.blackhat.com > _______________________________________________ > Htmlunit-user mailing list > Htmlunit-user@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > |
From: Elise L. <el...@ch...> - 2004-06-25 22:16:19
|
First, let me preface this with a comment that the code I am testing ain't pretty. They're spitting out pages, within frames, by using document.write for the whole thing, with some JSP sprinkled all over. Oh, and it's a MVC model. So let me try to narrow down the problem: I several nested frames, with the 2 main ones being app (which is what i'm testing) and test (which has some testing javascript functions and logging). Some of the app frames have a src=blank.html. A form is submitted and one of the app frames is updated with information using javascript. The problem is that I always end up in blank.html inseatd of the updated info. This is the test case: WebClient webClient = new WebClient(); URL url = new URL("http://127.0.0.1:8080/cudl/cudlQA.html"); // Get the test frames page HtmlPage main = (HtmlPage)webClient.getPage(url); List mainFrameset = main.getFrames(); HtmlFrame testFrame1 = (HtmlFrame)mainFrameset.get(1); HtmlPage test = (HtmlPage)testFrame1.getEnclosedPage(); HtmlFrame testFrame2 = (HtmlFrame)test.getFrames().get(0); HtmlPage testExec = (HtmlPage)testFrame2.getEnclosedPage(); //setup some fields in the form ((HtmlAnchor) testExec.getAnchors().get(0)).click(); //submit the form to update the display frame ((HtmlAnchor) testExec.getAnchors().get(2)).click(); //make sure that the page has time to reload Thread.sleep(1000 * 10); final HtmlFrame appFrame = ((HtmlFrame)mainFrameset.get(0)); final HtmlPage app = (HtmlPage)appFrame.getEnclosedPage(); List modelFrame = app.getFrames(); final HtmlPage display = (HtmlPage)((HtmlFrame)modelFrame.get(0)).getEnclosedPage(); System.out.println(display.getTitleText());the display page is blank.html. I see in the debugger that all frames are available but i always end up in blank.html. I thought that going back to the mainFrameset would give me an updated Frame but it doesn't. Does anyone see anything obvious? Thanks for your help! Elise |