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: Ducloux V. <vdu...@co...> - 2005-04-20 16:06:07
|
Hi everybody, I succeeding in doing some things with htmlunit and forms... but now I would like to know how to search a certain text in a web page=20 like 'Welcome to my web page'... I really can't find out in the api doc.... Thanks in advance, Victor --=20 Victor Ducloux | Stagiaire T=E9l portable : +33 6 60 41 76 03 *c o s m o s b a y ~ v e c t i s* 10, rue du Faubourg Poissonni=E8re - 75010 Paris - www.cosmosbay-vectis.com T=E9l g=E9n=E9ral : +33 1 53 24 67 80 - Fax : +33 1 53 24 67 89 |
From: <ddk...@ki...> - 2005-04-19 22:01:30
|
Do you want to assert that certain elements exist within the HTML document? If so, you may want to use an XPath query to do that, or you may want to assign "id" attributes to particular elements so that you may find them by their "id". Dave On Tue, Apr 19, 2005 at 02:37:54PM -0700, Dantes, Ed wrote: > Hello, > I am trying to check what the HTML looks like after I click on a > link, I am able to navigate through the pages, however I am having > difficulty checking to see what the HTML looks like. Already knowing > what it is supposed to look like, I can write an assertEquals(..) but I > do not know what the other parameter would be...What particular class > and method would I used to do this?? > > Thanks > Ed |
From: Brad C. <yo...@br...> - 2005-04-19 21:55:23
|
Depends if you want it before or after HtmlUnit has made any modifications, but this should point you in the right direction: private WebClient getClient() { return this.client; } private Page getCurrentPage() { return getClient().getCurrentWindow().getEnclosedPage(); } public String getCurrentPageAsFixedXml() { final HtmlPage p = (HtmlPage) getCurrentPage(); return p.getDocumentElement().asXml(); } public String getCurrentPageAsRawText() { return getCurrentPage().getWebResponse().getContentAsString(); } Brad C --- "Dantes, Ed" <Ed....@gd...> wrote: > Hello, > I am trying to check what the HTML looks like after I click on a > link, I am able to navigate through the pages, however I am having > difficulty checking to see what the HTML looks like. Already knowing > what it is supposed to look like, I can write an assertEquals(..) but I > do not know what the other parameter would be...What particular class > and method would I used to do this?? > > Thanks > Ed > |
From: Dantes, E. <Ed....@gd...> - 2005-04-19 21:40:16
|
Hello, I am trying to check what the HTML looks like after I click on a link, I am able to navigate through the pages, however I am having difficulty checking to see what the HTML looks like. Already knowing what it is supposed to look like, I can write an assertEquals(..) but I do not know what the other parameter would be...What particular class and method would I used to do this?? Thanks Ed |
From: Bhupesh R. S. <bhu...@vi...> - 2005-04-19 09:47:05
|
Sorry I thought that getFrameset() is an inbuilt script function. That's why I've even put it as the same in the subject. Here is the getFrameset() method /** * function called to access frame elements=20 * */ function getFrameset(aFrame) { if (document.getElementById) { elm =3D parent.document.getElementById(aFrame); } else if (document.all) { elm =3D parent.frames[1].document.all[aFrame]; } else if (document.layers) { elm =3D parent.frames[1].document.layers[aFrame]; } return elm; } And calling getFrameset("bottom") is returning null. -----Original Message----- From: htm...@li... [mailto:htm...@li...] On Behalf Of Marc Guillemot Sent: Tuesday, April 19, 2005 3:07 PM To: htm...@li... Subject: Re: [Htmlunit-user] Urgent: JavaScript: getFrameset(""); returningnull Hi, welcome to hmlunit. The problem is that your js function getFrameset("bottom") returns null. I can't say more on it because you didn't provide its code. The next issue that may appears, is that property cols of the frameset js object isn't implemented now in htmlunit. But this could possibly work because it will be set as a normal dynamic property on the object. Please open a bug issue with this example and the code of your getFrameset function (reduced to the minimal is better). Concerning the log messages, see: http://htmlunit.sourceforge.net/faq.html#RedirectionDiagnosticMessages The "Expected content type of text/javascript but got [text/html]" means that your webserver sends javascript files with an incorrect content type. Marc. Bhupesh Reddy Sura wrote: > *I am migrating from HttpUnit to HtmlUnit. I am trying to login to my=20 > application from HtmlUnit.* > =20 > *Here is the test case.* > =20 > public void testHtmlUnit() throws IOException > { > WebClient wc =3D new WebClient(); > wc.setRedirectEnabled(true); > URL url =3D new URL("http://localhost:8080/abc/abc_frameset.jsp"); > HtmlPage page =3D (HtmlPage)wc.getPage(url); > =20 > HtmlForm form =3D page.getFormByName("mainForm"); > HtmlSubmitInput loginButton =3D=20 > (HtmlSubmitInput)form.getHtmlElementById("loginButton"); > HtmlTextInput username =3D (HtmlTextInput)=20 > form.getInputByName("j_username"); > HtmlPasswordInput password =3D (HtmlPasswordInput)=20 > form.getInputByName("j_password"); > username.setValueAttribute("zdpm_admin"); > password.setValueAttribute("zdpm_admin"); > HtmlPage page2 =3D (HtmlPage) loginButton.click(); > //System.out.println(page2.toString()); > =20 > } > =20 > *When I run it, I get the following exception.* > =20 > =3D=3D=3D=3D=3D=3D=3D EXCEPTION START =3D=3D=3D=3D=3D=3D=3D=3D > EcmaError: lineNumber=3D[148] column=3D[0] lineSource=3D[null]=20 > name=3D[TypeError] sourceName=3D[/abc/jscripts/navbar.js] > message=3D[TypeError: Cannot set property "cols" of null to "0,*"=20 > (/abc/jscripts/navbar.js#148)] > *com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot set=20 > property "cols" of null to "0,*" (/abc/jscripts/navbar.js#148)* at > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction > (JavaScriptEngine.java:344) > at > com.gargoylesoftware.htmlunit.html.HtmlPage.executeOnLoadHandlersIfNee > ded(HtmlPage.java:953) > at > com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:1 > 58) > at > com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient. > java:701) at=20 > com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:361) > . > . > . > *The line 148 of navbar.js has the following code. hideLeftnav()=20 > method is called from the onLoad event.* > =20 > 146 function hideLeftnav() { > 147 var bottom =3D getFrameset("bottom") ; > 148 bottom.cols=3D"0,*"; > 149 } > =20 > *my frameset looks like this.* > =20 > <frameset id=3D"application" title=3D"Application" rows=3D"60,0,*" > framespacing=3D"0" frameborder=3D"1" > > <frame noresize id=3D"navbar" name=3D"navbar" src=3D"<%=3D navbar = %>" > marginwidth=3D"0" marginheight=3D"0" scrolling=3D"no" frameborder=3D"0"> > <frame noresize id=3D"subnavbar" name=3D"subnavbar" src=3D"subNavblank.jsp" > marginwidth=3D"0" marginheight=3D"0" scrolling=3D"no" frameborder=3D"0"> > *<frameset id=3D"bottom" title=3D"bottom" cols=3D"<%=3D bodysize = %>"=20 > framespacing=3D"0"> > * <frame class=3D"leftNav" id=3D"leftNav" name=3D"leftNav" = noresize=20 > src=3D"<%=3D leftnav %>" > marginwidth=3D"0" marginheight=3D"0" frameborder=3D"0"=20 > scrolling=3D"auto"> > <frame class=3D"workArea" id=3D"workarea" name=3D"workArea" > marginwidth=3D"0" marginheight=3D"0" > scrolling=3D"auto" frameborder=3D"0" src=3D"<%=3D = workarea %>"> > </frameset> > </frameset> > =20 > *Apparantly getFrameset("bottom"); is returning null. But when I run=20 > it from the browser (IE 6), it is working fine. It is working even=20 > from the HttpUnit test case. Can anyone explain why this is=20 > happening.* > ** > *also i am getting lot of warnings and info's on my console. some of=20 > them include* > ** > =20 > Apr 19, 2005 10:45:43 AM com.gargoylesoftware.htmlunit.html.HtmlPage > loadJavaScriptFromUrl > WARNING: Expected content type of text/javascript or=20 > application/x-javascript for remotely loaded javascript element=20 > http://localhost:8080/abc/errors/images/login.js > <http://localhost:8080/abc/errors/images/login.js> but got [text/html] > Apr 19, 2005 10:45:45 AM=20 > org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded > INFO: *Redirect requested but followRedirects is disabled* > =20 > *I have explicitly added webClient.setRedirectEnabled(true); in my code.=20 > but why i am still getting the *INFO: *Redirect requested but=20 > followRedirects is disabled.* > ** > *What does the warning *Expected content type of text/javascript but=20 > got [text/html] *means.* > ** > ** ------------------------------------------------------- This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728 _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Marc G. <mgu...@ya...> - 2005-04-19 09:35:39
|
Hi, welcome to hmlunit. The problem is that your js function getFrameset("bottom") returns null. I can't say more on it because you didn't provide its code. The next issue that may appears, is that property cols of the frameset js object isn't implemented now in htmlunit. But this could possibly work because it will be set as a normal dynamic property on the object. Please open a bug issue with this example and the code of your getFrameset function (reduced to the minimal is better). Concerning the log messages, see: http://htmlunit.sourceforge.net/faq.html#RedirectionDiagnosticMessages The "Expected content type of text/javascript but got [text/html]" means that your webserver sends javascript files with an incorrect content type. Marc. Bhupesh Reddy Sura wrote: > *I am migrating from HttpUnit to HtmlUnit. I am trying to login to my > application from HtmlUnit.* > > *Here is the test case.* > > public void testHtmlUnit() throws IOException > { > WebClient wc = new WebClient(); > wc.setRedirectEnabled(true); > URL url = new URL("http://localhost:8080/abc/abc_frameset.jsp"); > HtmlPage page = (HtmlPage)wc.getPage(url); > > HtmlForm form = page.getFormByName("mainForm"); > HtmlSubmitInput loginButton = > (HtmlSubmitInput)form.getHtmlElementById("loginButton"); > HtmlTextInput username = (HtmlTextInput) > form.getInputByName("j_username"); > HtmlPasswordInput password = (HtmlPasswordInput) > form.getInputByName("j_password"); > username.setValueAttribute("zdpm_admin"); > password.setValueAttribute("zdpm_admin"); > HtmlPage page2 = (HtmlPage) loginButton.click(); > //System.out.println(page2.toString()); > > } > > *When I run it, I get the following exception.* > > ======= EXCEPTION START ======== > EcmaError: lineNumber=[148] column=[0] lineSource=[null] > name=[TypeError] sourceName=[/abc/jscripts/navbar.js] > message=[TypeError: Cannot set property "cols" of null to "0,*" > (/abc/jscripts/navbar.js#148)] > *com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot set > property "cols" of null to "0,*" (/abc/jscripts/navbar.js#148)* > at > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:344) > at > com.gargoylesoftware.htmlunit.html.HtmlPage.executeOnLoadHandlersIfNeeded(HtmlPage.java:953) > at > com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:158) > at > com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:701) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:361) > . > . > . > *The line 148 of navbar.js has the following code. hideLeftnav() method > is called from the onLoad event.* > > 146 function hideLeftnav() { > 147 var bottom = getFrameset("bottom") ; > 148 bottom.cols="0,*"; > 149 } > > *my frameset looks like this.* > > <frameset id="application" title="Application" rows="60,0,*" > framespacing="0" frameborder="1" > > <frame noresize id="navbar" name="navbar" src="<%= navbar %>" > marginwidth="0" marginheight="0" scrolling="no" frameborder="0"> > <frame noresize id="subnavbar" name="subnavbar" src="subNavblank.jsp" > marginwidth="0" marginheight="0" scrolling="no" frameborder="0"> > *<frameset id="bottom" title="bottom" cols="<%= bodysize %>" > framespacing="0"> > * <frame class="leftNav" id="leftNav" name="leftNav" noresize > src="<%= leftnav %>" > marginwidth="0" marginheight="0" frameborder="0" > scrolling="auto"> > <frame class="workArea" id="workarea" name="workArea" > marginwidth="0" marginheight="0" > scrolling="auto" frameborder="0" src="<%= workarea %>"> > </frameset> > </frameset> > > *Apparantly getFrameset("bottom"); is returning null. But when I run it > from the browser (IE 6), it is working fine. It is working even from the > HttpUnit test case. Can anyone explain why this is happening.* > ** > *also i am getting lot of warnings and info's on my console. some of > them include* > ** > > Apr 19, 2005 10:45:43 AM com.gargoylesoftware.htmlunit.html.HtmlPage > loadJavaScriptFromUrl > WARNING: Expected content type of text/javascript or > application/x-javascript for remotely loaded javascript element > http://localhost:8080/abc/errors/images/login.js > <http://localhost:8080/abc/errors/images/login.js> but got [text/html] > Apr 19, 2005 10:45:45 AM > org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded > INFO: *Redirect requested but followRedirects is disabled* > > *I have explicitly added webClient.setRedirectEnabled(true); in my code. > but why i am still getting the *INFO: *Redirect requested but > followRedirects is disabled.* > ** > *What does the warning *Expected content type of text/javascript but got > [text/html] *means.* > ** > ** |
From: Bhupesh R. S. <bhu...@vi...> - 2005-04-19 09:08:41
|
I am migrating from HttpUnit to HtmlUnit. I am trying to login to my application from HtmlUnit. =20 Here is the test case. =20 public void testHtmlUnit() throws IOException=20 { WebClient wc =3D new WebClient(); wc.setRedirectEnabled(true); URL url =3D new URL("http://localhost:8080/abc/abc_frameset.jsp"); HtmlPage page =3D (HtmlPage)wc.getPage(url); =20 HtmlForm form =3D page.getFormByName("mainForm"); HtmlSubmitInput loginButton =3D (HtmlSubmitInput)form.getHtmlElementById("loginButton"); HtmlTextInput username =3D (HtmlTextInput) form.getInputByName("j_username"); HtmlPasswordInput password =3D (HtmlPasswordInput) form.getInputByName("j_password"); username.setValueAttribute("zdpm_admin"); password.setValueAttribute("zdpm_admin"); HtmlPage page2 =3D (HtmlPage) loginButton.click(); //System.out.println(page2.toString()); =20 } =20 When I run it, I get the following exception. =20 =3D=3D=3D=3D=3D=3D=3D EXCEPTION START =3D=3D=3D=3D=3D=3D=3D=3D EcmaError: lineNumber=3D[148] column=3D[0] lineSource=3D[null] name=3D[TypeError] sourceName=3D[/abc/jscripts/navbar.js] message=3D[TypeError: Cannot set property "cols" of null to "0,*" (/abc/jscripts/navbar.js#148)] com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot set property "cols" of null to "0,*" (/abc/jscripts/navbar.js#148) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(J avaScriptEngine.java:344) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeOnLoadHandlersIfNeede d(HtmlPage.java:953) at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:158 ) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.ja va:701) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:361) . . . The line 148 of navbar.js has the following code. hideLeftnav() method is called from the onLoad event. =20 146 function hideLeftnav() { 147 var bottom =3D getFrameset("bottom") ; 148 bottom.cols=3D"0,*"; 149 } =20 my frameset looks like this. =20 <frameset id=3D"application" title=3D"Application" rows=3D"60,0,*" framespacing=3D"0" frameborder=3D"1" > <frame noresize id=3D"navbar" name=3D"navbar" src=3D"<%=3D navbar = %>" marginwidth=3D"0" marginheight=3D"0" scrolling=3D"no" frameborder=3D"0"> <frame noresize id=3D"subnavbar" name=3D"subnavbar" src=3D"subNavblank.jsp"=20 marginwidth=3D"0" marginheight=3D"0" scrolling=3D"no" frameborder=3D"0"> <frameset id=3D"bottom" title=3D"bottom" cols=3D"<%=3D bodysize %>" framespacing=3D"0"> <frame class=3D"leftNav" id=3D"leftNav" name=3D"leftNav" noresize src=3D"<%=3D leftnav %>" marginwidth=3D"0" marginheight=3D"0" frameborder=3D"0" scrolling=3D"auto"> <frame class=3D"workArea" id=3D"workarea" name=3D"workArea"=20 marginwidth=3D"0" marginheight=3D"0"=20 scrolling=3D"auto" frameborder=3D"0" src=3D"<%=3D = workarea %>"> </frameset> </frameset> =20 Apparantly getFrameset("bottom"); is returning null. But when I run it from the browser (IE 6), it is working fine. It is working even from the HttpUnit test case. Can anyone explain why this is happening. =20 also i am getting lot of warnings and info's on my console. some of them include =20 =20 Apr 19, 2005 10:45:43 AM com.gargoylesoftware.htmlunit.html.HtmlPage loadJavaScriptFromUrl WARNING: Expected content type of text/javascript or application/x-javascript for remotely loaded javascript element http://localhost:8080/abc/errors/images/login.js <http://localhost:8080/abc/errors/images/login.js> but got [text/html] Apr 19, 2005 10:45:45 AM org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded INFO: Redirect requested but followRedirects is disabled =20 I have explicitly added webClient.setRedirectEnabled(true); in my code. but why i am still getting the INFO: Redirect requested but followRedirects is disabled. =20 What does the warning Expected content type of text/javascript but got [text/html] means. =20 =20 |
From: Jeff M. <jma...@ho...> - 2005-04-13 15:38:53
|
Sorry about the confusion. Based upon what you said and my own personal feeling, yes, the FormElementArray class should be able to get elements by id (as described in the context of the problem I encountered). I'll open it up as an issue so that it can be reviewed and/or worked as appropriate. Thanks. Jeff >From: Marc Guillemot <mgu...@ya...> >Reply-To: htm...@li... >To: htm...@li... >Subject: Re: [Htmlunit-user] JavaScript Errors - Solution/Follow-up >Date: Wed, 13 Apr 2005 17:33:16 +0200 > >Jeff, > >how your html is generated doesn't matter for htmlunit... and makes your >mail more complicate to understand for readers. > >In your example the html changed from >... id="sendButton" >to >... name="sendButton" > >From the problem you describe, I understand that ElementArray should be >able to get elements by id. If this is really the case, can you please open >a bug issue for that. > >Marc. |
From: Marc G. <mgu...@ya...> - 2005-04-13 15:31:39
|
Jeff, how your html is generated doesn't matter for htmlunit... and makes your mail more complicate to understand for readers. In your example the html changed from ... id="sendButton" to ... name="sendButton" From the problem you describe, I understand that ElementArray should be able to get elements by id. If this is really the case, can you please open a bug issue for that. Marc. Jeff Marendo wrote: > I deleted the reply that I received from Chris Erskine back in February > regarding my original posting, but it is still listed in the user group > archive. It can be found at: > > http://sourceforge.net/mailarchive/message.php?msg_id=10991620 > > This message contains the solution to that posting. As a refresher, > here was the problem that I was getting at the time when I was executing > a HtmlUnit test case against our code: > > org.mozilla.javascript.EvaluatorException: The undefined value has no > properties > > After stepping through the source code for both Rhino and HtmlUnit, I > found that the problem was related to how a method in the > com.gargolyesoftware.htmlunit.javascript.FormElementArray was working > with our choice of usage for a submit button. In other words, the > JavaScript that was in the process of being executed via the Rhino stuff > needed to get the related components from the HtmlUnit framework, and > that's where the problem was happening. > > The specific JavaScript that was in the process of being executed was > related to an onSubmit event, which was related to our submit button (in > a form within a JSP). The thing is that we were using a > org.apache.strutsel.taglib.html.ELSubmitTag from the Struts tag > extension library for our submit button. The implementation for that > tag and its ancestors does not appear to have a "name" attribute, which > is fine as far as our application is concerned b/c it works without a > hitch (we were using the "id" attribute instead). However, when trying > to execute our code via the test framework, there is one point at which > the FormElementArray class tries to get a handle to our submit button in > the get(final String name, final Scriptable start) method. > > Within that method, it iterates through all of the form elements on the > page from which the current request is being made. It gets these > elements and tries to find a match for the attribute being used at the > time, which for this specific example was the name of our button taken > from this portion of JavaScript that was being executed: > > document.cmsForm.elements.sendButton.disabled = true; > > That is, it was trying to get our button ("sendButton") in this portion > of the FormElementArray get() method: > > if( htmlElement.getAttributeValue("name").equals(name) ) { > > But, b/c we were using the Struts EL submit button, which doesn't > support the "name" attribute, it wasn't being found as intended. So > eventually what happens is that the code continues on and tries to find > the "disabled" attribute for our button object, which is listed at that > point as undefined. Hence the EvaluatorException that is seen, ultimately. > > I ended up changing our code like so to ensure our submit button would > be found: > > <%-- > <html-el:submit value="Send to CMS" > styleClass="formFont" > accesskey="s" styleId="sendButton"> > </html-el:submit> > --%> > <input type="submit" value="Send to CMS" > class="formFont" accesskey="s" name="sendButton" > id="sendButton" /> > > That seems to work. Hopefully this will help others within the HtmlUnit > user community and perhaps the development community as well. > > Jeff > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: Jeff M. <jma...@ho...> - 2005-04-13 13:41:44
|
I deleted the reply that I received from Chris Erskine back in February regarding my original posting, but it is still listed in the user group archive. It can be found at: http://sourceforge.net/mailarchive/message.php?msg_id=10991620 This message contains the solution to that posting. As a refresher, here was the problem that I was getting at the time when I was executing a HtmlUnit test case against our code: org.mozilla.javascript.EvaluatorException: The undefined value has no properties After stepping through the source code for both Rhino and HtmlUnit, I found that the problem was related to how a method in the com.gargolyesoftware.htmlunit.javascript.FormElementArray was working with our choice of usage for a submit button. In other words, the JavaScript that was in the process of being executed via the Rhino stuff needed to get the related components from the HtmlUnit framework, and that's where the problem was happening. The specific JavaScript that was in the process of being executed was related to an onSubmit event, which was related to our submit button (in a form within a JSP). The thing is that we were using a org.apache.strutsel.taglib.html.ELSubmitTag from the Struts tag extension library for our submit button. The implementation for that tag and its ancestors does not appear to have a "name" attribute, which is fine as far as our application is concerned b/c it works without a hitch (we were using the "id" attribute instead). However, when trying to execute our code via the test framework, there is one point at which the FormElementArray class tries to get a handle to our submit button in the get(final String name, final Scriptable start) method. Within that method, it iterates through all of the form elements on the page from which the current request is being made. It gets these elements and tries to find a match for the attribute being used at the time, which for this specific example was the name of our button taken from this portion of JavaScript that was being executed: document.cmsForm.elements.sendButton.disabled = true; That is, it was trying to get our button ("sendButton") in this portion of the FormElementArray get() method: if( htmlElement.getAttributeValue("name").equals(name) ) { But, b/c we were using the Struts EL submit button, which doesn't support the "name" attribute, it wasn't being found as intended. So eventually what happens is that the code continues on and tries to find the "disabled" attribute for our button object, which is listed at that point as undefined. Hence the EvaluatorException that is seen, ultimately. I ended up changing our code like so to ensure our submit button would be found: <%-- <html-el:submit value="Send to CMS" styleClass="formFont" accesskey="s" styleId="sendButton"> </html-el:submit> --%> <input type="submit" value="Send to CMS" class="formFont" accesskey="s" name="sendButton" id="sendButton" /> That seems to work. Hopefully this will help others within the HtmlUnit user community and perhaps the development community as well. Jeff |
From: Denis N. A. <den...@ca...> - 2005-04-05 21:04:14
|
we now have (3) <verifyxpath xpath=3D"/html/body/h2" text=3D"Resultate f�fc;r das=20= Team 33" /> (4) <verifyxpath xpath=3D"/html/body/h2" text=3D"Resultate = f&#x00fc;r=20 das Team 33" /> Solution (3) is equivalent to solution (1), in that the webtest method=20= only sees the single character '=FC', whereas in solution (4) the test=20= method sees the six characters '&' '#' '0' '0' 'f' 'c' ';' and must=20 convert this charcter sequence to the single '=FC'. Isn't it interesting that, as Brad noted, his e-mail application=20 transformed (3) into (1)? It shows that keeping text valid across=20 platforms entails far more than 'a character-set declaration and a good=20= editor': I've also seen text file corrupted when transferred over cvs=20 (i.e. check in from a pc, check out on a solaris account), copied on a=20= usb stick, filtered with ant, ... ... So the experts' opinion seems to be not to change htmlunit and 'play'=20 with the webtest's parameters. I'll try this :-) Thank you for your help! dna On 5 avr. 05, at 09:23, Marc Guillemot wrote: > Hi, > > I think that there are here 2 issues: entity resolution and character=20= > encoding. > > Conversion from ü to =FC is "only" entity resolution and I don't=20= > think that the character encoding matters here (except that my email=20= > is iso-8859-1 encoded). > Solution (3) should probably have been: > (3) <verifyxpath xpath=3D"/html/body/h2" text=3D"Resultate = f&#x00fc;r=20 > das Team 33" /> > In this case when the text is interpreted as html, the =FC is = specified=20 > with its unicode code but it doesn't mean that the character encoding=20= > of the file is unicode. > > I agree with Brad that it should be the job of webtest to convert (2)=20= > or (3) to (1). What the character encoding of ant files concern, it=20 > should be placed in the first line of the file like: > <?xml version=3D"1.0" encoding=3D"ISO-8859-1"?> > and serious editors should take care of it on all OS. > > The issue that could concern htmlunit would be: do we want to have the=20= > possibility to know how the source of node was written or are we only=20= > interested in it representation in the page's encoding? Personally I=20= > don't see the interest to be able to determine if for instance a=20 > <b>f=FCr</b> was coded as <b>f=FCr</b>, <b>fü</b> or=20 > <b>fü</b>. The only case in which I could imagine that it may=20= > have an interess is for someone that would like to ensure that ONLY=20 > ascci characters are used in pages (but why?). In this case I would=20 > rather perform the test on the whole page's code rather than on single=20= > nodes. > > Marc. > > Brad Clarke wrote: >> It seems like (1) would be the appropriate thing to do. While I=20 >> understand your >> cross-platform concern I think the appropriate place to address that=20= >> concern would >> be as close to the problem as possible: create a way for webtest to=20= >> read something >> like (2) or (3) and turn it into (1) before passing it along to=20 >> htmlunit (I know >> little of webtest or ant's encoding issues but being xml based I'm=20 >> actually quite >> surprised you can't do this already). >> Also, after briefly looking at the character set determination in=20 >> htmlunit it's >> entirely possible that we're interpreting something incorrectly since=20= >> I don't see >> anything that will use a char set in the html file (which seems a=20 >> little backwards >> anyway but it should be possible). >> Brad C >> PS Yahoo Mail converted your (3) into (1) when I replied to this=20 >> message! :D >> --- "Denis N. Antonioli" <den...@ca...> wrote: >>> what I really want is to write simple, robust tests that handle=20 >>> extended character sets (internationalization?) without excessive=20 >>> magic. >>> >>> In the present situation, I have an html page that comes from the=20 >>> server with an encoding and gets translated by htmlunit into a=20 >>> different encoding. As far as I know, that last encoding can be=20 >>> determined by the web server, by the content of the html page or by=20= >>> some default. >>> On the other side, I write tests in xml documents which are again=20 >>> translated by an xml parser (ant) into a different encoding. >>> >>> The first problem I have is: how to code in the xml document=20 >>> non-ascii characters (such as an uuml or a nbsp)? >>> >>> (1) <verifyxpath xpath=3D"/html/body/h2" text=3D"Resultate f=FCr das = Team=20 >>> 33" /> >>> (2) <verifyxpath xpath=3D"/html/body/h2" text=3D"Resultate = f&uuml;r=20 >>> das Team 33" /> >>> (3) <verifyxpath xpath=3D"/html/body/h2" text=3D"Resultate f=FCr das = Team=20 >>> 33" /> >>> >>> >>> Then comes: And how to do it in a way that makes the xml document=20 >>> robust in a multi-platform environment? I have seen enough files=20 >>> with =FC or =E9 written on a PC becoming unreadable once moved to, = e.g.,=20 >>> a Mac or a Linux computer. I'd rather not use solution (1). >>> >>> So, in solution (2), there is a comparison of the ascii characters=20= >>> 'ü' , which will most probably be the same in all situations. >>> In solution (3), am I sure that htmlunit will always translate to=20 >>> unicode? >>> >>> >>> Best >>> dna >>> >>> >>> On 1 avr. 05, at 21:09, Brad Clarke wrote: >>> >>> >>>> I don't really understand why you'd want this. Once the document=20 >>>> has already been >>>> parsed why does it matter if it was an enitity or not? What exactly=20= >>>> are you testing >>>> that you need to know an enitity was used? >>>> >>>> The test failures are a known bug in a supporting library that will=20= >>>> be fixed when >>>> that library is released again. >>>> >>>> Brad C >>>> >>>> --- "Denis N. Antonioli" <den...@ca...> wrote: >>>> >>>> >>>>> Hi Marc >>>>> >>>>> I had to find the time to look into it before posting again... >>>>> >>>>> On a practical level: I modified locally the head htmlunit from=20 >>>>> cvs to >>>>> behave as proposed, and the changes amount to less than 10=20 >>>>> statements >>>>> in the productive code, including a pair of setter/getter. The=20 >>>>> included >>>>> unit tests, at least, show no impacts on the rest of the=20 >>>>> functionality. >>>>> >>>>> I see your point, most (all?) common browsers give us a only view=20= >>>>> on >>>>> the original document. I do think though that the functionality=20 >>>>> belongs >>>>> to htmlunit for three main reasons. >>>>> >>>>> First, I find it easier to let the entitites untouched, rather = than >>>>> converting them to characters in htmlunit and converting the=20 >>>>> characters >>>>> back to entities in webtest. >>>>> >>>>> Second, the two conversions won't be equivalent to the original >>>>> document. Should the original document contains a mix of entities=20= >>>>> and >>>>> characters, the final document will contain only characters (as=20 >>>>> now) or >>>>> only entities. >>>>> >>>>> Third, the need for unconverted entities may arise by other user = of >>>>> htmlunit. The necessary conversion code would then be replicated. >>>>> >>>>> >>>>> By the way, I could not test htmlunit with maven 1.0.2, maven >>>>> complained about attempting to execute scripts that had been=20 >>>>> garbage >>>>> collected. Is this known? >>>>> >>>>> >>>>> Best >>>>> dna >>>>> >>>>> On 25 mars 05, at 13:53, Marc Guillemot wrote: >>>>> >>>>> >>>>>> Hi Denis, >>>>>> >>>>>> I now think that htmlunit should resolve the entities as it does=20= >>>>>> and >>>>>> that it would be wrong to have the entity code "as it". My=20 >>>>>> motivation >>>>>> comes from the comparison with browsers: except view source,=20 >>>>>> which is >>>>>> comparable to WebResponse.getContentAsString(), the different=20 >>>>>> methods >>>>>> to access the source show the resolved entity: in js innerHTML or >>>>>> innerText (for IE) and View selection source (for Mozilla).=20 >>>>>> Therefore >>>>>> I think that htmlunit behaves like browsers, what is correct, and=20= >>>>>> that >>>>>> we should handle it only in webtest. >>>>>> >>>>>> Marc. >>>>>> >>>>>> Denis N. Antonioli wrote: >>>>>> >>>>>>> Hi >>>>>>> I'm using htmlunit through webtest (<http://webtest.canoo.com>,=20= >>>>>>> for >>>>>>> those that don't know it). >>>>>>> In the present case, Webtest lets htmlunit generate a dom of an=20= >>>>>>> html >>>>>>> page before querying the document with xpath. >>>>>>> For example <verifyxpath xpath=3D"/html/body/h2" = text=3D"Resultate"/> >>>>>>> makes sure that a h2 header displays the text 'Resultate'. >>>>>>> I have the problem that, at some time, the text I want webtest = to >>>>>>> verify is using html entities: >>>>>>> <verifyxpath xpath=3D"/html/body/h2" text=3D"Resultate = f&uuml;r=20 >>>>>>> das >>>>>>> Team 33"/> >>>>>>> With the help of Marc, I've found that htmlunit is always=20 >>>>>>> generating >>>>>>> a dom where all entities have been resolved. >>>>>>> nekohtml seems to provide a feature >>>>>>> (http://apache.org/xml/features/scanner/notify-builtin-refs) to=20= >>>>>>> tell >>>>>>> when/where the >>>>>>> source contains entities (see description at >>>>>>> = <http://cvs.apache.org/~andyc/neko/doc/html/settings.html#notify- >>>>>>> builtin-html-refs>). >>>>>>> Does someone know if it is possible to get a dom tree in which=20= >>>>>>> the >>>>>>> text nodes contain entitites instead of characters? >>>>>>> Does it make sense? >>>>>>> Was it already tried? >>>>>>> Would it be difficult? >>>>>>> dna >> ------------------------------------------------------- >> SF email is sponsored by - The IT Product Guide >> Read honest & candid reviews on hundreds of IT Products from real=20 >> users. >> Discover which products truly live up to the hype. Start reading now. >> http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick >> _______________________________________________ >> Htmlunit-user mailing list >> Htm...@li... >> https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real=20 > users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > --=20 in a flash of inspiration she had discovered the comic possibilities of=20= the semi-colon, and of this she had made abundant and exquisite use. -- W. Somerset Maugham, The creative impulse |
From: Marc G. <mgu...@ya...> - 2005-04-05 07:21:49
|
Hi, I think that there are here 2 issues: entity resolution and character encoding. Conversion from ü to ü is "only" entity resolution and I don't think that the character encoding matters here (except that my email is iso-8859-1 encoded). Solution (3) should probably have been: (3) <verifyxpath xpath="/html/body/h2" text="Resultate f&#x00fc;r das Team 33" /> In this case when the text is interpreted as html, the ü is specified with its unicode code but it doesn't mean that the character encoding of the file is unicode. I agree with Brad that it should be the job of webtest to convert (2) or (3) to (1). What the character encoding of ant files concern, it should be placed in the first line of the file like: <?xml version="1.0" encoding="ISO-8859-1"?> and serious editors should take care of it on all OS. The issue that could concern htmlunit would be: do we want to have the possibility to know how the source of node was written or are we only interested in it representation in the page's encoding? Personally I don't see the interest to be able to determine if for instance a <b>für</b> was coded as <b>für</b>, <b>fü</b> or <b>fü</b>. The only case in which I could imagine that it may have an interess is for someone that would like to ensure that ONLY ascci characters are used in pages (but why?). In this case I would rather perform the test on the whole page's code rather than on single nodes. Marc. Brad Clarke wrote: > It seems like (1) would be the appropriate thing to do. While I understand your > cross-platform concern I think the appropriate place to address that concern would > be as close to the problem as possible: create a way for webtest to read something > like (2) or (3) and turn it into (1) before passing it along to htmlunit (I know > little of webtest or ant's encoding issues but being xml based I'm actually quite > surprised you can't do this already). > > Also, after briefly looking at the character set determination in htmlunit it's > entirely possible that we're interpreting something incorrectly since I don't see > anything that will use a char set in the html file (which seems a little backwards > anyway but it should be possible). > > Brad C > > PS Yahoo Mail converted your (3) into (1) when I replied to this message! :D > > --- "Denis N. Antonioli" <den...@ca...> wrote: > > >>what I really want is to write simple, robust tests that handle >>extended character sets (internationalization?) without excessive >>magic. >> >>In the present situation, I have an html page that comes from the >>server with an encoding and gets translated by htmlunit into a >>different encoding. As far as I know, that last encoding can be >>determined by the web server, by the content of the html page or by >>some default. >>On the other side, I write tests in xml documents which are again >>translated by an xml parser (ant) into a different encoding. >> >>The first problem I have is: how to code in the xml document non-ascii >>characters (such as an uuml or a nbsp)? >> >>(1) <verifyxpath xpath="/html/body/h2" text="Resultate für das Team 33" >>/> >>(2) <verifyxpath xpath="/html/body/h2" text="Resultate f&uuml;r das >>Team 33" /> >>(3) <verifyxpath xpath="/html/body/h2" text="Resultate für das >>Team 33" /> >> >> >>Then comes: And how to do it in a way that makes the xml document >>robust in a multi-platform environment? I have seen enough files with ü >>or é written on a PC becoming unreadable once moved to, e.g., a Mac or >>a Linux computer. I'd rather not use solution (1). >> >>So, in solution (2), there is a comparison of the ascii characters >>'ü' , which will most probably be the same in all situations. >>In solution (3), am I sure that htmlunit will always translate to >>unicode? >> >> >>Best >> dna >> >> >>On 1 avr. 05, at 21:09, Brad Clarke wrote: >> >> >>>I don't really understand why you'd want this. Once the document has >>>already been >>>parsed why does it matter if it was an enitity or not? What exactly >>>are you testing >>>that you need to know an enitity was used? >>> >>>The test failures are a known bug in a supporting library that will be >>>fixed when >>>that library is released again. >>> >>>Brad C >>> >>>--- "Denis N. Antonioli" <den...@ca...> wrote: >>> >>> >>>>Hi Marc >>>> >>>>I had to find the time to look into it before posting again... >>>> >>>>On a practical level: I modified locally the head htmlunit from cvs to >>>>behave as proposed, and the changes amount to less than 10 statements >>>>in the productive code, including a pair of setter/getter. The >>>>included >>>>unit tests, at least, show no impacts on the rest of the >>>>functionality. >>>> >>>>I see your point, most (all?) common browsers give us a only view on >>>>the original document. I do think though that the functionality >>>>belongs >>>>to htmlunit for three main reasons. >>>> >>>>First, I find it easier to let the entitites untouched, rather than >>>>converting them to characters in htmlunit and converting the >>>>characters >>>>back to entities in webtest. >>>> >>>>Second, the two conversions won't be equivalent to the original >>>>document. Should the original document contains a mix of entities and >>>>characters, the final document will contain only characters (as now) >>>>or >>>>only entities. >>>> >>>>Third, the need for unconverted entities may arise by other user of >>>>htmlunit. The necessary conversion code would then be replicated. >>>> >>>> >>>>By the way, I could not test htmlunit with maven 1.0.2, maven >>>>complained about attempting to execute scripts that had been garbage >>>>collected. Is this known? >>>> >>>> >>>>Best >>>> dna >>>> >>>>On 25 mars 05, at 13:53, Marc Guillemot wrote: >>>> >>>> >>>>>Hi Denis, >>>>> >>>>>I now think that htmlunit should resolve the entities as it does and >>>>>that it would be wrong to have the entity code "as it". My motivation >>>>>comes from the comparison with browsers: except view source, which is >>>>>comparable to WebResponse.getContentAsString(), the different methods >>>>>to access the source show the resolved entity: in js innerHTML or >>>>>innerText (for IE) and View selection source (for Mozilla). Therefore >>>>>I think that htmlunit behaves like browsers, what is correct, and >>>>>that >>>>>we should handle it only in webtest. >>>>> >>>>>Marc. >>>>> >>>>>Denis N. Antonioli wrote: >>>>> >>>>>>Hi >>>>>>I'm using htmlunit through webtest (<http://webtest.canoo.com>, for >>>>>>those that don't know it). >>>>>>In the present case, Webtest lets htmlunit generate a dom of an html >>>>>>page before querying the document with xpath. >>>>>>For example <verifyxpath xpath="/html/body/h2" text="Resultate"/> >>>>>>makes sure that a h2 header displays the text 'Resultate'. >>>>>>I have the problem that, at some time, the text I want webtest to >>>>>>verify is using html entities: >>>>>><verifyxpath xpath="/html/body/h2" text="Resultate f&uuml;r das >>>>>>Team 33"/> >>>>>>With the help of Marc, I've found that htmlunit is always generating >>>>>>a dom where all entities have been resolved. >>>>>>nekohtml seems to provide a feature >>>>>>(http://apache.org/xml/features/scanner/notify-builtin-refs) to tell >>>>>>when/where the >>>>>>source contains entities (see description at >>>>>><http://cvs.apache.org/~andyc/neko/doc/html/settings.html#notify- >>>>>>builtin-html-refs>). >>>>>>Does someone know if it is possible to get a dom tree in which the >>>>>>text nodes contain entitites instead of characters? >>>>>>Does it make sense? >>>>>>Was it already tried? >>>>>>Would it be difficult? >>>>>> dna > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: Prasanna S. V. <to....@gm...> - 2005-04-05 05:51:58
|
Hi, I am using htmlunit to connect to a secured site (using https). I was using htmlunit 1.4 and didn't face any problems while connecting to the site. Now, I have upgraded to htmlunit 1.5 and get a NoHttpResponseException when connecting to the site. Caused by: org.apache.commons.httpclient.NoHttpResponseException: The server <server-name> failed to respond at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1828) at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1588) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:999) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:382) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:168) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:393) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324) at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:159) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1546) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1521) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1587) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:344) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:400) I have attached the SSL handshake logs that I got by setting javax.net.debug=all. What could be the possible reason for this? My Java version is 1.4.2_07. Thanks a lot in advance. -- -Prasanna. http://prasannasv.blogspot.com |
From: Brad C. <yo...@br...> - 2005-04-04 22:38:21
|
It seems like (1) would be the appropriate thing to do. While I understand your cross-platform concern I think the appropriate place to address that concern would be as close to the problem as possible: create a way for webtest to read something like (2) or (3) and turn it into (1) before passing it along to htmlunit (I know little of webtest or ant's encoding issues but being xml based I'm actually quite surprised you can't do this already). Also, after briefly looking at the character set determination in htmlunit it's entirely possible that we're interpreting something incorrectly since I don't see anything that will use a char set in the html file (which seems a little backwards anyway but it should be possible). Brad C PS Yahoo Mail converted your (3) into (1) when I replied to this message! :D --- "Denis N. Antonioli" <den...@ca...> wrote: > what I really want is to write simple, robust tests that handle > extended character sets (internationalization?) without excessive > magic. > > In the present situation, I have an html page that comes from the > server with an encoding and gets translated by htmlunit into a > different encoding. As far as I know, that last encoding can be > determined by the web server, by the content of the html page or by > some default. > On the other side, I write tests in xml documents which are again > translated by an xml parser (ant) into a different encoding. > > The first problem I have is: how to code in the xml document non-ascii > characters (such as an uuml or a nbsp)? > > (1) <verifyxpath xpath="/html/body/h2" text="Resultate für das Team 33" > /> > (2) <verifyxpath xpath="/html/body/h2" text="Resultate f&uuml;r das > Team 33" /> > (3) <verifyxpath xpath="/html/body/h2" text="Resultate für das > Team 33" /> > > > Then comes: And how to do it in a way that makes the xml document > robust in a multi-platform environment? I have seen enough files with ü > or é written on a PC becoming unreadable once moved to, e.g., a Mac or > a Linux computer. I'd rather not use solution (1). > > So, in solution (2), there is a comparison of the ascii characters > 'ü' , which will most probably be the same in all situations. > In solution (3), am I sure that htmlunit will always translate to > unicode? > > > Best > dna > > > On 1 avr. 05, at 21:09, Brad Clarke wrote: > > > I don't really understand why you'd want this. Once the document has > > already been > > parsed why does it matter if it was an enitity or not? What exactly > > are you testing > > that you need to know an enitity was used? > > > > The test failures are a known bug in a supporting library that will be > > fixed when > > that library is released again. > > > > Brad C > > > > --- "Denis N. Antonioli" <den...@ca...> wrote: > > > >> Hi Marc > >> > >> I had to find the time to look into it before posting again... > >> > >> On a practical level: I modified locally the head htmlunit from cvs to > >> behave as proposed, and the changes amount to less than 10 statements > >> in the productive code, including a pair of setter/getter. The > >> included > >> unit tests, at least, show no impacts on the rest of the > >> functionality. > >> > >> I see your point, most (all?) common browsers give us a only view on > >> the original document. I do think though that the functionality > >> belongs > >> to htmlunit for three main reasons. > >> > >> First, I find it easier to let the entitites untouched, rather than > >> converting them to characters in htmlunit and converting the > >> characters > >> back to entities in webtest. > >> > >> Second, the two conversions won't be equivalent to the original > >> document. Should the original document contains a mix of entities and > >> characters, the final document will contain only characters (as now) > >> or > >> only entities. > >> > >> Third, the need for unconverted entities may arise by other user of > >> htmlunit. The necessary conversion code would then be replicated. > >> > >> > >> By the way, I could not test htmlunit with maven 1.0.2, maven > >> complained about attempting to execute scripts that had been garbage > >> collected. Is this known? > >> > >> > >> Best > >> dna > >> > >> On 25 mars 05, at 13:53, Marc Guillemot wrote: > >> > >>> Hi Denis, > >>> > >>> I now think that htmlunit should resolve the entities as it does and > >>> that it would be wrong to have the entity code "as it". My motivation > >>> comes from the comparison with browsers: except view source, which is > >>> comparable to WebResponse.getContentAsString(), the different methods > >>> to access the source show the resolved entity: in js innerHTML or > >>> innerText (for IE) and View selection source (for Mozilla). Therefore > >>> I think that htmlunit behaves like browsers, what is correct, and > >>> that > >>> we should handle it only in webtest. > >>> > >>> Marc. > >>> > >>> Denis N. Antonioli wrote: > >>>> Hi > >>>> I'm using htmlunit through webtest (<http://webtest.canoo.com>, for > >>>> those that don't know it). > >>>> In the present case, Webtest lets htmlunit generate a dom of an html > >>>> page before querying the document with xpath. > >>>> For example <verifyxpath xpath="/html/body/h2" text="Resultate"/> > >>>> makes sure that a h2 header displays the text 'Resultate'. > >>>> I have the problem that, at some time, the text I want webtest to > >>>> verify is using html entities: > >>>> <verifyxpath xpath="/html/body/h2" text="Resultate f&uuml;r das > >>>> Team 33"/> > >>>> With the help of Marc, I've found that htmlunit is always generating > >>>> a dom where all entities have been resolved. > >>>> nekohtml seems to provide a feature > >>>> (http://apache.org/xml/features/scanner/notify-builtin-refs) to tell > >>>> when/where the > >>>> source contains entities (see description at > >>>> <http://cvs.apache.org/~andyc/neko/doc/html/settings.html#notify- > >>>> builtin-html-refs>). > >>>> Does someone know if it is possible to get a dom tree in which the > >>>> text nodes contain entitites instead of characters? > >>>> Does it make sense? > >>>> Was it already tried? > >>>> Would it be difficult? > >>>> dna |
From: Denis N. A. <den...@ca...> - 2005-04-04 21:23:02
|
what I really want is to write simple, robust tests that handle=20 extended character sets (internationalization?) without excessive=20 magic. In the present situation, I have an html page that comes from the=20 server with an encoding and gets translated by htmlunit into a=20 different encoding. As far as I know, that last encoding can be=20 determined by the web server, by the content of the html page or by=20 some default. On the other side, I write tests in xml documents which are again=20 translated by an xml parser (ant) into a different encoding. The first problem I have is: how to code in the xml document non-ascii=20= characters (such as an uuml or a nbsp)? (1) <verifyxpath xpath=3D"/html/body/h2" text=3D"Resultate f=FCr das = Team 33"=20 /> (2) <verifyxpath xpath=3D"/html/body/h2" text=3D"Resultate f&uuml;r = das=20 Team 33" /> (3) <verifyxpath xpath=3D"/html/body/h2" text=3D"Resultate für = das=20 Team 33" /> Then comes: And how to do it in a way that makes the xml document=20 robust in a multi-platform environment? I have seen enough files with =FC=20= or =E9 written on a PC becoming unreadable once moved to, e.g., a Mac or=20= a Linux computer. I'd rather not use solution (1). So, in solution (2), there is a comparison of the ascii characters=20 'ü' , which will most probably be the same in all situations. In solution (3), am I sure that htmlunit will always translate to=20 unicode? Best dna On 1 avr. 05, at 21:09, Brad Clarke wrote: > I don't really understand why you'd want this. Once the document has=20= > already been > parsed why does it matter if it was an enitity or not? What exactly=20 > are you testing > that you need to know an enitity was used? > > The test failures are a known bug in a supporting library that will be=20= > fixed when > that library is released again. > > Brad C > > --- "Denis N. Antonioli" <den...@ca...> wrote: > >> Hi Marc >> >> I had to find the time to look into it before posting again... >> >> On a practical level: I modified locally the head htmlunit from cvs = to >> behave as proposed, and the changes amount to less than 10 statements >> in the productive code, including a pair of setter/getter. The=20 >> included >> unit tests, at least, show no impacts on the rest of the=20 >> functionality. >> >> I see your point, most (all?) common browsers give us a only view on >> the original document. I do think though that the functionality=20 >> belongs >> to htmlunit for three main reasons. >> >> First, I find it easier to let the entitites untouched, rather than >> converting them to characters in htmlunit and converting the=20 >> characters >> back to entities in webtest. >> >> Second, the two conversions won't be equivalent to the original >> document. Should the original document contains a mix of entities and >> characters, the final document will contain only characters (as now)=20= >> or >> only entities. >> >> Third, the need for unconverted entities may arise by other user of >> htmlunit. The necessary conversion code would then be replicated. >> >> >> By the way, I could not test htmlunit with maven 1.0.2, maven >> complained about attempting to execute scripts that had been garbage >> collected. Is this known? >> >> >> Best >> dna >> >> On 25 mars 05, at 13:53, Marc Guillemot wrote: >> >>> Hi Denis, >>> >>> I now think that htmlunit should resolve the entities as it does and >>> that it would be wrong to have the entity code "as it". My = motivation >>> comes from the comparison with browsers: except view source, which = is >>> comparable to WebResponse.getContentAsString(), the different = methods >>> to access the source show the resolved entity: in js innerHTML or >>> innerText (for IE) and View selection source (for Mozilla). = Therefore >>> I think that htmlunit behaves like browsers, what is correct, and=20 >>> that >>> we should handle it only in webtest. >>> >>> Marc. >>> >>> Denis N. Antonioli wrote: >>>> Hi >>>> I'm using htmlunit through webtest (<http://webtest.canoo.com>, for >>>> those that don't know it). >>>> In the present case, Webtest lets htmlunit generate a dom of an = html >>>> page before querying the document with xpath. >>>> For example <verifyxpath xpath=3D"/html/body/h2" text=3D"Resultate"/>= >>>> makes sure that a h2 header displays the text 'Resultate'. >>>> I have the problem that, at some time, the text I want webtest to >>>> verify is using html entities: >>>> <verifyxpath xpath=3D"/html/body/h2" text=3D"Resultate f&uuml;r = das >>>> Team 33"/> >>>> With the help of Marc, I've found that htmlunit is always = generating >>>> a dom where all entities have been resolved. >>>> nekohtml seems to provide a feature >>>> (http://apache.org/xml/features/scanner/notify-builtin-refs) to = tell >>>> when/where the >>>> source contains entities (see description at >>>> <http://cvs.apache.org/~andyc/neko/doc/html/settings.html#notify- >>>> builtin-html-refs>). >>>> Does someone know if it is possible to get a dom tree in which the >>>> text nodes contain entitites instead of characters? >>>> Does it make sense? >>>> Was it already tried? >>>> Would it be difficult? >>>> dna > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real=20 > users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > --=20 El pasado es indestructible; tarde o temprano vuelven todas las cosas, y una de las cosas que vuelven es el proyecto de abolir el pasado. -- J.L. Borges, "Nathaniel Hawthorne" |
From: Brad C. <yo...@br...> - 2005-04-01 19:10:33
|
I don't really understand why you'd want this. Once the document has already been parsed why does it matter if it was an enitity or not? What exactly are you testing that you need to know an enitity was used? The test failures are a known bug in a supporting library that will be fixed when that library is released again. Brad C --- "Denis N. Antonioli" <den...@ca...> wrote: > Hi Marc > > I had to find the time to look into it before posting again... > > On a practical level: I modified locally the head htmlunit from cvs to > behave as proposed, and the changes amount to less than 10 statements > in the productive code, including a pair of setter/getter. The included > unit tests, at least, show no impacts on the rest of the functionality. > > I see your point, most (all?) common browsers give us a only view on > the original document. I do think though that the functionality belongs > to htmlunit for three main reasons. > > First, I find it easier to let the entitites untouched, rather than > converting them to characters in htmlunit and converting the characters > back to entities in webtest. > > Second, the two conversions won't be equivalent to the original > document. Should the original document contains a mix of entities and > characters, the final document will contain only characters (as now) or > only entities. > > Third, the need for unconverted entities may arise by other user of > htmlunit. The necessary conversion code would then be replicated. > > > By the way, I could not test htmlunit with maven 1.0.2, maven > complained about attempting to execute scripts that had been garbage > collected. Is this known? > > > Best > dna > > On 25 mars 05, at 13:53, Marc Guillemot wrote: > > > Hi Denis, > > > > I now think that htmlunit should resolve the entities as it does and > > that it would be wrong to have the entity code "as it". My motivation > > comes from the comparison with browsers: except view source, which is > > comparable to WebResponse.getContentAsString(), the different methods > > to access the source show the resolved entity: in js innerHTML or > > innerText (for IE) and View selection source (for Mozilla). Therefore > > I think that htmlunit behaves like browsers, what is correct, and that > > we should handle it only in webtest. > > > > Marc. > > > > Denis N. Antonioli wrote: > >> Hi > >> I'm using htmlunit through webtest (<http://webtest.canoo.com>, for > >> those that don't know it). > >> In the present case, Webtest lets htmlunit generate a dom of an html > >> page before querying the document with xpath. > >> For example <verifyxpath xpath="/html/body/h2" text="Resultate"/> > >> makes sure that a h2 header displays the text 'Resultate'. > >> I have the problem that, at some time, the text I want webtest to > >> verify is using html entities: > >> <verifyxpath xpath="/html/body/h2" text="Resultate f&uuml;r das > >> Team 33"/> > >> With the help of Marc, I've found that htmlunit is always generating > >> a dom where all entities have been resolved. > >> nekohtml seems to provide a feature > >> (http://apache.org/xml/features/scanner/notify-builtin-refs) to tell > >> when/where the > >> source contains entities (see description at > >> <http://cvs.apache.org/~andyc/neko/doc/html/settings.html#notify- > >> builtin-html-refs>). > >> Does someone know if it is possible to get a dom tree in which the > >> text nodes contain entitites instead of characters? > >> Does it make sense? > >> Was it already tried? > >> Would it be difficult? > >> dna |
From: Denis N. A. <den...@ca...> - 2005-04-01 18:50:39
|
Hi Marc I had to find the time to look into it before posting again... On a practical level: I modified locally the head htmlunit from cvs to behave as proposed, and the changes amount to less than 10 statements in the productive code, including a pair of setter/getter. The included unit tests, at least, show no impacts on the rest of the functionality. I see your point, most (all?) common browsers give us a only view on the original document. I do think though that the functionality belongs to htmlunit for three main reasons. First, I find it easier to let the entitites untouched, rather than converting them to characters in htmlunit and converting the characters back to entities in webtest. Second, the two conversions won't be equivalent to the original document. Should the original document contains a mix of entities and characters, the final document will contain only characters (as now) or only entities. Third, the need for unconverted entities may arise by other user of htmlunit. The necessary conversion code would then be replicated. By the way, I could not test htmlunit with maven 1.0.2, maven complained about attempting to execute scripts that had been garbage collected. Is this known? Best dna On 25 mars 05, at 13:53, Marc Guillemot wrote: > Hi Denis, > > I now think that htmlunit should resolve the entities as it does and > that it would be wrong to have the entity code "as it". My motivation > comes from the comparison with browsers: except view source, which is > comparable to WebResponse.getContentAsString(), the different methods > to access the source show the resolved entity: in js innerHTML or > innerText (for IE) and View selection source (for Mozilla). Therefore > I think that htmlunit behaves like browsers, what is correct, and that > we should handle it only in webtest. > > Marc. > > Denis N. Antonioli wrote: >> Hi >> I'm using htmlunit through webtest (<http://webtest.canoo.com>, for >> those that don't know it). >> In the present case, Webtest lets htmlunit generate a dom of an html >> page before querying the document with xpath. >> For example <verifyxpath xpath="/html/body/h2" text="Resultate"/> >> makes sure that a h2 header displays the text 'Resultate'. >> I have the problem that, at some time, the text I want webtest to >> verify is using html entities: >> <verifyxpath xpath="/html/body/h2" text="Resultate f&uuml;r das >> Team 33"/> >> With the help of Marc, I've found that htmlunit is always generating >> a dom where all entities have been resolved. >> nekohtml seems to provide a feature >> (http://apache.org/xml/features/scanner/notify-builtin-refs) to tell >> when/where the >> source contains entities (see description at >> <http://cvs.apache.org/~andyc/neko/doc/html/settings.html#notify- >> builtin-html-refs>). >> Does someone know if it is possible to get a dom tree in which the >> text nodes contain entitites instead of characters? >> Does it make sense? >> Was it already tried? >> Would it be difficult? >> dna > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real > users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > -- Beware of the bugs in the above code; I have only proved it correct, not tried it. -- Donald Knuth |
From: David D.K. <ddk...@ki...> - 2005-03-29 04:48:56
|
You need to get a reference to the Java object representing the radio button (DOM object), then call the click() method on it. That should invoke the appropriate JavaScript to mimic what the web browser does. Use the HtmlPage object to get a reference to the appropriate HtmlRadioButtonInput object. Dave On Mar 28, 2005, at 9:53 AM, Sridhar Ranganathan wrote: > Hi, > > I have a Radio button group with 2 buttons. Both have same element ID > and name. But the value changes depending on which button was clicked. > Moreover, the attributes (enable/disable) changes for some elements in > the page depending on which radio button is clicked. > > Right now, I am setting the value attribute for the radio element. > However, by this method, I am not able to refresh the page. What I want > to do is to click the radio button using click() and then I could get > the HtmlPage content to verify the enable/disable for other fields. > > Is there any way I can achieve this ? > > thanks > -- > Sridhar R |
From: Casey C. <cr...@na...> - 2005-03-28 21:06:37
|
I'm not sure exactly how much I can disclose due to NDA, I'll try to be lucid. It works like this: * Login to the application (basic auth) * Navigate to their area (simple link clicking) * Create a document in their area (click on an "action link") This will open a new window with a wizard-like interface for entering data such as the file name and description; the field for the actual file. The user enters all this information and clicks "Next". This does a form submit and uploads the file to a temporary location. * On the next page of the wizard, permissions can be set. Users sets permissions however they want and clicks "OK". This does a form submit. The page that loads has it's body onload= set to a method that will close the wizard window and refresh the parent window using a window.opener.location.reload(). Along the way we are setting and using javascript global variables for flow control. (For some actions we don't want to close the wizard, we only want to refresh the parent page; sometimes we don't want to refresh the parent at all) Catching that window.opener.location.reload()'s result is what I'm trying to do. Here's the example; below are the helper function definitions: // Create our Client // I've defined my own BrowserVersion; this should be independent WebClient webClient = new WebClient(bv); webClient.setRedirectEnabled(true); // Set our authentication credentials for this client DefaultCredentialsProvider dcp = (DefaultCredentialsProvider) webClient.getCredentialsProvider(); dcp.addCredentials("billg", "billg"); // Load up a page. URL url = new URL("http://obscured"); HtmlPage page = (HtmlPage)webClient.getPage(url); // Start clicking links; Here we make sure we're in the Access Control Testing Project's Folders page. page = clickLink(page, "Home"); page = clickLink(page, "Project"); page = clickLink(page, "Projects List"); page = clickLink(page, "Access Control Testing"); page = clickLink(page, "Folders"); // for debugging; write out the result to disk in a file called page1. writePage("page1", page); // Open up a new window for the Create Document wizard HtmlPage wizard = clickLink(page, "Create Document"); // Grab the form and set some values HtmlForm mainform = wizard.getFormByName("mainform"); setTextField(mainform, "name", "My first file"); HtmlFileInput fileField = (HtmlFileInput)mainform.getInputByName("file"); // the fileField's value should be set to a path to a file. fileField.setValueAttribute("Hello.java"); // Done with the first step; move on to the next wizard = clickButton(mainform, "nextButton"); mainform = wizard.getFormByName("mainform"); // We don't care about the additional information step; so we just move on. wizard = clickButton(mainform, "nextButton"); mainform = wizard.getFormByName("mainform"); // for debugging; write out the result to disk in a file called permWizard writePage("permWizard", wizard); // now lets give members read access only. HtmlRadioButtonInput memberRead = (HtmlRadioButtonInput) wizard.getHtmlElementById("PJLAll_ASC32_Members__read"); memberRead.click(); // we're done! wizard = clickOK(mainform); writePage("finalWizard", wizard); // At this point I'm not sure what object has the refreshed value; as page doesn't seem to. // refresh doesn't seem to automatically work; so we have to refresh the page manually. page = clickLink(page, "Folders"); writePage("page2", page); Helper functions follow: /** * Convenience method for click a link on a page * * @param p The <code>HtmlPage</code> the link is on * @param linkText the literal text of the link (What you see in the Web Browser) * @return a new <code>HtmlPage</code> result * @exception Exception if an error occurs */ public static HtmlPage clickLink(HtmlPage p, String linkText) throws Exception { HtmlAnchor link = p.getFirstAnchorByText(linkText); return (HtmlPage)link.click(); } /* Convenience method for setting the value of a text field */ public static void setTextField(HtmlForm form, String fieldName, String value) throws Exception { HtmlTextInput textField = (HtmlTextInput)form.getInputByName(fieldName); textField.setValueAttribute(value); } /* Convenience method for clicking a button on a wizard */ /* buttonName is the value of the field "name" on the "button" html object */ /* For example, most "Next" buttons are named "nextButton" */ public static HtmlPage clickButton(HtmlForm form, String buttonName) throws Exception { HtmlButtonInput button = (HtmlButtonInput) form.getInputByName(buttonName); return (HtmlPage)button.click(); } /* Convenience method for clicking the OK button on a wizard */ public static HtmlPage clickOK(HtmlForm form) throws Exception { HtmlSubmitInput ok = (HtmlSubmitInput) form.getInputByName("okButton"); return (HtmlPage)ok.click(); } /* A quick and dirty way to output most of the page. */ public static void writePage(String name, HtmlPage p) throws Exception { FileWriter fw = new FileWriter(name); fw.write(p.asXml()); fw.flush(); fw.close(); } -- Casey On Mon, Mar 28, 2005 at 12:42:52PM -0800, Brad Clarke wrote: > My application does things such as this all the time with no problems. In order to > help you I'd need to know more about what you're doing (self contained, failing test > cases being the best examples). > > Brad C > > --- Casey Crabb <cra...@na...> wrote: > > Hey all, > > > > I'm working on an application that uses pop-up wizards to perform > > actions. After these wizards are done (when you fully submit them) > > they trigger a refresh on the main browser page and close > > themselves. This doesn't seem to be automatically supported by > > htmlunit. Is there a way I can get this to work; or can someone point > > me in the correct direction in the source? > > > > -- > > Casey > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Brad C. <yo...@br...> - 2005-03-28 20:43:01
|
My application does things such as this all the time with no problems. In order to help you I'd need to know more about what you're doing (self contained, failing test cases being the best examples). Brad C --- Casey Crabb <cra...@na...> wrote: > Hey all, > > I'm working on an application that uses pop-up wizards to perform > actions. After these wizards are done (when you fully submit them) > they trigger a refresh on the main browser page and close > themselves. This doesn't seem to be automatically supported by > htmlunit. Is there a way I can get this to work; or can someone point > me in the correct direction in the source? > > -- > Casey > |
From: Casey C. <cra...@na...> - 2005-03-28 19:34:51
|
Hey all, I'm working on an application that uses pop-up wizards to perform actions. After these wizards are done (when you fully submit them) they trigger a refresh on the main browser page and close themselves. This doesn't seem to be automatically supported by htmlunit. Is there a way I can get this to work; or can someone point me in the correct direction in the source? -- Casey |
From: Sridhar R. <Sri...@Su...> - 2005-03-28 15:53:54
|
Hi, I have a Radio button group with 2 buttons. Both have same element ID and name. But the value changes depending on which button was clicked. Moreover, the attributes (enable/disable) changes for some elements in the page depending on which radio button is clicked. Right now, I am setting the value attribute for the radio element. However, by this method, I am not able to refresh the page. What I want to do is to click the radio button using click() and then I could get the HtmlPage content to verify the enable/disable for other fields. Is there any way I can achieve this ? thanks -- Sridhar R |
From: Erskine, C. <chr...@ed...> - 2005-03-26 02:27:07
|
I have just added to CVS a change that fixes the JavaScript configuration. Constraints for browser and JavaScript values are now supported. To do this, I created a new configuration package and moved the classes to this directory. I have also had to add a change to the Browser constructor which now requires a numeric value to be supplied for the initialization of the browser. This change will affect anyone who is building their own browsers for testing. This numeric version is the browser version that you are trying to emulate. I know that this does not support the alpha versions but a limit had to be put somewhere and trying to match version using an alpha string would be hard. This change is a major change for the JavaScript processing and a number of bugs which were supported before may not be supported now breaking your testing code. The code passes all of our current test scripts but there may be some usages that do not work anymore. If you find any, please try making a standalone JUnit test that demonstrates the problem and we will try to fix it. Chris Erskine EDS Consulting Services Colorado Springs, CO Phone: 719-265-5962 Cell: 719-640-6488 |
From: Marc G. <mgu...@ya...> - 2005-03-25 12:52:37
|
Hi Denis, I now think that htmlunit should resolve the entities as it does and that it would be wrong to have the entity code "as it". My motivation comes from the comparison with browsers: except view source, which is comparable to WebResponse.getContentAsString(), the different methods to access the source show the resolved entity: in js innerHTML or innerText (for IE) and View selection source (for Mozilla). Therefore I think that htmlunit behaves like browsers, what is correct, and that we should handle it only in webtest. Marc. Denis N. Antonioli wrote: > Hi > > I'm using htmlunit through webtest (<http://webtest.canoo.com>, for > those that don't know it). > In the present case, Webtest lets htmlunit generate a dom of an html > page before querying the document with xpath. > For example <verifyxpath xpath="/html/body/h2" text="Resultate"/> makes > sure that a h2 header displays the text 'Resultate'. > > I have the problem that, at some time, the text I want webtest to verify > is using html entities: > <verifyxpath xpath="/html/body/h2" text="Resultate f&uuml;r das Team > 33"/> > > With the help of Marc, I've found that htmlunit is always generating a > dom where all entities have been resolved. > > nekohtml seems to provide a feature > (http://apache.org/xml/features/scanner/notify-builtin-refs) to tell > when/where the > source contains entities (see description at > <http://cvs.apache.org/~andyc/neko/doc/html/settings.html#notify- > builtin-html-refs>). > > Does someone know if it is possible to get a dom tree in which the text > nodes contain entitites instead of characters? > > Does it make sense? > > Was it already tried? > > Would it be difficult? > > dna > |
From: Denis N. A. <den...@ca...> - 2005-03-24 17:05:18
|
Hi I'm using htmlunit through webtest (<http://webtest.canoo.com>, for those that don't know it). In the present case, Webtest lets htmlunit generate a dom of an html page before querying the document with xpath. For example <verifyxpath xpath="/html/body/h2" text="Resultate"/> makes sure that a h2 header displays the text 'Resultate'. I have the problem that, at some time, the text I want webtest to verify is using html entities: <verifyxpath xpath="/html/body/h2" text="Resultate f&uuml;r das Team 33"/> With the help of Marc, I've found that htmlunit is always generating a dom where all entities have been resolved. nekohtml seems to provide a feature (http://apache.org/xml/features/scanner/notify-builtin-refs) to tell when/where the source contains entities (see description at <http://cvs.apache.org/~andyc/neko/doc/html/settings.html#notify- builtin-html-refs>). Does someone know if it is possible to get a dom tree in which the text nodes contain entitites instead of characters? Does it make sense? Was it already tried? Would it be difficult? dna -- Failure is not an option. It comes bundled with your Microsoft product. -- Ferenc Mantfeld |