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: Erskine, C. <chr...@ed...> - 2004-12-10 21:22:08
|
The response type has to be set before anything is written to it. Chris Erskine EDS Consulting Services F5-EDS-001 2424 Garden of the Gods Rd Colorado Springs, CO 80919 Phone: 719-535-6064 > -----Original Message----- > From: htm...@li... [mailto:htmlunit-user- > ad...@li...] On Behalf Of Rousseau, Jean Rene > Sent: Friday, December 10, 2004 1:53 PM > To: 'htm...@li...' > Subject: RE: [Htmlunit-user] Re: Problems handling with the Content-Type i > s specified using ME TA tags? > > I tought that was the problem too, because the servlet that works do > explicitely set the content-type in the response object. So I added that > to > the servlet filter, before the XSL transformation.. but no luck :( > > ..but then when I received your email, I went back on that track. I > removed > the filter to do my transformation directly in the servlet instead and it > worked !!!! > > I then reintroduced my filter but instead of setting the content-type > after > the "chain.doFilter(request,response)", i did it before and it worked ! > > public void doFilter(ServletRequest request, ServletResponse response, > FilterChain chain) throws IOException, ServletException > { > > response.setContentType("text/html"); > CharResponseWrapper responseWrap = new > CharResponseWrapper((HttpServletResponse)response); > chain.doFilter( request,responseWrap); > > // XSL Transformation here > (...) > } > > I'm not sure if I understand why it needs to be set before I start playing > with the repsonse object. I guess its related to the response wrapper that > I > use. > > Anyway thank you guys for your help ! > > Jean-Rene > > p.s. I was hit by your working address. I had the chance to visit the > Garden > of Gods a couple of years ago... VERY NICE :) > > > -----Original Message----- > > From: Erskine, Chris [mailto:chr...@ed...] > > Sent: Friday, December 10, 2004 3:04 PM > > To: htm...@li... > > Subject: RE: [Htmlunit-user] Re: Problems handling with the > > Content-Type > > i s specified using ME TA tags? > > > > > > Jean-Rene, > > > > Are you actually setting the response type? I have found > > that at times, you > > have to set the expected response type which is done with > > code, not the META > > tag. > > > > Chris Erskine > > > > EDS Consulting Services > > F5-EDS-001 > > 2424 Garden of the Gods Rd > > Colorado Springs, CO 80919 > > > > Phone: 719-535-6064 > > > > > > > -----Original Message----- > > > From: htm...@li... > > [mailto:htmlunit-user- > > > ad...@li...] On Behalf Of Rousseau, Jean Rene > > > Sent: Friday, December 10, 2004 12:48 PM > > > To: 'htm...@li...' > > > Subject: RE: [Htmlunit-user] Re: Problems handling with the > > Content-Type i > > > s specified using ME TA tags? > > > > > > everything works perfectly fine with a regular browser. > > Actually this > > > application is in production in several of our customers. > > It works fine > > > also > > > with JWebUnit(HttpUnit). > > > > > > One of the difference between the working pages and the > > non-working pages > > > is > > > that the non-working pages go through a ServletFilter before being > > > produced. > > > In Both cases, a Servlet handles the request, produced XML > > that is then > > > transformed by an XSL stylesheet. > > > > > > I'll re-try with the proposed loggers > > > > > > thanks, > > > > > > Jean-Rene > > > > > > > -----Original Message----- > > > > From: Marc Guillemot [mailto:mgu...@ya...] > > > > Sent: Friday, December 10, 2004 2:42 PM > > > > To: htm...@li... > > > > Subject: Re: [Htmlunit-user] Re: Problems handling with the > > > > Content-Type > > > > is specified using ME TA tags? > > > > > > > > > > > > Jean Rene, > > > > > > > > you can set log level to debug for > > > > > > > > logger.httpclient.wire > > > > httpclient.wire.header > > > > httpclient.wire.content > > > > > > > > and you will really get more information. > > > > > > > > Are some of the pages you have problem with available on > > the internet? > > > > > > > > Marc. > > > > > > > > Rousseau, Jean Rene wrote: > > > > > I'm so confused with this problem... > > > > > > > > > > Here are my logs when it works > > > > > > > > > > Content type is: text/html > > > > > Content stream is: > > > > > <html > > > > > > xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslatorUtil" > > > > > xmlns:java="java"> > > > > > <head> > > > > > <META http-equiv="Content-Type" content="text/html; > > charset=UTF-8"> > > > > > (...) > > > > > > > > > > Here is when it doesn't work: > > > > > > > > > > Content type is: > > > > > Content Stream is: > > > > > <html > > > > > > xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslatorUtil" > > > > > xmlns:java="java"> > > > > > <head> > > > > > <META http-equiv="Content-Type" content="text/html; > > charset=UTF-8"> > > > > > (...) > > > > > > > > > > We clearly see that webResponde.getContentType() returns > > > > null !! but why > > > > > !?!?!? response content stream is the same as the > > correct output. > > > > > > > > > > So how is it possible that my content-type is null in > > > > certain pages ? > > > > > > > > > > > > > > >>-----Original Message----- > > > > >>From: David D.Kilzer [mailto:ddk...@ki...] > > > > >>Sent: Friday, December 10, 2004 11:40 AM > > > > >>To: htm...@li... > > > > >>Subject: Re: [Htmlunit-user] Re: Problems handling with the > > > > >>Content-Type > > > > >>i s specified using ME TA tags? > > > > >> > > > > >> > > > > >>What "Content-Type:" header is your web server sending back > > > > for this > > > > >>page? (If you're using Mozilla or Firefox, you can do a > > > > "Get Info" > > > > >>once the page is loaded to find out, or use a packet > > sniffer like > > > > >>Ethereal to capture the headers "on the wire".) > > > > >> > > > > >>In htmlunit-1.3, the DefaultPageCreator.createPage() method > > > > is where > > > > >>the decision is made on what type of page to create. > > > > >>Apparently, this > > > > >>page is causing all of the if/else logic to fall through to > > > > >>create an > > > > >>UnexpectedPage object. > > > > >> > > > > >>Dave > > > > >> > > > > >> > > > > >>On Dec 10, 2004, at 9:16 AM, Rousseau, Jean Rene wrote: > > > > >> > > > > >> > > > > >>>Hi, > > > > >>> > > > > >>>Here is more info about my problem. I'm really confused, > > > > >> > > > > >>because I have > > > > >> > > > > >>>similar headers in other pages and they work ok !!. > > > > >>> > > > > >>>Any ideas ? > > > > >>> > > > > >>> > > > > >>>code: > > > > >>> > > > > >>> URL url = new > > > > >> > > > > >>URL(state.getBaseUrl()+"/html/admin/home_en.html"); > > > > >> > > > > >>> HtmlPage page = null; > > > > >>> page = (HtmlPage)state.getWebClient().getPage(url); > > > > >>> HtmlForm form = page.getFormByName("login"); > > > > >>> > > > > >>> > > > > >> > > > > >>form.getInputByName("userid").setValueAttribute(cells.more.tex > > > > >>t().toUpp > > > > >> > > > > >>>erCase()); > > > > >>> > > > > >>> > > > > >> > > > > >>form.getInputByName("password").setValueAttribute(cells.more.m > > > > > > > > > > ore.text( > > > > > > > > > >>>).toUpperCase()); > > > > >>> > > > > >>> Page p = form.submit(); > > > > >>> System.out.println(p); > > > > >>> > > System.out.println(p.getWebResponse().getContentAsString()); > > > > >>> state.setCurrentPage((HtmlPage)form.submit()); > > > > >>> > > > > >>>This gives me a ClassCastException because the > > response page is an > > > > >>>UnexcpectedPage. > > > > >>> > > > > >>>output: > > > > >>> > > > > >>>com.gargoylesoftware.htmlunit.UnexpectedPage@302e67 > > > > >>> > > > > >>><html > > > > >>> > > > > >> > > > > >>xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslat > > > > orUtil" > > > > >> > > > > >>>xmlns:java="java"> > > > > >>><head> > > > > >>><META http-equiv="Content-Type" content="text/html; > > > > >>>charset=ISO-8859-1"> > > > > >>><link href="/pca/stylesheets/pcaadmin.css" type="text/css" > > > > >>>rel="stylesheet"> > > > > >>><title>PCA Admin: Users List</title> > > > > >>></head> > > > > >>>(...) > > > > >> > > > > >> > > > > >> > > > > >>------------------------------------------------------- > > > > >>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://productguide.itmanagersjournal.com/ > > > > >>_______________________________________________ > > > > >>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://productguide.itmanagersjournal.com/ > > > > > _______________________________________________ > > > > > 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://productguide.itmanagersjournal.com/ > > > > _______________________________________________ > > > > 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://productguide.itmanagersjournal.com/ > > > _______________________________________________ > > > 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://productguide.itmanagersjournal.com/ > > _______________________________________________ > > 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://productguide.itmanagersjournal.com/ > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Rousseau, J. R. <JRR...@Ba...> - 2004-12-10 20:53:01
|
I tought that was the problem too, because the servlet that works do explicitely set the content-type in the response object. So I added that to the servlet filter, before the XSL transformation.. but no luck :( ..but then when I received your email, I went back on that track. I removed the filter to do my transformation directly in the servlet instead and it worked !!!! I then reintroduced my filter but instead of setting the content-type after the "chain.doFilter(request,response)", i did it before and it worked ! public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { response.setContentType("text/html"); CharResponseWrapper responseWrap = new CharResponseWrapper((HttpServletResponse)response); chain.doFilter( request,responseWrap); // XSL Transformation here (...) } I'm not sure if I understand why it needs to be set before I start playing with the repsonse object. I guess its related to the response wrapper that I use. Anyway thank you guys for your help ! Jean-Rene p.s. I was hit by your working address. I had the chance to visit the Garden of Gods a couple of years ago... VERY NICE :) > -----Original Message----- > From: Erskine, Chris [mailto:chr...@ed...] > Sent: Friday, December 10, 2004 3:04 PM > To: htm...@li... > Subject: RE: [Htmlunit-user] Re: Problems handling with the > Content-Type > i s specified using ME TA tags? > > > Jean-Rene, > > Are you actually setting the response type? I have found > that at times, you > have to set the expected response type which is done with > code, not the META > tag. > > Chris Erskine > > EDS Consulting Services > F5-EDS-001 > 2424 Garden of the Gods Rd > Colorado Springs, CO 80919 > > Phone: 719-535-6064 > > > > -----Original Message----- > > From: htm...@li... > [mailto:htmlunit-user- > > ad...@li...] On Behalf Of Rousseau, Jean Rene > > Sent: Friday, December 10, 2004 12:48 PM > > To: 'htm...@li...' > > Subject: RE: [Htmlunit-user] Re: Problems handling with the > Content-Type i > > s specified using ME TA tags? > > > > everything works perfectly fine with a regular browser. > Actually this > > application is in production in several of our customers. > It works fine > > also > > with JWebUnit(HttpUnit). > > > > One of the difference between the working pages and the > non-working pages > > is > > that the non-working pages go through a ServletFilter before being > > produced. > > In Both cases, a Servlet handles the request, produced XML > that is then > > transformed by an XSL stylesheet. > > > > I'll re-try with the proposed loggers > > > > thanks, > > > > Jean-Rene > > > > > -----Original Message----- > > > From: Marc Guillemot [mailto:mgu...@ya...] > > > Sent: Friday, December 10, 2004 2:42 PM > > > To: htm...@li... > > > Subject: Re: [Htmlunit-user] Re: Problems handling with the > > > Content-Type > > > is specified using ME TA tags? > > > > > > > > > Jean Rene, > > > > > > you can set log level to debug for > > > > > > logger.httpclient.wire > > > httpclient.wire.header > > > httpclient.wire.content > > > > > > and you will really get more information. > > > > > > Are some of the pages you have problem with available on > the internet? > > > > > > Marc. > > > > > > Rousseau, Jean Rene wrote: > > > > I'm so confused with this problem... > > > > > > > > Here are my logs when it works > > > > > > > > Content type is: text/html > > > > Content stream is: > > > > <html > > > > xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslatorUtil" > > > > xmlns:java="java"> > > > > <head> > > > > <META http-equiv="Content-Type" content="text/html; > charset=UTF-8"> > > > > (...) > > > > > > > > Here is when it doesn't work: > > > > > > > > Content type is: > > > > Content Stream is: > > > > <html > > > > xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslatorUtil" > > > > xmlns:java="java"> > > > > <head> > > > > <META http-equiv="Content-Type" content="text/html; > charset=UTF-8"> > > > > (...) > > > > > > > > We clearly see that webResponde.getContentType() returns > > > null !! but why > > > > !?!?!? response content stream is the same as the > correct output. > > > > > > > > So how is it possible that my content-type is null in > > > certain pages ? > > > > > > > > > > > >>-----Original Message----- > > > >>From: David D.Kilzer [mailto:ddk...@ki...] > > > >>Sent: Friday, December 10, 2004 11:40 AM > > > >>To: htm...@li... > > > >>Subject: Re: [Htmlunit-user] Re: Problems handling with the > > > >>Content-Type > > > >>i s specified using ME TA tags? > > > >> > > > >> > > > >>What "Content-Type:" header is your web server sending back > > > for this > > > >>page? (If you're using Mozilla or Firefox, you can do a > > > "Get Info" > > > >>once the page is loaded to find out, or use a packet > sniffer like > > > >>Ethereal to capture the headers "on the wire".) > > > >> > > > >>In htmlunit-1.3, the DefaultPageCreator.createPage() method > > > is where > > > >>the decision is made on what type of page to create. > > > >>Apparently, this > > > >>page is causing all of the if/else logic to fall through to > > > >>create an > > > >>UnexpectedPage object. > > > >> > > > >>Dave > > > >> > > > >> > > > >>On Dec 10, 2004, at 9:16 AM, Rousseau, Jean Rene wrote: > > > >> > > > >> > > > >>>Hi, > > > >>> > > > >>>Here is more info about my problem. I'm really confused, > > > >> > > > >>because I have > > > >> > > > >>>similar headers in other pages and they work ok !!. > > > >>> > > > >>>Any ideas ? > > > >>> > > > >>> > > > >>>code: > > > >>> > > > >>> URL url = new > > > >> > > > >>URL(state.getBaseUrl()+"/html/admin/home_en.html"); > > > >> > > > >>> HtmlPage page = null; > > > >>> page = (HtmlPage)state.getWebClient().getPage(url); > > > >>> HtmlForm form = page.getFormByName("login"); > > > >>> > > > >>> > > > >> > > > >>form.getInputByName("userid").setValueAttribute(cells.more.tex > > > >>t().toUpp > > > >> > > > >>>erCase()); > > > >>> > > > >>> > > > >> > > > >>form.getInputByName("password").setValueAttribute(cells.more.m > > > > > > > > ore.text( > > > > > > > >>>).toUpperCase()); > > > >>> > > > >>> Page p = form.submit(); > > > >>> System.out.println(p); > > > >>> > System.out.println(p.getWebResponse().getContentAsString()); > > > >>> state.setCurrentPage((HtmlPage)form.submit()); > > > >>> > > > >>>This gives me a ClassCastException because the > response page is an > > > >>>UnexcpectedPage. > > > >>> > > > >>>output: > > > >>> > > > >>>com.gargoylesoftware.htmlunit.UnexpectedPage@302e67 > > > >>> > > > >>><html > > > >>> > > > >> > > > >>xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslat > > > orUtil" > > > >> > > > >>>xmlns:java="java"> > > > >>><head> > > > >>><META http-equiv="Content-Type" content="text/html; > > > >>>charset=ISO-8859-1"> > > > >>><link href="/pca/stylesheets/pcaadmin.css" type="text/css" > > > >>>rel="stylesheet"> > > > >>><title>PCA Admin: Users List</title> > > > >>></head> > > > >>>(...) > > > >> > > > >> > > > >> > > > >>------------------------------------------------------- > > > >>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://productguide.itmanagersjournal.com/ > > > >>_______________________________________________ > > > >>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://productguide.itmanagersjournal.com/ > > > > _______________________________________________ > > > > 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://productguide.itmanagersjournal.com/ > > > _______________________________________________ > > > 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://productguide.itmanagersjournal.com/ > > _______________________________________________ > > 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://productguide.itmanagersjournal.com/ > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: Brad C. <yo...@br...> - 2004-12-10 20:17:00
|
I recently had to refactor DefaultPageCreator to make easier to handle unknown content types that are really html pages. All you need to do is extend DefaultPageCreator and override the createPage() method to do what you want. If you always have html pages returned then just take out all the logic and always make an HtmlPage: http://htmlunit.sourceforge.net/xref/com/gargoylesoftware/htmlunit/DefaultPageCreator.html#73 Brad C --- "Erskine, Chris" <chr...@ed...> wrote: > Jean-Rene, > > Are you actually setting the response type? I have found that at times, you > have to set the expected response type which is done with code, not the META > tag. > > Chris Erskine > > EDS Consulting Services > F5-EDS-001 > 2424 Garden of the Gods Rd > Colorado Springs, CO 80919 > > Phone: 719-535-6064 > > > > -----Original Message----- > > From: htm...@li... [mailto:htmlunit-user- > > ad...@li...] On Behalf Of Rousseau, Jean Rene > > Sent: Friday, December 10, 2004 12:48 PM > > To: 'htm...@li...' > > Subject: RE: [Htmlunit-user] Re: Problems handling with the Content-Type i > > s specified using ME TA tags? > > > > everything works perfectly fine with a regular browser. Actually this > > application is in production in several of our customers. It works fine > > also > > with JWebUnit(HttpUnit). > > > > One of the difference between the working pages and the non-working pages > > is > > that the non-working pages go through a ServletFilter before being > > produced. > > In Both cases, a Servlet handles the request, produced XML that is then > > transformed by an XSL stylesheet. > > > > I'll re-try with the proposed loggers > > > > thanks, > > > > Jean-Rene > > > > > -----Original Message----- > > > From: Marc Guillemot [mailto:mgu...@ya...] > > > Sent: Friday, December 10, 2004 2:42 PM > > > To: htm...@li... > > > Subject: Re: [Htmlunit-user] Re: Problems handling with the > > > Content-Type > > > is specified using ME TA tags? > > > > > > > > > Jean Rene, > > > > > > you can set log level to debug for > > > > > > logger.httpclient.wire > > > httpclient.wire.header > > > httpclient.wire.content > > > > > > and you will really get more information. > > > > > > Are some of the pages you have problem with available on the internet? > > > > > > Marc. > > > > > > Rousseau, Jean Rene wrote: > > > > I'm so confused with this problem... > > > > > > > > Here are my logs when it works > > > > > > > > Content type is: text/html > > > > Content stream is: > > > > <html > > > xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslatorUtil" > > > > xmlns:java="java"> > > > > <head> > > > > <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> > > > > (...) > > > > > > > > Here is when it doesn't work: > > > > > > > > Content type is: > > > > Content Stream is: > > > > <html > > > xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslatorUtil" > > > > xmlns:java="java"> > > > > <head> > > > > <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> > > > > (...) > > > > > > > > We clearly see that webResponde.getContentType() returns > > > null !! but why > > > > !?!?!? response content stream is the same as the correct output. > > > > > > > > So how is it possible that my content-type is null in > > > certain pages ? > > > > > > > > > > > >>-----Original Message----- > > > >>From: David D.Kilzer [mailto:ddk...@ki...] > > > >>Sent: Friday, December 10, 2004 11:40 AM > > > >>To: htm...@li... > > > >>Subject: Re: [Htmlunit-user] Re: Problems handling with the > > > >>Content-Type > > > >>i s specified using ME TA tags? > > > >> > > > >> > > > >>What "Content-Type:" header is your web server sending back > > > for this > > > >>page? (If you're using Mozilla or Firefox, you can do a > > > "Get Info" > > > >>once the page is loaded to find out, or use a packet sniffer like > > > >>Ethereal to capture the headers "on the wire".) > > > >> > > > >>In htmlunit-1.3, the DefaultPageCreator.createPage() method > > > is where > > > >>the decision is made on what type of page to create. > > > >>Apparently, this > > > >>page is causing all of the if/else logic to fall through to > > > >>create an > > > >>UnexpectedPage object. > > > >> > > > >>Dave > > > >> > > > >> > > > >>On Dec 10, 2004, at 9:16 AM, Rousseau, Jean Rene wrote: > > > >> > > > >> > > > >>>Hi, > > > >>> > > > >>>Here is more info about my problem. I'm really confused, > > > >> > > > >>because I have > > > >> > > > >>>similar headers in other pages and they work ok !!. > > > >>> > > > >>>Any ideas ? > > > >>> > > > >>> > > > >>>code: > > > >>> > > > >>> URL url = new > > > >> > > > >>URL(state.getBaseUrl()+"/html/admin/home_en.html"); > > > >> > > > >>> HtmlPage page = null; > > > >>> page = (HtmlPage)state.getWebClient().getPage(url); > > > >>> HtmlForm form = page.getFormByName("login"); > > > >>> > > > >>> > > > >> > > > >>form.getInputByName("userid").setValueAttribute(cells.more.tex > > > >>t().toUpp > > > >> > > > >>>erCase()); > > > >>> > > > >>> > > > >> > > > >>form.getInputByName("password").setValueAttribute(cells.more.m > > > > > > > > ore.text( > > > > > > > >>>).toUpperCase()); > > > >>> > > > >>> Page p = form.submit(); > > > >>> System.out.println(p); > > > >>> System.out.println(p.getWebResponse().getContentAsString()); > > > >>> state.setCurrentPage((HtmlPage)form.submit()); > > > >>> > > > >>>This gives me a ClassCastException because the response page is an > > > >>>UnexcpectedPage. > > > >>> > > > >>>output: > > > >>> > > > >>>com.gargoylesoftware.htmlunit.UnexpectedPage@302e67 > > > >>> > > > >>><html > > > >>> > > > >> > > > >>xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslat > > > orUtil" > > > >> > > > >>>xmlns:java="java"> > > > >>><head> > > > >>><META http-equiv="Content-Type" content="text/html; > > > >>>charset=ISO-8859-1"> > > > >>><link href="/pca/stylesheets/pcaadmin.css" type="text/css" > > > >>>rel="stylesheet"> > > > >>><title>PCA Admin: Users List</title> > > > >>></head> > > > >>>(...) > > > >> > > > >> > > > >> > > > >>------------------------------------------------------- > > > >>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://productguide.itmanagersjournal.com/ > > > >>_______________________________________________ > > > >>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://productguide.itmanagersjournal.com/ > > > > _______________________________________________ > > > > 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://productguide.itmanagersjournal.com/ > > > _______________________________________________ > > > 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://productguide.itmanagersjournal.com/ > > _______________________________________________ > > 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://productguide.itmanagersjournal.com/ > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: Erskine, C. <chr...@ed...> - 2004-12-10 20:05:11
|
Jean-Rene, Are you actually setting the response type? I have found that at times, you have to set the expected response type which is done with code, not the META tag. Chris Erskine EDS Consulting Services F5-EDS-001 2424 Garden of the Gods Rd Colorado Springs, CO 80919 Phone: 719-535-6064 > -----Original Message----- > From: htm...@li... [mailto:htmlunit-user- > ad...@li...] On Behalf Of Rousseau, Jean Rene > Sent: Friday, December 10, 2004 12:48 PM > To: 'htm...@li...' > Subject: RE: [Htmlunit-user] Re: Problems handling with the Content-Type i > s specified using ME TA tags? > > everything works perfectly fine with a regular browser. Actually this > application is in production in several of our customers. It works fine > also > with JWebUnit(HttpUnit). > > One of the difference between the working pages and the non-working pages > is > that the non-working pages go through a ServletFilter before being > produced. > In Both cases, a Servlet handles the request, produced XML that is then > transformed by an XSL stylesheet. > > I'll re-try with the proposed loggers > > thanks, > > Jean-Rene > > > -----Original Message----- > > From: Marc Guillemot [mailto:mgu...@ya...] > > Sent: Friday, December 10, 2004 2:42 PM > > To: htm...@li... > > Subject: Re: [Htmlunit-user] Re: Problems handling with the > > Content-Type > > is specified using ME TA tags? > > > > > > Jean Rene, > > > > you can set log level to debug for > > > > logger.httpclient.wire > > httpclient.wire.header > > httpclient.wire.content > > > > and you will really get more information. > > > > Are some of the pages you have problem with available on the internet? > > > > Marc. > > > > Rousseau, Jean Rene wrote: > > > I'm so confused with this problem... > > > > > > Here are my logs when it works > > > > > > Content type is: text/html > > > Content stream is: > > > <html > > xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslatorUtil" > > > xmlns:java="java"> > > > <head> > > > <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> > > > (...) > > > > > > Here is when it doesn't work: > > > > > > Content type is: > > > Content Stream is: > > > <html > > xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslatorUtil" > > > xmlns:java="java"> > > > <head> > > > <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> > > > (...) > > > > > > We clearly see that webResponde.getContentType() returns > > null !! but why > > > !?!?!? response content stream is the same as the correct output. > > > > > > So how is it possible that my content-type is null in > > certain pages ? > > > > > > > > >>-----Original Message----- > > >>From: David D.Kilzer [mailto:ddk...@ki...] > > >>Sent: Friday, December 10, 2004 11:40 AM > > >>To: htm...@li... > > >>Subject: Re: [Htmlunit-user] Re: Problems handling with the > > >>Content-Type > > >>i s specified using ME TA tags? > > >> > > >> > > >>What "Content-Type:" header is your web server sending back > > for this > > >>page? (If you're using Mozilla or Firefox, you can do a > > "Get Info" > > >>once the page is loaded to find out, or use a packet sniffer like > > >>Ethereal to capture the headers "on the wire".) > > >> > > >>In htmlunit-1.3, the DefaultPageCreator.createPage() method > > is where > > >>the decision is made on what type of page to create. > > >>Apparently, this > > >>page is causing all of the if/else logic to fall through to > > >>create an > > >>UnexpectedPage object. > > >> > > >>Dave > > >> > > >> > > >>On Dec 10, 2004, at 9:16 AM, Rousseau, Jean Rene wrote: > > >> > > >> > > >>>Hi, > > >>> > > >>>Here is more info about my problem. I'm really confused, > > >> > > >>because I have > > >> > > >>>similar headers in other pages and they work ok !!. > > >>> > > >>>Any ideas ? > > >>> > > >>> > > >>>code: > > >>> > > >>> URL url = new > > >> > > >>URL(state.getBaseUrl()+"/html/admin/home_en.html"); > > >> > > >>> HtmlPage page = null; > > >>> page = (HtmlPage)state.getWebClient().getPage(url); > > >>> HtmlForm form = page.getFormByName("login"); > > >>> > > >>> > > >> > > >>form.getInputByName("userid").setValueAttribute(cells.more.tex > > >>t().toUpp > > >> > > >>>erCase()); > > >>> > > >>> > > >> > > >>form.getInputByName("password").setValueAttribute(cells.more.m > > > > > > ore.text( > > > > > >>>).toUpperCase()); > > >>> > > >>> Page p = form.submit(); > > >>> System.out.println(p); > > >>> System.out.println(p.getWebResponse().getContentAsString()); > > >>> state.setCurrentPage((HtmlPage)form.submit()); > > >>> > > >>>This gives me a ClassCastException because the response page is an > > >>>UnexcpectedPage. > > >>> > > >>>output: > > >>> > > >>>com.gargoylesoftware.htmlunit.UnexpectedPage@302e67 > > >>> > > >>><html > > >>> > > >> > > >>xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslat > > orUtil" > > >> > > >>>xmlns:java="java"> > > >>><head> > > >>><META http-equiv="Content-Type" content="text/html; > > >>>charset=ISO-8859-1"> > > >>><link href="/pca/stylesheets/pcaadmin.css" type="text/css" > > >>>rel="stylesheet"> > > >>><title>PCA Admin: Users List</title> > > >>></head> > > >>>(...) > > >> > > >> > > >> > > >>------------------------------------------------------- > > >>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://productguide.itmanagersjournal.com/ > > >>_______________________________________________ > > >>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://productguide.itmanagersjournal.com/ > > > _______________________________________________ > > > 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://productguide.itmanagersjournal.com/ > > _______________________________________________ > > 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://productguide.itmanagersjournal.com/ > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Rousseau, J. R. <JRR...@Ba...> - 2004-12-10 19:48:20
|
everything works perfectly fine with a regular browser. Actually this application is in production in several of our customers. It works fine also with JWebUnit(HttpUnit). One of the difference between the working pages and the non-working pages is that the non-working pages go through a ServletFilter before being produced. In Both cases, a Servlet handles the request, produced XML that is then transformed by an XSL stylesheet. I'll re-try with the proposed loggers thanks, Jean-Rene > -----Original Message----- > From: Marc Guillemot [mailto:mgu...@ya...] > Sent: Friday, December 10, 2004 2:42 PM > To: htm...@li... > Subject: Re: [Htmlunit-user] Re: Problems handling with the > Content-Type > is specified using ME TA tags? > > > Jean Rene, > > you can set log level to debug for > > logger.httpclient.wire > httpclient.wire.header > httpclient.wire.content > > and you will really get more information. > > Are some of the pages you have problem with available on the internet? > > Marc. > > Rousseau, Jean Rene wrote: > > I'm so confused with this problem... > > > > Here are my logs when it works > > > > Content type is: text/html > > Content stream is: > > <html > xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslatorUtil" > > xmlns:java="java"> > > <head> > > <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> > > (...) > > > > Here is when it doesn't work: > > > > Content type is: > > Content Stream is: > > <html > xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslatorUtil" > > xmlns:java="java"> > > <head> > > <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> > > (...) > > > > We clearly see that webResponde.getContentType() returns > null !! but why > > !?!?!? response content stream is the same as the correct output. > > > > So how is it possible that my content-type is null in > certain pages ? > > > > > >>-----Original Message----- > >>From: David D.Kilzer [mailto:ddk...@ki...] > >>Sent: Friday, December 10, 2004 11:40 AM > >>To: htm...@li... > >>Subject: Re: [Htmlunit-user] Re: Problems handling with the > >>Content-Type > >>i s specified using ME TA tags? > >> > >> > >>What "Content-Type:" header is your web server sending back > for this > >>page? (If you're using Mozilla or Firefox, you can do a > "Get Info" > >>once the page is loaded to find out, or use a packet sniffer like > >>Ethereal to capture the headers "on the wire".) > >> > >>In htmlunit-1.3, the DefaultPageCreator.createPage() method > is where > >>the decision is made on what type of page to create. > >>Apparently, this > >>page is causing all of the if/else logic to fall through to > >>create an > >>UnexpectedPage object. > >> > >>Dave > >> > >> > >>On Dec 10, 2004, at 9:16 AM, Rousseau, Jean Rene wrote: > >> > >> > >>>Hi, > >>> > >>>Here is more info about my problem. I'm really confused, > >> > >>because I have > >> > >>>similar headers in other pages and they work ok !!. > >>> > >>>Any ideas ? > >>> > >>> > >>>code: > >>> > >>> URL url = new > >> > >>URL(state.getBaseUrl()+"/html/admin/home_en.html"); > >> > >>> HtmlPage page = null; > >>> page = (HtmlPage)state.getWebClient().getPage(url); > >>> HtmlForm form = page.getFormByName("login"); > >>> > >>> > >> > >>form.getInputByName("userid").setValueAttribute(cells.more.tex > >>t().toUpp > >> > >>>erCase()); > >>> > >>> > >> > >>form.getInputByName("password").setValueAttribute(cells.more.m > > > > ore.text( > > > >>>).toUpperCase()); > >>> > >>> Page p = form.submit(); > >>> System.out.println(p); > >>> System.out.println(p.getWebResponse().getContentAsString()); > >>> state.setCurrentPage((HtmlPage)form.submit()); > >>> > >>>This gives me a ClassCastException because the response page is an > >>>UnexcpectedPage. > >>> > >>>output: > >>> > >>>com.gargoylesoftware.htmlunit.UnexpectedPage@302e67 > >>> > >>><html > >>> > >> > >>xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslat > orUtil" > >> > >>>xmlns:java="java"> > >>><head> > >>><META http-equiv="Content-Type" content="text/html; > >>>charset=ISO-8859-1"> > >>><link href="/pca/stylesheets/pcaadmin.css" type="text/css" > >>>rel="stylesheet"> > >>><title>PCA Admin: Users List</title> > >>></head> > >>>(...) > >> > >> > >> > >>------------------------------------------------------- > >>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://productguide.itmanagersjournal.com/ > >>_______________________________________________ > >>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://productguide.itmanagersjournal.com/ > > _______________________________________________ > > 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://productguide.itmanagersjournal.com/ > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: Marc G. <mgu...@ya...> - 2004-12-10 19:42:45
|
Jean Rene, you can set log level to debug for logger.httpclient.wire httpclient.wire.header httpclient.wire.content and you will really get more information. Are some of the pages you have problem with available on the internet? Marc. Rousseau, Jean Rene wrote: > I'm so confused with this problem... > > Here are my logs when it works > > Content type is: text/html > Content stream is: > <html xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslatorUtil" > xmlns:java="java"> > <head> > <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> > (...) > > Here is when it doesn't work: > > Content type is: > Content Stream is: > <html xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslatorUtil" > xmlns:java="java"> > <head> > <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> > (...) > > We clearly see that webResponde.getContentType() returns null !! but why > !?!?!? response content stream is the same as the correct output. > > So how is it possible that my content-type is null in certain pages ? > > >>-----Original Message----- >>From: David D.Kilzer [mailto:ddk...@ki...] >>Sent: Friday, December 10, 2004 11:40 AM >>To: htm...@li... >>Subject: Re: [Htmlunit-user] Re: Problems handling with the >>Content-Type >>i s specified using ME TA tags? >> >> >>What "Content-Type:" header is your web server sending back for this >>page? (If you're using Mozilla or Firefox, you can do a "Get Info" >>once the page is loaded to find out, or use a packet sniffer like >>Ethereal to capture the headers "on the wire".) >> >>In htmlunit-1.3, the DefaultPageCreator.createPage() method is where >>the decision is made on what type of page to create. >>Apparently, this >>page is causing all of the if/else logic to fall through to >>create an >>UnexpectedPage object. >> >>Dave >> >> >>On Dec 10, 2004, at 9:16 AM, Rousseau, Jean Rene wrote: >> >> >>>Hi, >>> >>>Here is more info about my problem. I'm really confused, >> >>because I have >> >>>similar headers in other pages and they work ok !!. >>> >>>Any ideas ? >>> >>> >>>code: >>> >>> URL url = new >> >>URL(state.getBaseUrl()+"/html/admin/home_en.html"); >> >>> HtmlPage page = null; >>> page = (HtmlPage)state.getWebClient().getPage(url); >>> HtmlForm form = page.getFormByName("login"); >>> >>> >> >>form.getInputByName("userid").setValueAttribute(cells.more.tex >>t().toUpp >> >>>erCase()); >>> >>> >> >>form.getInputByName("password").setValueAttribute(cells.more.m > > ore.text( > >>>).toUpperCase()); >>> >>> Page p = form.submit(); >>> System.out.println(p); >>> System.out.println(p.getWebResponse().getContentAsString()); >>> state.setCurrentPage((HtmlPage)form.submit()); >>> >>>This gives me a ClassCastException because the response page is an >>>UnexcpectedPage. >>> >>>output: >>> >>>com.gargoylesoftware.htmlunit.UnexpectedPage@302e67 >>> >>><html >>> >> >>xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslatorUtil" >> >>>xmlns:java="java"> >>><head> >>><META http-equiv="Content-Type" content="text/html; >>>charset=ISO-8859-1"> >>><link href="/pca/stylesheets/pcaadmin.css" type="text/css" >>>rel="stylesheet"> >>><title>PCA Admin: Users List</title> >>></head> >>>(...) >> >> >> >>------------------------------------------------------- >>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://productguide.itmanagersjournal.com/ >>_______________________________________________ >>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://productguide.itmanagersjournal.com/ > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: Rousseau, J. R. <JRR...@Ba...> - 2004-12-10 18:31:21
|
I'm so confused with this problem... Here are my logs when it works Content type is: text/html Content stream is: <html xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslatorUtil" xmlns:java="java"> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> (...) Here is when it doesn't work: Content type is: Content Stream is: <html xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslatorUtil" xmlns:java="java"> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> (...) We clearly see that webResponde.getContentType() returns null !! but why !?!?!? response content stream is the same as the correct output. So how is it possible that my content-type is null in certain pages ? > -----Original Message----- > From: David D.Kilzer [mailto:ddk...@ki...] > Sent: Friday, December 10, 2004 11:40 AM > To: htm...@li... > Subject: Re: [Htmlunit-user] Re: Problems handling with the > Content-Type > i s specified using ME TA tags? > > > What "Content-Type:" header is your web server sending back for this > page? (If you're using Mozilla or Firefox, you can do a "Get Info" > once the page is loaded to find out, or use a packet sniffer like > Ethereal to capture the headers "on the wire".) > > In htmlunit-1.3, the DefaultPageCreator.createPage() method is where > the decision is made on what type of page to create. > Apparently, this > page is causing all of the if/else logic to fall through to > create an > UnexpectedPage object. > > Dave > > > On Dec 10, 2004, at 9:16 AM, Rousseau, Jean Rene wrote: > > > Hi, > > > > Here is more info about my problem. I'm really confused, > because I have > > similar headers in other pages and they work ok !!. > > > > Any ideas ? > > > > > > code: > > > > URL url = new > URL(state.getBaseUrl()+"/html/admin/home_en.html"); > > HtmlPage page = null; > > page = (HtmlPage)state.getWebClient().getPage(url); > > HtmlForm form = page.getFormByName("login"); > > > > > form.getInputByName("userid").setValueAttribute(cells.more.tex > t().toUpp > > erCase()); > > > > > form.getInputByName("password").setValueAttribute(cells.more.m ore.text( > > ).toUpperCase()); > > > > Page p = form.submit(); > > System.out.println(p); > > System.out.println(p.getWebResponse().getContentAsString()); > > state.setCurrentPage((HtmlPage)form.submit()); > > > > This gives me a ClassCastException because the response page is an > > UnexcpectedPage. > > > > output: > > > > com.gargoylesoftware.htmlunit.UnexpectedPage@302e67 > > > > <html > > > xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslatorUtil" > > xmlns:java="java"> > > <head> > > <META http-equiv="Content-Type" content="text/html; > > charset=ISO-8859-1"> > > <link href="/pca/stylesheets/pcaadmin.css" type="text/css" > > rel="stylesheet"> > > <title>PCA Admin: Users List</title> > > </head> > > (...) > > > > ------------------------------------------------------- > 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://productguide.itmanagersjournal.com/ > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: David D.K. <ddk...@ki...> - 2004-12-10 16:40:10
|
What "Content-Type:" header is your web server sending back for this page? (If you're using Mozilla or Firefox, you can do a "Get Info" once the page is loaded to find out, or use a packet sniffer like Ethereal to capture the headers "on the wire".) In htmlunit-1.3, the DefaultPageCreator.createPage() method is where the decision is made on what type of page to create. Apparently, this page is causing all of the if/else logic to fall through to create an UnexpectedPage object. Dave On Dec 10, 2004, at 9:16 AM, Rousseau, Jean Rene wrote: > Hi, > > Here is more info about my problem. I'm really confused, because I have > similar headers in other pages and they work ok !!. > > Any ideas ? > > > code: > > URL url = new URL(state.getBaseUrl()+"/html/admin/home_en.html"); > HtmlPage page = null; > page = (HtmlPage)state.getWebClient().getPage(url); > HtmlForm form = page.getFormByName("login"); > > form.getInputByName("userid").setValueAttribute(cells.more.text().toUpp > erCase()); > > form.getInputByName("password").setValueAttribute(cells.more.more.text( > ).toUpperCase()); > > Page p = form.submit(); > System.out.println(p); > System.out.println(p.getWebResponse().getContentAsString()); > state.setCurrentPage((HtmlPage)form.submit()); > > This gives me a ClassCastException because the response page is an > UnexcpectedPage. > > output: > > com.gargoylesoftware.htmlunit.UnexpectedPage@302e67 > > <html > xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslatorUtil" > xmlns:java="java"> > <head> > <META http-equiv="Content-Type" content="text/html; > charset=ISO-8859-1"> > <link href="/pca/stylesheets/pcaadmin.css" type="text/css" > rel="stylesheet"> > <title>PCA Admin: Users List</title> > </head> > (...) |
From: Rousseau, J. R. <JRR...@Ba...> - 2004-12-10 15:16:41
|
Hi, Here is more info about my problem. I'm really confused, because I have similar headers in other pages and they work ok !!. Any ideas ? code: URL url = new URL(state.getBaseUrl()+"/html/admin/home_en.html"); HtmlPage page = null; page = (HtmlPage)state.getWebClient().getPage(url); HtmlForm form = page.getFormByName("login"); form.getInputByName("userid").setValueAttribute(cells.more.text().toUpperCas e()); form.getInputByName("password").setValueAttribute(cells.more.more.text().toU pperCase()); Page p = form.submit(); System.out.println(p); System.out.println(p.getWebResponse().getContentAsString()); state.setCurrentPage((HtmlPage)form.submit()); This gives me a ClassCastException because the response page is an UnexcpectedPage. output: com.gargoylesoftware.htmlunit.UnexpectedPage@302e67 <html xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslatorUtil" xmlns:java="java"> <head> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <link href="/pca/stylesheets/pcaadmin.css" type="text/css" rel="stylesheet"> <title>PCA Admin: Users List</title> </head> (...) > -----Original Message----- > From: Rousseau, Jean Rene > Sent: Thursday, December 09, 2004 4:46 PM > To: 'htm...@li...' > Subject: [Htmlunit-user] Re: Problems handling with the > Content-Type is > specified using ME TA tags? > > > Hi All, > > I found this old message in the archive concerning a > "UnexcpectedPage" > problem. I still have this problem and it happens only if a specify a > specific charset. > > Any news on this bug ? > > thanks, > > Jean-Rene Rousseau > > -------------------------------------------------------------- > -------------- > ---- > >Raj Wagle wrote: > > If a page is sent without the "Content-Type" response > header, but is > specified as > follows: > > <META http-equiv="Content-Type" content="text/html; > charset=ISO-8859-5"> > > > > seems either htmlunit or httpclient is unable to handle it > correctly. > > > > The page gets returned as "UnexpectedPage". > > Any thoughts? > > I thought that commons-httpclient would take care of this > automatically > - I remember discussions about this on their mailing list a > while ago. > To work around this, you could register a custom PageCreator > with the > WebClient. > > Please open a bug report for this. > > -- > Mike Bowler > Principal, Gargoyle Software Inc. > Voice: (416) 822-0973 | Email : mbowler@Ga... > Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com > > > ------------------------------------------------------- > 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://productguide.itmanagersjournal.com/ > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: Rousseau, J. R. <JRR...@Ba...> - 2004-12-09 21:46:49
|
Hi All, I found this old message in the archive concerning a "UnexcpectedPage" problem. I still have this problem and it happens only if a specify a specific charset. Any news on this bug ? thanks, Jean-Rene Rousseau ---------------------------------------------------------------------------- ---- >Raj Wagle wrote: > If a page is sent without the "Content-Type" response header, but is specified as follows: > <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-5"> > > seems either htmlunit or httpclient is unable to handle it correctly. > > The page gets returned as "UnexpectedPage". > Any thoughts? I thought that commons-httpclient would take care of this automatically - I remember discussions about this on their mailing list a while ago. To work around this, you could register a custom PageCreator with the WebClient. Please open a bug report for this. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mbowler@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: Marc G. <mgu...@ya...> - 2004-12-09 17:08:00
|
Hi, volume 1.05 of the german journal Java Magazin contains an article (in german) about htmlunit: Open-Source-Perlen Mit HtmlUnit Webapplikationen testen http://www.javamagazin.de/itr/ausgaben/psecom,id,237,nodeid,20.html (only table of content, article is not available online) The article is quite bad mostly because it talks about htmlunit version ... 1.2.3 which was release on July 31, 2003! Many (current) features of htmlunit are not presented and the tested page has to be tested with javascript deactivated what would not be necessary with current version. I've already mailed the journal to complain and to propose writing a new, up to date presentation. Marc. PS: perhaps could we add a rubric on the website with links to article about htmlunit? |
From: Chris E. <chr...@co...> - 2004-12-09 12:40:43
|
I recently submitted a patch that begins to address the requested behavior: http://sourceforge.net/tracker/index.php?func=detail&aid=1080365&group_id=47038&atid=448268 It needs more extensions before onkeypress will create an event with the keycode set, but I think it's a good start. Didn't realize a patch was already in the tracker... David D.Kilzer wrote: > Note that this RFE now has a patch that provides a "framework" (in the > loosest sense of the word) for an event object. It even tries to give > you an MSIE event object when using an MSIE user agent. You'll have to > add the keyCode field to it, though. > > [ 948889 ] Support for fourth-generation event model > http://sourceforge.net/tracker/index.php? > func=detail&aid=948889&group_id=47038&atid=448269 > > I highly recommend reading this article when implementing event > handlers that use an 'event' object to make your JavaScript compatible > across MSIE and Mozilla/Firefox (and Safari and Opera). > > Supporting Three Event Models at Once > http://developer.apple.com/internet/webcontent/eventmodels.html > > Dave > > > On Dec 7, 2004, at 12:37 PM, Brad Clarke wrote: > >> It looks like the only key-press support that currently exists is for >> access keys. I >> suppose you could hack together some javascript to simulate this using >> HtmlPage.executeJavaScriptIfPossible(): >> >> <some code to make a window.event object since we don't seem to >> support that yet >> either> >> window.event.keyCode = <yourFKey>; >> HandleFnKeys(); >> >> >> --- "Brehm, Robert P" <rob...@of...> wrote: >> >>> All, >>> >>> I am implementing function key support as follows: >>> >>> <body ... onKeyDown="HandleFnKeys()" ... > >>> >>> and the javascript is as follows: >>> >>> function HandleFnKeys() { >>> var evt=window.event.keyCode; >>> switch (evt) { >>> case 112: //F1 >>> HandleSubmit(); >>> break; >>> case 113: //F2 >>> OpenExistingPO(); >>> break; >>> case 121: //F10 >>> HandleChoose(); >>> break; >>> }//switch >>> }//function >>> >>> I notice that the onKeyDown event by the documentation is not >>> implemented. Is >>> there any way around this to perform the function key support? >>> >>> Best Regards, >>> >>> Bob Brehm >>> Software Engineer >>> Xerox Corp. >>> >>> >>> ------------------------------------------------------- >>> 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://productguide.itmanagersjournal.com/ >>> _______________________________________________ >>> 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://productguide.itmanagersjournal.com/ >> _______________________________________________ >> 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://productguide.itmanagersjournal.com/ |
From: David D.K. <ddk...@ki...> - 2004-12-08 08:10:37
|
Note that this RFE now has a patch that provides a "framework" (in the loosest sense of the word) for an event object. It even tries to give you an MSIE event object when using an MSIE user agent. You'll have to add the keyCode field to it, though. [ 948889 ] Support for fourth-generation event model http://sourceforge.net/tracker/index.php? func=detail&aid=948889&group_id=47038&atid=448269 I highly recommend reading this article when implementing event handlers that use an 'event' object to make your JavaScript compatible across MSIE and Mozilla/Firefox (and Safari and Opera). Supporting Three Event Models at Once http://developer.apple.com/internet/webcontent/eventmodels.html Dave On Dec 7, 2004, at 12:37 PM, Brad Clarke wrote: > It looks like the only key-press support that currently exists is for > access keys. I > suppose you could hack together some javascript to simulate this using > HtmlPage.executeJavaScriptIfPossible(): > > <some code to make a window.event object since we don't seem to > support that yet > either> > window.event.keyCode = <yourFKey>; > HandleFnKeys(); > > > --- "Brehm, Robert P" <rob...@of...> wrote: > >> All, >> >> I am implementing function key support as follows: >> >> <body ... onKeyDown="HandleFnKeys()" ... > >> >> and the javascript is as follows: >> >> function HandleFnKeys() { >> var evt=window.event.keyCode; >> switch (evt) { >> case 112: //F1 >> HandleSubmit(); >> break; >> case 113: //F2 >> OpenExistingPO(); >> break; >> case 121: //F10 >> HandleChoose(); >> break; >> }//switch >> }//function >> >> I notice that the onKeyDown event by the documentation is not >> implemented. Is >> there any way around this to perform the function key support? >> >> Best Regards, >> >> Bob Brehm >> Software Engineer >> Xerox Corp. >> >> >> ------------------------------------------------------- >> 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://productguide.itmanagersjournal.com/ >> _______________________________________________ >> 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://productguide.itmanagersjournal.com/ > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Brad C. <yo...@br...> - 2004-12-07 18:38:05
|
It looks like the only key-press support that currently exists is for access keys. I suppose you could hack together some javascript to simulate this using HtmlPage.executeJavaScriptIfPossible(): <some code to make a window.event object since we don't seem to support that yet either> window.event.keyCode = <yourFKey>; HandleFnKeys(); --- "Brehm, Robert P" <rob...@of...> wrote: > All, > > I am implementing function key support as follows: > > <body ... onKeyDown="HandleFnKeys()" ... > > > and the javascript is as follows: > > function HandleFnKeys() { > var evt=window.event.keyCode; > switch (evt) { > case 112: //F1 > HandleSubmit(); > break; > case 113: //F2 > OpenExistingPO(); > break; > case 121: //F10 > HandleChoose(); > break; > }//switch > }//function > > I notice that the onKeyDown event by the documentation is not implemented. Is > there any way around this to perform the function key support? > > Best Regards, > > Bob Brehm > Software Engineer > Xerox Corp. > > > ------------------------------------------------------- > 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://productguide.itmanagersjournal.com/ > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: Brehm, R. P <rob...@of...> - 2004-12-06 20:53:37
|
All, I am implementing function key support as follows: <body ... onKeyDown="HandleFnKeys()" ... > and the javascript is as follows: function HandleFnKeys() { var evt=window.event.keyCode; switch (evt) { case 112: //F1 HandleSubmit(); break; case 113: //F2 OpenExistingPO(); break; case 121: //F10 HandleChoose(); break; }//switch }//function I notice that the onKeyDown event by the documentation is not implemented. Is there any way around this to perform the function key support? Best Regards, Bob Brehm Software Engineer Xerox Corp. |
From: Marc G. <mgu...@ya...> - 2004-12-01 08:41:18
|
Robert, Your js code was correct, the interpretation by htmlunit is wrong and it's not IE specific, it's standard: getElementsByTagName should return a NodeList and NodeList should have a method item(int): http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core.html#ID-A6C9094 http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-core.html#ID-536297177 Marc. PS: you can write your changed js code in one line ssnTableRows[i].getElementsByTagName("td")[1].style.backgroundColor="white"; Brehm, Robert P wrote: > Marc, > > Thanks for the hint! I did some further research on getElementsByTagName, and I discovered that it returns an array which in strict Javascript requires the [] notation. The following change worked: > > ssnTableRows[i].getElementsByTagName("td").item(1).style.backgroundColor="white"; > to > var tdElements = ssnTableRows[i].getElementsByTagName("td"); > tdElements[1].style.backgroundColor = "white"; > > I guess I was using JScript notation and the Rhino engine correctly did not process. > > Regards, > > Bob Brehm > > -----Original Message----- > From: htm...@li... > [mailto:htm...@li...]On Behalf Of Marc > Guillemot > Sent: Wednesday, November 24, 2004 6:28 AM > To: htm...@li... > Subject: Re: [Htmlunit-user] JavaScript question > > > sorry, I've read this to fast and I was thinking about double access syntas with () and []. > > Marc.. > > Mike Bowler wrote: > >>Marc Guillemot wrote: >> >> >>>this can probably be fixed making the object returned by >>>"getElementsByTagName("td")" both a "normal" object and object >>>implementing interface org.mozilla.javascript.Function as I've done it >>>for document.all. >> >> >> >>I'd read the question as "can I generically tell HtmlUnit to not throw >>exceptions when it hits javascript it can't handle" and I still don't >>know how that would be done. Perhaps if we caught the exceptions in >>executeJavaScriptIfPossible() and then ignored them if the user had >>specified "suppress javascript exceptions" or something similar. >> >> > > > > > ------------------------------------------------------- > 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://productguide.itmanagersjournal.com/ > _______________________________________________ > 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://productguide.itmanagersjournal.com/ |
From: Brehm, R. P <rob...@of...> - 2004-11-30 16:37:52
|
Marc, Thanks for the hint! I did some further research on getElementsByTagName, and I discovered that it returns an array which in strict Javascript requires the [] notation. The following change worked: ssnTableRows[i].getElementsByTagName("td").item(1).style.backgroundColor="white"; to var tdElements = ssnTableRows[i].getElementsByTagName("td"); tdElements[1].style.backgroundColor = "white"; I guess I was using JScript notation and the Rhino engine correctly did not process. Regards, Bob Brehm -----Original Message----- From: htm...@li... [mailto:htm...@li...]On Behalf Of Marc Guillemot Sent: Wednesday, November 24, 2004 6:28 AM To: htm...@li... Subject: Re: [Htmlunit-user] JavaScript question sorry, I've read this to fast and I was thinking about double access syntas with () and []. Marc.. Mike Bowler wrote: > Marc Guillemot wrote: > >> this can probably be fixed making the object returned by >> "getElementsByTagName("td")" both a "normal" object and object >> implementing interface org.mozilla.javascript.Function as I've done it >> for document.all. > > > > I'd read the question as "can I generically tell HtmlUnit to not throw > exceptions when it hits javascript it can't handle" and I still don't > know how that would be done. Perhaps if we caught the exceptions in > executeJavaScriptIfPossible() and then ignored them if the user had > specified "suppress javascript exceptions" or something similar. > > ------------------------------------------------------- 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://productguide.itmanagersjournal.com/ _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Marc G. <mgu...@ya...> - 2004-11-24 14:29:15
|
sorry, I've read this to fast and I was thinking about double access syntas with () and []. Marc.. Mike Bowler wrote: > Marc Guillemot wrote: > >> this can probably be fixed making the object returned by >> "getElementsByTagName("td")" both a "normal" object and object >> implementing interface org.mozilla.javascript.Function as I've done it >> for document.all. > > > > I'd read the question as "can I generically tell HtmlUnit to not throw > exceptions when it hits javascript it can't handle" and I still don't > know how that would be done. Perhaps if we caught the exceptions in > executeJavaScriptIfPossible() and then ignored them if the user had > specified "suppress javascript exceptions" or something similar. > > |
From: Mike B. <mb...@Ga...> - 2004-11-24 11:41:44
|
Marc Guillemot wrote: > this can probably be fixed making the object returned by > "getElementsByTagName("td")" both a "normal" object and object > implementing interface org.mozilla.javascript.Function as I've done it > for document.all. I'd read the question as "can I generically tell HtmlUnit to not throw exceptions when it hits javascript it can't handle" and I still don't know how that would be done. Perhaps if we caught the exceptions in executeJavaScriptIfPossible() and then ignored them if the user had specified "suppress javascript exceptions" or something similar. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: Marc G. <mgu...@ya...> - 2004-11-24 08:47:07
|
Mike, this can probably be fixed making the object returned by "getElementsByTagName("td")" both a "normal" object and object implementing interface org.mozilla.javascript.Function as I've done it for document.all. Marc. Mike Bowler wrote: > Brehm, Robert P wrote: > >> Is there any way currently to tell the javascript interpreter to >> ignore javascript errors? That is try to process commands but if the >> command is malformed or not supported then continue? If not then I >> believe this would be a very useful enhancement. >> >> > > The short answer is no. > > The longer answer is that this kind of thing would have to be supported > by the rhino engine and I haven't been able to find a way to tell rhino > to do this. All the core javascript support is provided by rhino - all > we supply are the browser specific host objects (Document, Location, > Window etc) > |
From: Vinay M. <vin...@gm...> - 2004-11-24 05:19:03
|
Hi, Incase you know before hand, the pages you are going to visit and consequently, the JS errors on that page, you could perhaps use the ScriptPreProcessor to replace the erroneous javascript with either the correct one or with null (remove it all together). But, as I said earlier, this would work only if you have prior knowledge of pages you might want to visit. Regards Vinay |
From: Mike B. <mb...@Ga...> - 2004-11-24 01:28:07
|
Brehm, Robert P wrote: >Is there any way currently to tell the javascript interpreter to ignore javascript errors? That is try to process commands but if the command is malformed or not supported then continue? If not then I believe this would be a very useful enhancement. > > The short answer is no. The longer answer is that this kind of thing would have to be supported by the rhino engine and I haven't been able to find a way to tell rhino to do this. All the core javascript support is provided by rhino - all we supply are the browser specific host objects (Document, Location, Window etc) -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: Brehm, R. P <rob...@of...> - 2004-11-24 00:02:06
|
Hi, I have an application that uses javascript syntax that is not supported by version 1.3 as follows.. ssnTableRows[i].getElementsByTagName("td").item(1).style.backgroundColor="white"; The error thrown is the following: com.gargoylesoftware.htmlunit.ScriptException: item is not a function. The above syntax does work in IE6 to set the cell background color to white. Is there any way currently to tell the javascript interpreter to ignore javascript errors? That is try to process commands but if the command is malformed or not supported then continue? If not then I believe this would be a very useful enhancement. Regards, Bob Brehm Software Engineer Xerox Corp. |
From: Brad C. <yo...@br...> - 2004-11-23 20:06:36
|
Thanks for finding that :) I've moved it to the "required" list in maven. I've considered converting my framework to a fixture but I tend to do so much test refactoring that I'm not sure fit would be appropriate for our testing. I've heard of some homegrown fit test refactoring tools but I've never actually seen one. For now I'm just happy to not be using winrunner anymore. Brad C --- "Rousseau, Jean Rene" <JRR...@Ba...> wrote: > When I added jaxen-1.0-FCS-full.jar it worked ! > > it was working in my JUnit environment because that jar was part of my > project classpath. > > thanks for your time ! > > by the way, any plan to have a Fitnesse plugin similar to what jWebUnit > provides ? > > > -----Original Message----- > > From: Brad Clarke [mailto:yo...@br...] > > Sent: Tuesday, November 23, 2004 1:55 PM > > To: htm...@li... > > Subject: RE: [Htmlunit-user] XMIException when reading response page > > > > > > Are you sure the html page being returned the same in both cases? > > > > You could try testing your fixture instead of letting > > fitnesse run it to help locate > > the problem. You might also try upgrading to 0.9.4 of > > nekohtml to see if that fixes > > it. Might also be that one of the jars we're listing as > > optional isn't so optional > > anymore... > > > > > > > > --- "Rousseau, Jean Rene" <JRR...@Ba...> wrote: > > > > > Fitnesse only use fitnesse.jar in its classpath, and there > > is no embedded > > > xml apis in that jar. Here the jars on the classpath used to run my > > > fixture: > > > > > > htmlunit-1.3.jar; > > > commons-httpclient-2.0.1.jar; > > > commons-logging-1.0.4.jar; > > > xmlParserAPIs-2.2.1.jar; > > > commons-io-1.0.jar; > > > saxpath-1.0-FCS.jar; > > > xercesImpl-2.6.2.jar; > > > nekohtml-0.9.1.jar; > > > js-1.5R4.1.jar; > > > C:\dev\pca\bin --> no xml API here ! > > > > > > thanks, > > > > > > Jean-Rene > > > > > > > -----Original Message----- > > > > From: Brad Clarke [mailto:yo...@br...] > > > > Sent: Tuesday, November 23, 2004 1:16 PM > > > > To: htm...@li... > > > > Subject: Re: [Htmlunit-user] XMIException when reading > > response page > > > > > > > > > > > > Sounds like an xml library on the fitnesse classpath is > > > > conflicting with htmlunit's > > > > classpath. Is there a way to have fitnesse run your fixture > > > > in it's own jvm? > > > > > > > > Brad C > > > > > > > > --- "Rousseau, Jean Rene" <JRR...@Ba...> wrote: > > > > > > > > > Hi All, > > > > > > > > > > I'm currently evaluating HtmlUnit to perform our > > > > inegration testing. When > > > > > used insed JUnit, my simple test worked perfectly. I then > > > > moved the code > > > > > inside a Fitnesse Fixture. Unfortunalely now, my simple > > > > test does not work > > > > > anymore (when called from Fitnesse). > > > > > > > > > > The Fitnesse server calls my login method that then perform > > > > the following > > > > > HtmlUnit code: > > > > > > > > > > WebClient webClient = new WebClient(); > > > > > URL url = new URL("http://banctec-bxx87tc/pca/index.html"); > > > > > HtmlPage page = (HtmlPage)webClient.getPage(url); > > > > > (...) > > > > > > > > > > When reading the index page, it throws the following exception: > > > > > > > > > > org.apache.xerces.xni.XNIException at > > > > > org.cyberneko.html.HTMLScanner$ContentScanner.scan(Unknown > > > > Source) at > > > > > org.cyberneko.html.HTMLScanner.scanDocument(Unknown Source) at > > > > > org.cyberneko.html.HTMLConfiguration.parse(Unknown Source) at > > > > > org.cyberneko.html.HTMLConfiguration.parse(Unknown Source) at > > > > > org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at > > > > > > > > > com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuild > > > > er.parse(HTMLP > > > > > arser.java:302) at > > > > > > > > > com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser > > > > .java:223) at > > > > > > > > > com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPag > > > > e(DefaultPageC > > > > > reator.java:110) at > > > > > > > > > com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(De > > > > faultPageCreat > > > > > or.java:82) at > > > > > > > > > com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(We > > > > bClient.java:5 > > > > > 83) at > > > > > > com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:550) > > > > > at > > > > > > com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:465) at > > > > > > > > > > > com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:337) at > > > > > > > > > > > com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:281) at > > > > > > > > > web.fitnesse.PCAQueryScreenFixture.login(PCAQueryScreenFixture > > > > .java:46) at > > > > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at > > > > > > > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess > > > > orImpl.java:39 > > > > > ) at > > > > > > > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth > > > > odAccessorImpl > > > > > .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at > > > > > fit.ActionFixture.doCells(Unknown Source) at > > > > fit.Fixture.doRow(Unknown > > > > > Source) at fit.Fixture.doRows(Unknown Source) at > > > > fit.Fixture.doTable(Unknown > > > > > Source) at fit.Fixture.doTables(Unknown Source) at > > > > > fit.FitServer.process(Unknown Source) at > > > > fit.FitServer.run(Unknown Source) > > > > > at fit.FitServer.main(Unknown Source) > > > > > > > > > > Any ideas ? > > > > > > > > > > thanks, > > > > > > > > > > Jean-Rene Rousseau > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > 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://productguide.itmanagersjournal.com/ > > > > > _______________________________________________ > > > > > 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://productguide.itmanagersjournal.com/ > > > > _______________________________________________ > > > > 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://productguide.itmanagersjournal.com/ > > > _______________________________________________ > > > 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://productguide.itmanagersjournal.com/ > > _______________________________________________ > > 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://productguide.itmanagersjournal.com/ > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: Rousseau, J. R. <JRR...@Ba...> - 2004-11-23 19:44:10
|
When I added jaxen-1.0-FCS-full.jar it worked ! it was working in my JUnit environment because that jar was part of my project classpath. thanks for your time ! by the way, any plan to have a Fitnesse plugin similar to what jWebUnit provides ? > -----Original Message----- > From: Brad Clarke [mailto:yo...@br...] > Sent: Tuesday, November 23, 2004 1:55 PM > To: htm...@li... > Subject: RE: [Htmlunit-user] XMIException when reading response page > > > Are you sure the html page being returned the same in both cases? > > You could try testing your fixture instead of letting > fitnesse run it to help locate > the problem. You might also try upgrading to 0.9.4 of > nekohtml to see if that fixes > it. Might also be that one of the jars we're listing as > optional isn't so optional > anymore... > > > > --- "Rousseau, Jean Rene" <JRR...@Ba...> wrote: > > > Fitnesse only use fitnesse.jar in its classpath, and there > is no embedded > > xml apis in that jar. Here the jars on the classpath used to run my > > fixture: > > > > htmlunit-1.3.jar; > > commons-httpclient-2.0.1.jar; > > commons-logging-1.0.4.jar; > > xmlParserAPIs-2.2.1.jar; > > commons-io-1.0.jar; > > saxpath-1.0-FCS.jar; > > xercesImpl-2.6.2.jar; > > nekohtml-0.9.1.jar; > > js-1.5R4.1.jar; > > C:\dev\pca\bin --> no xml API here ! > > > > thanks, > > > > Jean-Rene > > > > > -----Original Message----- > > > From: Brad Clarke [mailto:yo...@br...] > > > Sent: Tuesday, November 23, 2004 1:16 PM > > > To: htm...@li... > > > Subject: Re: [Htmlunit-user] XMIException when reading > response page > > > > > > > > > Sounds like an xml library on the fitnesse classpath is > > > conflicting with htmlunit's > > > classpath. Is there a way to have fitnesse run your fixture > > > in it's own jvm? > > > > > > Brad C > > > > > > --- "Rousseau, Jean Rene" <JRR...@Ba...> wrote: > > > > > > > Hi All, > > > > > > > > I'm currently evaluating HtmlUnit to perform our > > > inegration testing. When > > > > used insed JUnit, my simple test worked perfectly. I then > > > moved the code > > > > inside a Fitnesse Fixture. Unfortunalely now, my simple > > > test does not work > > > > anymore (when called from Fitnesse). > > > > > > > > The Fitnesse server calls my login method that then perform > > > the following > > > > HtmlUnit code: > > > > > > > > WebClient webClient = new WebClient(); > > > > URL url = new URL("http://banctec-bxx87tc/pca/index.html"); > > > > HtmlPage page = (HtmlPage)webClient.getPage(url); > > > > (...) > > > > > > > > When reading the index page, it throws the following exception: > > > > > > > > org.apache.xerces.xni.XNIException at > > > > org.cyberneko.html.HTMLScanner$ContentScanner.scan(Unknown > > > Source) at > > > > org.cyberneko.html.HTMLScanner.scanDocument(Unknown Source) at > > > > org.cyberneko.html.HTMLConfiguration.parse(Unknown Source) at > > > > org.cyberneko.html.HTMLConfiguration.parse(Unknown Source) at > > > > org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at > > > > > > > com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuild > > > er.parse(HTMLP > > > > arser.java:302) at > > > > > > > com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser > > > .java:223) at > > > > > > > com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPag > > > e(DefaultPageC > > > > reator.java:110) at > > > > > > > com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(De > > > faultPageCreat > > > > or.java:82) at > > > > > > > com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(We > > > bClient.java:5 > > > > 83) at > > > > com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:550) > > > > at > > > > com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:465) at > > > > > > > > com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:337) at > > > > > > > > com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:281) at > > > > > > > web.fitnesse.PCAQueryScreenFixture.login(PCAQueryScreenFixture > > > .java:46) at > > > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at > > > > > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess > > > orImpl.java:39 > > > > ) at > > > > > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth > > > odAccessorImpl > > > > .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at > > > > fit.ActionFixture.doCells(Unknown Source) at > > > fit.Fixture.doRow(Unknown > > > > Source) at fit.Fixture.doRows(Unknown Source) at > > > fit.Fixture.doTable(Unknown > > > > Source) at fit.Fixture.doTables(Unknown Source) at > > > > fit.FitServer.process(Unknown Source) at > > > fit.FitServer.run(Unknown Source) > > > > at fit.FitServer.main(Unknown Source) > > > > > > > > Any ideas ? > > > > > > > > thanks, > > > > > > > > Jean-Rene Rousseau > > > > > > > > > > > > ------------------------------------------------------- > > > > 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://productguide.itmanagersjournal.com/ > > > > _______________________________________________ > > > > 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://productguide.itmanagersjournal.com/ > > > _______________________________________________ > > > 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://productguide.itmanagersjournal.com/ > > _______________________________________________ > > 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://productguide.itmanagersjournal.com/ > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |