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: Vinay M. <vin...@gm...> - 2005-03-11 06:10:59
|
Hi, I did some debugging myself to check if the HtmlUnitDOMBuilder (within HTMLParser) was picking up these tags at all in the first place. And I actually found that, while the <html>, <head> and <title> tags trigger the "startElement" method of the ContentHandler, the tags following them dont. So, may be this is an issue with the Xerces implementation ? Some googling on the web did seem to suggest this as a problem with xerces. Infact, when I put in any other kind of an encoding instead of UTF-16, HtmlUnit is able to detect the tags following and including the <meta> tag. Hope this helps, Regards Vinay |
From: Brad C. <yo...@br...> - 2005-03-10 19:32:54
|
It looks like a bug but I couldn't quickly locate anything that reads the content type from the meta tags. Does it do the same thing with different encodings? --- Vinay Murthy <vin...@gm...> wrote: > Hi, > > I did notice a certain thread on the mailing list that discussed > problems relating to the content-type of pages and how we could solve > this problem by extending DefaultPageCreator. > > But, the page that I am trying to access has content-type set to > text/html, which means I can use the DefaultPageCreator as such. > However, in addition to this, the page also has the character set > encoding set to UTF-16. The problem is that, with the UTF-16 charset > in place, HtmlUnit is not able to detect any javascript on the page. > Here is a dummy page that I created to test this out: > > <HTML> > <HEAD> > <TITLE> Page Two </TITLE> > <META http-equiv="Content-Type" content="text/html; charset=UTF-16"> > <Script language="JavaScript" type="text/javaScript" src="test.js"></Script> > </HEAD> > <BODY> > </BODY> > </HTML> > > I found that if I remove the charset specification, the js gets > detected and the file, test.js, is loaded. I really, do not have > control on the source of the actual page that I am accessing. > > I have been using the HtmlUnit sources of 10th March 2005. Would > appreciate your response to this. > > Regards > Vinay |
From: Brad C. <yo...@br...> - 2005-03-10 19:20:20
|
This has been changed in CVS: INCOMPATIBLE CHANGE: com.gargoylesoftware.htmlunit.CredentialProvider has been removed. You should now use org.apache.commons.httpclient.auth.CredentialsProvider instead. This patch should allow support for NTLM and Digest authentication as well as proxy authentication. Thanks to Daniel Gredler . http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/DefaultCredentialsProvider.html --- Zhenrong Liu <Zhe...@sa...> wrote: > Hey, > > I'm new to htmlunit and have a test scenario like this, every time when I click a > link, a window will pop up ask me to enter userid and password. I tried to find a > way to do this using Htmlunit1.4 but no success, I was wondering if there is > something missing? Or I totally used the wrong API? > > My code: > .... > final WebClient webClient = new WebClient(); > final URL url = new > URL("http://localhost:8080/SASStoredProcess/do?_program=//Webapp/PropertySheet/stpint_1&_action=properties"); > final SimpleCredentialProvider scp = new > SimpleCredentialProvider("Domain\myuserid", "mypassword"); > webClient.setCredentialProvider(scp); > final HtmlPage page1 = HtmlPage)webClient.getPage(url); > .... > > It gives me the following errors: > Mar 8, 2005 3:00:21 PM org.apache.commons.httpclient.auth.AuthChallengeProcessor > selectAuthScheme > INFO: basic authentication scheme selected > Mar 8, 2005 3:00:21 PM org.apache.commons.httpclient.HttpMethodDirector > processWWWAuthChallenge > INFO: No credentials available for BASIC 'SAS Authentication Domain: > DefaultAuth'@localhost:8080 > > But in Jwebunit, I can easliy solve this using > HttpUnitDialog hud = getDialog(); > WebClient wc = hud.getWebClient(); > wc.setAuthorization(username, password); > > I was wondering if someone can give me some hints here. > > Thanks, > -Zhenrong |
From: Zhenrong L. <Zhe...@sa...> - 2005-03-10 14:02:32
|
Hey, I'm new to htmlunit and have a test scenario like this, every time when = I click a link, a window will pop up ask me to enter userid and = password. I tried to find a way to do this using Htmlunit1.4 but no = success, I was wondering if there is something missing? Or I totally = used the wrong API? My code: .... final WebClient webClient =3D new WebClient(); final URL url =3D new = URL("http://localhost:8080/SASStoredProcess/do?_program=3D//Webapp/Proper= tySheet/stpint_1&_action=3Dproperties"); final SimpleCredentialProvider scp =3D new = SimpleCredentialProvider("Domain\myuserid", "mypassword"); webClient.setCredentialProvider(scp); final HtmlPage page1 =3D HtmlPage)webClient.getPage(url);=20 .... It gives me the following errors: Mar 8, 2005 3:00:21 PM = org.apache.commons.httpclient.auth.AuthChallengeProcessor = selectAuthScheme INFO: basic authentication scheme selected Mar 8, 2005 3:00:21 PM org.apache.commons.httpclient.HttpMethodDirector = processWWWAuthChallenge INFO: No credentials available for BASIC 'SAS Authentication Domain: = DefaultAuth'@localhost:8080 But in Jwebunit, I can easliy solve this using=20 HttpUnitDialog hud =3D getDialog(); WebClient wc =3D hud.getWebClient(); wc.setAuthorization(username, password); I was wondering if someone can give me some hints here.=20 Thanks, -Zhenrong |
From: Vinay M. <vin...@gm...> - 2005-03-10 09:11:50
|
Hi, I did notice a certain thread on the mailing list that discussed problems relating to the content-type of pages and how we could solve this problem by extending DefaultPageCreator. But, the page that I am trying to access has content-type set to text/html, which means I can use the DefaultPageCreator as such. However, in addition to this, the page also has the character set encoding set to UTF-16. The problem is that, with the UTF-16 charset in place, HtmlUnit is not able to detect any javascript on the page. Here is a dummy page that I created to test this out: <HTML> <HEAD> <TITLE> Page Two </TITLE> <META http-equiv="Content-Type" content="text/html; charset=UTF-16"> <Script language="JavaScript" type="text/javaScript" src="test.js"></Script> </HEAD> <BODY> </BODY> </HTML> I found that if I remove the charset specification, the js gets detected and the file, test.js, is loaded. I really, do not have control on the source of the actual page that I am accessing. I have been using the HtmlUnit sources of 10th March 2005. Would appreciate your response to this. Regards Vinay |
From: Marc G. <mgu...@ya...> - 2005-03-09 11:00:04
|
Currently this is not directly supported by htmlunit but you should be able to add the header your self using WebClient.addRequestHeader. I think that this is a feature that htmlunit should have. Feel free to open a RFE for this. Marc. Marziou, Gael wrote: > The ones used by the browser to fill up the HTTP Accept-language header > in request, so the first one in your question. > > Please note that I used plural (i.e. the preferred languages), so it > should be an ordered list of locales with weights as in a browser. > > > Gael > > > >>-----Original Message----- >>From: htm...@li... >>[mailto:htm...@li...] On Behalf >>Of Marc Guillemot >>Sent: 09 March, 2005 11:46 >>To: htm...@li... >>Subject: Re: [Htmlunit-user] How to configure my preferred >>languages in WebClient? >> >>What do you mean with preferred language? The one sent as >>http header or the one of the browser available in javascript >>or even the one of the OS available in javascript as well? >> >>Marc. >> >>Marziou, Gael wrote: >> >>>Hello, >>> >>>I'm using 1.4 and I was not able to find a way to specify >> >>my preferred >> >>>languages in WebClient. >>>This is preventing from testing internationalized web applications. >>> >>>Am I wrong or should I submit a feature request? >>> >>>Thanks, >>> >>>Gael >>> >>> >>>------------------------------------------------------- >>>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_ide95&alloc_id396&op=click >>>_______________________________________________ >>>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 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 >> > > > > ------------------------------------------------------- > 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_ide95&alloc_id396&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: Marziou, G. <gae...@hp...> - 2005-03-09 10:53:40
|
The ones used by the browser to fill up the HTTP Accept-language header in request, so the first one in your question. Please note that I used plural (i.e. the preferred languages), so it should be an ordered list of locales with weights as in a browser. Gael =20 > -----Original Message----- > From: htm...@li...=20 > [mailto:htm...@li...] On Behalf=20 > Of Marc Guillemot > Sent: 09 March, 2005 11:46 > To: htm...@li... > Subject: Re: [Htmlunit-user] How to configure my preferred=20 > languages in WebClient? >=20 > What do you mean with preferred language? The one sent as=20 > http header or the one of the browser available in javascript=20 > or even the one of the OS available in javascript as well? >=20 > Marc. >=20 > Marziou, Gael wrote: > > Hello, > >=20 > > I'm using 1.4 and I was not able to find a way to specify=20 > my preferred=20 > > languages in WebClient. > > This is preventing from testing internationalized web applications. > >=20 > > Am I wrong or should I submit a feature request? > >=20 > > Thanks, > >=20 > > Gael > >=20 > >=20 > > ------------------------------------------------------- > > SF email is sponsored by - The IT Product Guide Read honest=20 > & candid=20 > > reviews on hundreds of IT Products from real users. > > Discover which products truly live up to the hype. Start=20 > reading now. > > http://ads.osdn.com/?ad_ide95&alloc_id=14396&op=3Dclick > > _______________________________________________ > > Htmlunit-user mailing list > > Htm...@li... > > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > >=20 >=20 >=20 >=20 > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide Read honest &=20 > 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=3D6595&alloc_id=3D14396&op=3Dclick > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user >=20 |
From: Marc G. <mgu...@ya...> - 2005-03-09 10:44:59
|
What do you mean with preferred language? The one sent as http header or the one of the browser available in javascript or even the one of the OS available in javascript as well? Marc. Marziou, Gael wrote: > Hello, > > I'm using 1.4 and I was not able to find a way to specify my preferred > languages in WebClient. > This is preventing from testing internationalized web applications. > > Am I wrong or should I submit a feature request? > > Thanks, > > Gael > > > ------------------------------------------------------- > 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_ide95&alloc_id396&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: Marziou, G. <gae...@hp...> - 2005-03-09 10:41:56
|
Hello, I'm using 1.4 and I was not able to find a way to specify my preferred languages in WebClient. This is preventing from testing internationalized web applications. Am I wrong or should I submit a feature request? Thanks, Gael |
From: Vinay M. <vin...@gm...> - 2005-03-09 10:10:59
|
Hi, I noticed an interesting behaviour that HtmlUnit displays when I try to get a page that has frames in it. The page consists of a frameset, which in turn comprises of three frames in it. <frameset id='Parent' name='Parent' rows='89,*' border=0 onload='if(self!=parent){top.location=window.location;}'> <noframes>This page contains frames, please update your browser to view this page.</noframes> <frame name='Tabs' tabIndex=-1 scrolling='no' noresize target='main' src='Page2.html'> <frame name='Nav' scrolling='auto' noresize tabIndex=-1 target='Main' src='Page3.html'> <frame name='Main' noresize src='blankhtm.htm'> </frameset> Now, both Page2.html and Page3.html load up the same javascript source file which upon loading up 1) finds out the frame in which it is currently loaded 2) executes some code meant specifically for the frame in 1. Here's the javascript: window.onload=function1; function function1() { if(window.name=="Nav") { parent.frames['Main'].location="Page5.html"; } if(window.name=="Tabs") { //some code } } When HtmlUnit executes the javascript, it reports the following error: org.mozilla.javascript.EcmaError: TypeError: Cannot set property "location" of undefined to "Page5.html" (test.js#11) However, if I make frame 'Main' appear before frame 'Nav' in the Html above, I am able to successfully change the content of "Main" from "Nav". I presume that in the case where "Main" appears after "Nav", the javascript in "Nav" executes even before "Main" could actually get loaded and hence the error. I was wondering if somebody had encountered this situation before and if there has been a fix to this. I am using the latest source code versions of HtmlUnit. And I didnt encounter this problem when I opened the pages through IE and Mozilla Regards Vinay |
From: Marc G. <mgu...@ya...> - 2005-03-08 16:08:47
|
Seems that the location property should be writable. Please open a bug issue for that. Marc. PS: if you have access to the code, you can remove the code line because I doubt that it brings anything. |
From: nikola <web...@ya...> - 2005-03-08 15:27:56
|
Hi, I have a *.php popup with form for user to input some text...this text is submited to iframe_page contained in main page... on popup when user submites page this code is executed $content_value = $values->setElementValue($_GET[element_name], $_GET[content_id]); echo '<script language="JavaScript">'; echo'opener.document.location=opener.document.location;'; echo 'window.close();'; echo '</script>'; but this code is also a problem, so I get this error 2005.03.08 16:01:42 com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter runtimeError SEVERE: runtimeError: message=[Property "location" is not writable for com.gargoylesoftware.htmlunit.javascript.host.Document@15db13f. Cant set it to: http://goran/im_cms/site/dot_editor/dot_editor_iframe.php?action=openPg&content_id=42] sourceName=[Embedded script] line=[1] lineSource=[null] lineOffset=[0] ... and this is a copy trace: ======= EXCEPTION START ======== Exception class=[org.mozilla.javascript.EvaluatorException] com.gargoylesoftware.htmlunit.ScriptException: Property "location" is not writable for com.gargoylesoftware.htmlunit.javascript.host.Document@15db13f. Cant set it to: http://root/app/iframe_page.php?action=openPg&content_id=42 (Embedded script#1) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:294) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:712) at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:209) at com.gargoylesoftware.htmlunit.html.HtmlScript.appendChild(HtmlScript.java:168) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.handleCharacters(HTMLParser.java:415) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:379) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:249) at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:361) at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1015) at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:888) at org.cyberneko.html.HTMLScanner$SpecialScanner.scan(HTMLScanner.java:2767) at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:789) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:478) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:431) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:334) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:258) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:115) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:84) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:595) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:562) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:444) at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:185) at com.gargoylesoftware.htmlunit.html.HtmlSubmitInput.doClickAction(HtmlSubmitInput.java:77) at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:120) at TestText.testText(TestText.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186) Enclosed exception: org.mozilla.javascript.EvaluatorException: Property "location" is not writable for com.gargoylesoftware.htmlunit.javascript.host.Document@15db13f. Cant set it to: http://goran/im_cms/site/dot_editor/dot_editor_iframe.php?action=openPg&content_id=42 (Embedded script#1) at com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter.runtimeError(StrictErrorReporter.java:114) at org.mozilla.javascript.Context.reportRuntimeError(Context.java:1054) at org.mozilla.javascript.Context.reportRuntimeError(Context.java:1110) at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.put(SimpleScriptable.java:478) at org.mozilla.javascript.ScriptableObject.putProperty(ScriptableObject.java:1347) at org.mozilla.javascript.ScriptRuntime.setObjectProp(ScriptRuntime.java:1430) at org.mozilla.javascript.ScriptRuntime.setObjectProp(ScriptRuntime.java:1420) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2753) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2164) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:140) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:304) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2769) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2145) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:140) at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:149) at org.mozilla.javascript.Context.evaluateString(Context.java:1220) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:289) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:712) at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:209) at com.gargoylesoftware.htmlunit.html.HtmlScript.appendChild(HtmlScript.java:168) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.handleCharacters(HTMLParser.java:415) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:379) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:249) at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:361) at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1015) at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:888) at org.cyberneko.html.HTMLScanner$SpecialScanner.scan(HTMLScanner.java:2767) at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:789) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:478) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:431) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:334) at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:258) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:115) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:84) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:595) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:562) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:444) at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:185) at com.gargoylesoftware.htmlunit.html.HtmlSubmitInput.doClickAction(HtmlSubmitInput.java:77) at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:120) at TestText.testText(TestText.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186) == CALLING JAVASCRIPT == opener.document.location=opener.document.location;window.close(); ======= EXCEPTION END ======== ... there is too much php, and html code to post it all, and I hope that question is not too confusing :) ... so any help is welcome ... thanks... __________________________________ Celebrate Yahoo!'s 10th Birthday! Yahoo! Netrospective: 100 Moments of the Web http://birthday.yahoo.com/netrospective/ |
From: Brad C. <yo...@br...> - 2005-03-05 22:48:46
|
We use divs all over the place so it should work just fine. Try HtmlPage.asXml() and make sure it's the page you think it is. --- Vinay Murthy <vin...@gm...> wrote: > Hi, > > Does HtmlUnit have support for the <div> tag ? The reason why I ask > this is that, I have a page that lists a bunch of anchors within a > <div> tag. Unfortunately I am not able to fetch a handle to any of the > anchors using the getAnchorByHref( String href ) method the page in > question. > > Whenever I try to fetch a handle, I get an ElementNotFoundException. I > tried rendering the same html code in a browser(IE) and I could > actually see the links there. Also, something that surprised me was, > when I tried dumping the page using HtmlPage's asText(), nothing got > dumped. I presume asText() returns the page as seen in a browser. > > Appreciate your help, > > Best Regards > Vinay > > > ------------------------------------------------------- > 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: Vinay M. <vin...@gm...> - 2005-03-05 16:02:09
|
Hi, Does HtmlUnit have support for the <div> tag ? The reason why I ask this is that, I have a page that lists a bunch of anchors within a <div> tag. Unfortunately I am not able to fetch a handle to any of the anchors using the getAnchorByHref( String href ) method the page in question. Whenever I try to fetch a handle, I get an ElementNotFoundException. I tried rendering the same html code in a browser(IE) and I could actually see the links there. Also, something that surprised me was, when I tried dumping the page using HtmlPage's asText(), nothing got dumped. I presume asText() returns the page as seen in a browser. Appreciate your help, Best Regards Vinay |
From: Mike F. <mik...@ho...> - 2005-03-05 02:03:02
|
I tried the latest htmlunit source and the problem disappears - ie. it redirects correctly. Now I can't wait to see htmlunit 1.5 released. It looks like the developers have been doing a stellar job! _________________________________________________________________ On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement |
From: Rares Portan/SPR/RO <rp...@sa...> - 2005-03-04 14:54:06
|
Hello Dan, thank for the feedback. The bean was just an example, but there are other cases(like when the page requested by the user may be Page1 if some server conditions are meet, or Page2 otherwise) that depend on "invisible" session attributes. Anyway I know now what HtmlUnit can do and cannot do, it;s a great tool, but I still need the other tests. So because others may need the same thing I'm sharing with them how I do test my session objects also using only HtmlUnit. I've created a new servlet - named TestServlet :) - that will be used only for my tests. When you need to know a server side object value, create a request to this servlet passing these string parameters: 1) the object name - used by session.getAttribute("objectName") to get the object from session. 2) the method name - the method that will be invoked using reflection on the object retrieved from session 3) the method parameters - parameters used to invoke the method( hint: name parameters P0,P1,P2.. to find them easy) The response of the invoked method will be "converted" to string and send back as html something like this: <textarea>method_response</textarea>. I can use then HtmlUnit to parse the response and create my assert stuff. Thanks "Dan Levine" <dl...@ca...> Sent by: htm...@li... 03/03/2005 08:26 PM Please respond to htm...@li... To <htm...@li...> cc Subject RE: [Htmlunit-user] htmlunit and sessions (I am not a Htmlunit veteran, so someone else feel free to correct me) That is not what HtmlUnit is for. You cannot access server side variables. You can check their values though, if the variables are ever used to fill the values of a page (either a form default value or a text display). Similar to what I suggested in my last email, you have to make a page that displays the value of that bean, and then check against that. Usually, this already exists! For instance, since this is a login bean, does the next page show the login name somewhere? (i.e. "hello JoUser") Then you could wrap that username in a span tag and say: (pseudocode obviously) var name = "JoUser" HtmlUnit.setValueInForm(name, formElement) HtmlUnit.submitForm() HtmlUnit.getNewPageThatShowsUsername() AssertEquals(HtmlUnit.getNameElementInNewPage().asText(), name) Since the value on the page comes from the bean, if it matches what you put in the form than the bean was set successfully. You could also create a test page that prints out all of the session object values and then use that for testing all of you bean submit comparisons. You might also want to look into using Cactus for these tests, as that is a server side unit testing tool. HtmlUnit is made for black box testing of web apps on the Web tier. Dan -----Original Message----- From: htm...@li... [mailto:htm...@li...]On Behalf Of Rares Portan/SPR/RO Sent: Wednesday, March 02, 2005 11:13 PM To: htm...@li... Subject: Re: [Htmlunit-user] htmlunit and sessions Hi, I have some objects kept in session, for example let say I have a LoginBean that has a username field. This object is updated when the form is submitted with the username entered by user in the textfield. And the bean is then used by the middlelayer to get the username. This data is not saved in the database, is just kept in session to identify the user. What I want is to compare the bean.getUsername() value with the value set in the textfield. This is just an example, the problem is that I have some session objects that are updated all the time based on user actions and I feel that I can't make complete tests for my application without testing them. HtmlForm form=.. HtmlInput username=.. String newValue="MyNewValue"; //update the field value username.setValueAttribute(newValue); //submit the form form.submit(); //get object from session LoginBean bean=session.getAttribute("LoginBean"); assertEquals(newValue,bean.getUsername()); Brad Clarke <yo...@br...> Sent by: htm...@li... 03/02/2005 06:25 PM Please respond to htm...@li... To htm...@li... cc Subject Re: [Htmlunit-user] htmlunit and sessions I'm not sure exactly what you mean by "access to the session". Could you give an example? --- Rares Portan/SPR/RO <rp...@sa...> wrote: > Hello, > > I'm using HtmlUnit for a couple of days to create tests for a web app. > To test some of the pages I need to compare the form values with the > values of some objects kept in session. > > I wasn't able to get access to the session, is it possible? How can I do > that? > > Thank you ------------------------------------------------------- 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: Dan L. <dl...@ca...> - 2005-03-03 18:27:07
|
(I am not a Htmlunit veteran, so someone else feel free to correct me) That is not what HtmlUnit is for. You cannot access server side variables. You can check their values though, if the variables are ever used to fill the values of a page (either a form default value or a text display). Similar to what I suggested in my last email, you have to make a page that displays the value of that bean, and then check against that. Usually, this already exists! For instance, since this is a login bean, does the next page show the login name somewhere? (i.e. "hello JoUser") Then you could wrap that username in a span tag and say: (pseudocode obviously) var name = "JoUser" HtmlUnit.setValueInForm(name, formElement) HtmlUnit.submitForm() HtmlUnit.getNewPageThatShowsUsername() AssertEquals(HtmlUnit.getNameElementInNewPage().asText(), name) Since the value on the page comes from the bean, if it matches what you put in the form than the bean was set successfully. You could also create a test page that prints out all of the session object values and then use that for testing all of you bean submit comparisons. You might also want to look into using Cactus for these tests, as that is a server side unit testing tool. HtmlUnit is made for black box testing of web apps on the Web tier. Dan -----Original Message----- From: htm...@li... [mailto:htm...@li...]On Behalf Of Rares Portan/SPR/RO Sent: Wednesday, March 02, 2005 11:13 PM To: htm...@li... Subject: Re: [Htmlunit-user] htmlunit and sessions Hi, I have some objects kept in session, for example let say I have a LoginBean that has a username field. This object is updated when the form is submitted with the username entered by user in the textfield. And the bean is then used by the middlelayer to get the username. This data is not saved in the database, is just kept in session to identify the user. What I want is to compare the bean.getUsername() value with the value set in the textfield. This is just an example, the problem is that I have some session objects that are updated all the time based on user actions and I feel that I can't make complete tests for my application without testing them. HtmlForm form=.. HtmlInput username=.. String newValue="MyNewValue"; //update the field value username.setValueAttribute(newValue); //submit the form form.submit(); //get object from session LoginBean bean=session.getAttribute("LoginBean"); assertEquals(newValue,bean.getUsername()); Brad Clarke <yo...@br...> Sent by: htm...@li... 03/02/2005 06:25 PM Please respond to htm...@li... To htm...@li... cc Subject Re: [Htmlunit-user] htmlunit and sessions I'm not sure exactly what you mean by "access to the session". Could you give an example? --- Rares Portan/SPR/RO <rp...@sa...> wrote: > Hello, > > I'm using HtmlUnit for a couple of days to create tests for a web app. > To test some of the pages I need to compare the form values with the > values of some objects kept in session. > > I wasn't able to get access to the session, is it possible? How can I do > that? > > Thank you ------------------------------------------------------- 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-03 17:29:02
|
HtmlUnit's ActiveX support is really just a way of allowing pages with ActiveX controls to load without mock objects, not loading the real controls (unless you make an object that does that). A good example is the unit test for this: http://htmlunit.sourceforge.net/xref-test/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngineTest.html#755 SSL is also a bit of extra work to set up: http://htmlunit.sourceforge.net/jsse.html You've also hit a known bug when using setTimeout recursively: http://sourceforge.net/tracker/index.php?func=detail&aid=1103735&group_id=47038&atid=448266 I would suggest setting up jsse and making a mock object for your control that just always say that SSL is ready. You might also consider using setInterval in your web page instead of a recursive setTimeout. --- Vinay Murthy <vin...@gm...> wrote: > Hi, > > I am using HtmlUnit to connect to a site that requires me to perform a > SSL client authentication. The site works by installing a certificate > in my browser using the IE ActiveX object XEnroll to make the > certificate request. I trying to do the same through HtmlUnit and I > think I havent been to load the ActiveX object at all. > > The page specifies the ActiveX object within a span element as : > > <span id="spanXenroll" style="display:none"> > <Object ClassID="....." Codebase="...." ID="XEnroll"> > </Object> > </span> > > The code relating to the ActiveX Object is set dynamically using > span's innerHtml property. > > The page also has a method to check if the ActiveX object has been > loaded. This method is executed every 500ms using javascript's > setTimeOut method. This method gets executed five times after which I > get the following exception trace: > > Exception class=[org.mozilla.javascript.WrappedException] > com.gargoylesoftware.htmlunit.ScriptException: Wrapped > java.lang.IllegalArgumentException > at > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:294) > at > com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:709) > at com.gargoylesoftware.htmlunit.javascript.host.Window$1.run(Window.java:266) > at java.lang.Thread.run(Thread.java:534) > > WrappedException: org.mozilla.javascript.WrappedException: Wrapped > java.lang.IllegalArgumentException > at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1776) > at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:191) > at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:456) > at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:3026) > at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2164) > at > org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:140) > at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:304) > at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2769) > at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2145) > at > org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:140) > at > org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:149) > at org.mozilla.javascript.Context.evaluateString(Context.java:1220) > at > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:289) > at > com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:709) > at com.gargoylesoftware.htmlunit.javascript.host.Window$1.run(Window.java:266) > at java.lang.Thread.run(Thread.java:534) > Caused by: java.lang.IllegalArgumentException > at java.lang.Thread.setPriority(Thread.java:873) > at > com.gargoylesoftware.htmlunit.javascript.host.Window.jsFunction_setTimeout(Window.java:287) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:324) > at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:174) > ... 14 more > > Inside wrapped exception: > java.lang.IllegalArgumentException > at java.lang.Thread.setPriority(Thread.java:873) > at > com.gargoylesoftware.htmlunit.javascript.host.Window.jsFunction_setTimeout(Window.java:287) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:324) > at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:174) > at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:456) > at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:3026) > at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2164) > at > org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:140) > at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:304) > at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2769) > at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2145) > at > org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:140) > at > org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:149) > at org.mozilla.javascript.Context.evaluateString(Context.java:1220) > at > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:289) > at > com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:709) > at com.gargoylesoftware.htmlunit.javascript.host.Window$1.run(Window.java:266) > at java.lang.Thread.run(Thread.java:534) > == CALLING JAVASCRIPT == > GargoyleWrapper4() > ======= EXCEPTION END ======== > > The currentThread's priority falls out of the accepted range because > of the repeated execution of the above function to test if the ActiveX > object has been loaded. > > Is there anything else that I need to be doing to load the ActiveX object ? > > Any help would be greatly appreciated... > > Regards > Vinay |
From: Brad C. <yo...@br...> - 2005-03-03 17:15:18
|
What do you mean when you say you can't access elements of the page? Is it throwing an exception? Do you get the wrong page back? Can you examine the server logs and see if things are getting requested as you expect them to be? --- nikola <web...@ya...> wrote: > Marc wrote: > > >you just need to access the enclosed page, for > >instance with: > > > final HtmlInlineFrame iframe = > >(HtmlInlineFrame)page.getHtmlElementById("i_frame"); > > final HtmlPage containedPage = (HtmlPage) > >iframe.getEnclosedPage(); > > > Marc. > > nikola wrote: > > hi, > > > > I want to access iframe content as I can acsess > "main" > > page content for example: > > > > main.php page > > > > <html> > > <head><title>title</title></head> > > <body> > > some content<br> > > <a href="link.php">link</a> > > <iframe id="i_frame" name="i_frame" > > src="main.php?content_id=1"></iframe> > > </body></html> > > > > ... now if I want to get link or iframe on this > main > > page, I know how to do it... > > final HtmlInlineFrame iframe = > > > (HtmlInlineFrame)page.getHtmlElementById("i_frame"); > > > > but i want to know if there is a way to access > content > > of this iframe page, how can I access > > main.php?content_id=1 from main.php in some way > > referencing iframe, to get elements of that second > > page... > > > > ... I know I can get srcAttribute of iframe, and > then > > load main.php?content_id=1 to a WebClient, but then > I > > can"t access elements of that page, for example if > > there is link I can"t get it > > > > final HtmlAnchor anchor = > > second_page.getAnchorByHref(" some_href"); > > > > ... I get an error ElementNotFound ... > > > > thank you Marc for your answer it was helpfull, but > ...:) > > I have tried your solution with some test example, I > have also found my own solution and also tried to > write some simple html pages to test it and also works > fine: > > [code] > final WebWindow secondWebWindow = > webClient.getWebWindowByName("my_iframe"); > assertInstanceOf(secondWebWindow, > BaseFrame.FrameWindow.class); > assertSame( firstPage, > ((BaseFrame.FrameWindow) > secondWebWindow).getEnclosingPage() ); > //assertEquals( "SomeTitle", > ((HtmlPage)secondWebWindow.getEnclosedPage()).getTitleText() > ); > > [code] > > , but both solution don't work in my web application > ... > > ... my main page is protected (with login ...), and I > can simulate login, and it works fine, I can then > access all elements with no problem ... the second > page (which is contained in iframe) it's even not > protected, and I can't access elements of that page > ... and neither page is complex or something like > that, both pages are simple html pages generated by > php and I can't understand what's wrong with that > pages, so if anyone had similar problems, please reply > ... > > Nikola > > > > > __________________________________ > Celebrate Yahoo!'s 10th Birthday! > Yahoo! Netrospective: 100 Moments of the Web > http://birthday.yahoo.com/netrospective/ > > > ------------------------------------------------------- > 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-03 17:12:42
|
Just make something like ImmediateRefreshHandler or WaitingRefreshHandler that handles your special case as well. --- Mike Firth <mik...@ho...> wrote: > Yes, it works in IE and Safari. > > So how do you do manual redirection, since auto-redirect isn't working > properly? > > The closest things I can find to a spec on status code 302 are: > > * /javadoc/javax/servlet/http/HttpServletResponse.html#SC_MOVED_TEMPORARILY > * > http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/http/HttpServletResponse.html#sendRedirect(java.lang.String) > * http://www.faqs.org/rfcs/rfc2068.html > > > >From: Brad Clarke <yo...@br...> > >Reply-To: htm...@li... > >To: htm...@li... > >Subject: Re: [Htmlunit-user] Redirect to relative address in a frame causes > >loop > >Date: Wed, 2 Mar 2005 08:15:21 -0800 (PST) > > > >Assuming that this works in the browser for you then it's likely a bug with > >no > >simple fix (you could pull latest CVS and make a custom RefreshHandler but > >it would > >not be a generic fix because the data it's given would be incorrect). > > > >That seems like a strange thing to specify in a Location header for the > >response you > >expect. Is there a spec anywhere on interpretation of incomplete URIs in > >HTTP > >Location headers? > > > >--- Mike Firth <mik...@ho...> wrote: > > > > > Hi, > > > > > > Is there a quick workaround to this problem? And should I submit it as a > > > bug? > > > > > > A redirect (302) occurs in a frame. It specifies a relative location, > >but > > > HtmlUnit is truncating the address, causing the website to respond with > >the > > > whole frameset. When autoredirect is on, this causes an infinite loop! I > > > never get past webClient.getPage(url) and the log fills up with: > > > > > > 22:33:15,132 (HttpMethodDirector:780) INFO [main] - Redirect requested > >but > > > followRedirects is disabled > > > 22:33:17,059 (HttpMethodDirector:780) INFO [main] - Redirect requested > >but > > > followRedirects is disabled > > > etc, etc, etc. > > > > > > My code: > > > final WebClient webClient = new > > > WebClient(BrowserVersion.INTERNET_EXPLORER_6_0); > > > webClient.setRedirectEnabled(true); > > > final URL url = new URL("http://somewhere.com/main/"); > > > final HtmlPage page = (HtmlPage) webClient.getPage(url); > > > > > > The response is 200 OK and this: > > > > > > <html> > > > <head> > > > <title>somewhere.com</title> > > > <meta http-equiv="Content-Type" content="text/html"> > > > </head> > > > <frameset rows="0,*" frameborder="NO" border="0" framespacing="0"> > > > <frame src="blank.php" name="stealthFrame" scrolling="NO" noresize > > > > <frame src="front.php" name="frontFrame"> > > > </frameset> > > > <noframes> > > > <body> > > > </body></noframes> > > > </html> > > > > > > but front.php returns 302 Found, with location: ?choice=first , which > >should > > > cause this: > > > > > > GET /main/front.php?choice=first > > > > > > but instead HtmlUnit does this: > > > > > > GET /main/?choice=first > > > > > > which the website responds to by sending the first page again. Instant > >loop. > > > > > > Is there a quick workaround? How do you code to handle a redirect > >manually? > > > > > > Regards, > > > > > > Mike > > > > > > > >------------------------------------------------------- > >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 > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > ------------------------------------------------------- > 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: Marc G. <mgu...@ya...> - 2005-03-03 15:34:40
|
what do you get when you look at the content of the page enclosed in the frame? Marc. |
From: nikola <web...@ya...> - 2005-03-03 14:43:15
|
Marc wrote: >you just need to access the enclosed page, for >instance with: > final HtmlInlineFrame iframe = >(HtmlInlineFrame)page.getHtmlElementById("i_frame"); > final HtmlPage containedPage = (HtmlPage) >iframe.getEnclosedPage(); > Marc. nikola wrote: > hi, > > I want to access iframe content as I can acsess "main" > page content for example: > > main.php page > > <html> > <head><title>title</title></head> > <body> > some content<br> > <a href="link.php">link</a> > <iframe id="i_frame" name="i_frame" > src="main.php?content_id=1"></iframe> > </body></html> > > ... now if I want to get link or iframe on this main > page, I know how to do it... > final HtmlInlineFrame iframe = > (HtmlInlineFrame)page.getHtmlElementById("i_frame"); > > but i want to know if there is a way to access content > of this iframe page, how can I access > main.php?content_id=1 from main.php in some way > referencing iframe, to get elements of that second > page... > > ... I know I can get srcAttribute of iframe, and then > load main.php?content_id=1 to a WebClient, but then I > can"t access elements of that page, for example if > there is link I can"t get it > > final HtmlAnchor anchor = > second_page.getAnchorByHref(" some_href"); > > ... I get an error ElementNotFound ... > thank you Marc for your answer it was helpfull, but ...:) I have tried your solution with some test example, I have also found my own solution and also tried to write some simple html pages to test it and also works fine: [code] final WebWindow secondWebWindow = webClient.getWebWindowByName("my_iframe"); assertInstanceOf(secondWebWindow, BaseFrame.FrameWindow.class); assertSame( firstPage, ((BaseFrame.FrameWindow) secondWebWindow).getEnclosingPage() ); //assertEquals( "SomeTitle", ((HtmlPage)secondWebWindow.getEnclosedPage()).getTitleText() ); [code] , but both solution don't work in my web application ... ... my main page is protected (with login ...), and I can simulate login, and it works fine, I can then access all elements with no problem ... the second page (which is contained in iframe) it's even not protected, and I can't access elements of that page ... and neither page is complex or something like that, both pages are simple html pages generated by php and I can't understand what's wrong with that pages, so if anyone had similar problems, please reply ... Nikola __________________________________ Celebrate Yahoo!'s 10th Birthday! Yahoo! Netrospective: 100 Moments of the Web http://birthday.yahoo.com/netrospective/ |
From: Marc G. <mgu...@ya...> - 2005-03-03 10:19:33
|
you just need to access the enclosed page, for instance with: final HtmlInlineFrame iframe = (HtmlInlineFrame)page.getHtmlElementById("i_frame"); final HtmlPage containedPage = (HtmlPage) iframe.getEnclosedPage(); Marc. nikola wrote: > hi, > > I want to access iframe content as I can acsess "main" > page content for example: > > main.php page > > <html> > <head><title>title</title></head> > <body> > some content<br> > <a href="link.php">link</a> > <iframe id="i_frame" name="i_frame" > src="main.php?content_id=1"></iframe> > </body></html> > > ... now if I want to get link or iframe on this main > page, I know how to do it... > final HtmlInlineFrame iframe = > (HtmlInlineFrame)page.getHtmlElementById("i_frame"); > > but i want to know if there is a way to access content > of this iframe page, how can I access > main.php?content_id=1 from main.php in some way > referencing iframe, to get elements of that second > page... > > ... I know I can get srcAttribute of iframe, and then > load main.php?content_id=1 to a WebClient, but then I > can't access elements of that page, for example if > there is link I can't get it > > final HtmlAnchor anchor = > second_page.getAnchorByHref(" some_href"); > > ... I get an error ElementNotFound ... > > > > > > > __________________________________ > Celebrate Yahoo!'s 10th Birthday! > Yahoo! Netrospective: 100 Moments of the Web > http://birthday.yahoo.com/netrospective/ > > > ------------------------------------------------------- > 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: nikola <web...@ya...> - 2005-03-03 08:54:57
|
hi, I want to access iframe content as I can acsess "main" page content for example: main.php page <html> <head><title>title</title></head> <body> some content<br> <a href="link.php">link</a> <iframe id="i_frame" name="i_frame" src="main.php?content_id=1"></iframe> </body></html> ... now if I want to get link or iframe on this main page, I know how to do it... final HtmlInlineFrame iframe = (HtmlInlineFrame)page.getHtmlElementById("i_frame"); but i want to know if there is a way to access content of this iframe page, how can I access main.php?content_id=1 from main.php in some way referencing iframe, to get elements of that second page... ... I know I can get srcAttribute of iframe, and then load main.php?content_id=1 to a WebClient, but then I can't access elements of that page, for example if there is link I can't get it final HtmlAnchor anchor = second_page.getAnchorByHref(" some_href"); ... I get an error ElementNotFound ... __________________________________ Celebrate Yahoo!'s 10th Birthday! Yahoo! Netrospective: 100 Moments of the Web http://birthday.yahoo.com/netrospective/ |
From: Rares Portan/SPR/RO <rp...@sa...> - 2005-03-03 07:15:34
|
Hi, I have some objects kept in session, for example let say I have a LoginBean that has a username field. This object is updated when the form is submitted with the username entered by user in the textfield. And the bean is then used by the middlelayer to get the username. This data is not saved in the database, is just kept in session to identify the user. What I want is to compare the bean.getUsername() value with the value set in the textfield. This is just an example, the problem is that I have some session objects that are updated all the time based on user actions and I feel that I can't make complete tests for my application without testing them. HtmlForm form=.. HtmlInput username=.. String newValue="MyNewValue"; //update the field value username.setValueAttribute(newValue); //submit the form form.submit(); //get object from session LoginBean bean=session.getAttribute("LoginBean"); assertEquals(newValue,bean.getUsername()); Brad Clarke <yo...@br...> Sent by: htm...@li... 03/02/2005 06:25 PM Please respond to htm...@li... To htm...@li... cc Subject Re: [Htmlunit-user] htmlunit and sessions I'm not sure exactly what you mean by "access to the session". Could you give an example? --- Rares Portan/SPR/RO <rp...@sa...> wrote: > Hello, > > I'm using HtmlUnit for a couple of days to create tests for a web app. > To test some of the pages I need to compare the form values with the > values of some objects kept in session. > > I wasn't able to get access to the session, is it possible? How can I do > that? > > Thank you ------------------------------------------------------- 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 |