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: David M. G. <mic...@gm...> - 2013-12-17 07:29:01
|
Hi all, For the following link: http://www.scielo.org.co/scielo.php?script=sci_arttext&pid=S0120-99572012000600002 I want to get the address of the pdf. When pressing on the pdf link with the text "Article in pdf format" i get to a refresh page. How do i know that i am now in a refresh page and how many seconds i will wait? Alternatively, how can i get the pdf link without waiting. I tried to find a solution on my own I wanted somehow to parse the redirect page source and get the following tag (which you get with view source): <meta name="added" content="7;URL= http://www.scielo.org.co/pdf/rcg/v27s2/v27s2a02.pdf" http-equiv="refresh"> When trying to make the same with htmlunit: public static void main(String[] args) throws FailingHttpStatusCodeException, MalformedURLException, IOException { WebClient webClient = new WebClient(); List<String> urls = ImmutableList.of(" http://www.scielo.org.co/scielo.php?script=sci_arttext&pid=S0120-99572012000600002 "); for(String url:urls) { HtmlPage page = webClient.getPage(url); List<HtmlAnchor> anchors = page.getAnchors(); for (HtmlAnchor anchor:anchors) { String linkText = anchor.getTextContent(); if(linkText.contains("pdf")) { Page pdfPage = anchor.click(); if(pdfPage.isHtmlPage()) { HtmlPage p = (HtmlPage) pdfPage; System.out.println(p.asXml()); } } } } } I don't get this tag in the resulting xml. In summary i have the following questions: How do i know that i am now in a refresh page and how many seconds i will wait? After identifying that i am in a refresh page, how do i wait and refresh after this number of seconds? how can i get the pdf link without waiting. Where did the <meta name="added" content="7;URL= http://www.scielo.org.co/pdf/rcg/v27s2/v27s2a02.pdf" http-equiv="refresh"> tag disappear? Thanks, David |
From: Ahmed A. <asa...@ya...> - 2013-12-16 22:47:02
|
Hi David, Each release is after at least 3 month, so expect something around end of January. Ahmed > On Dec 17, 2013, at 12:45 AM, David Taylor <da...@de...> wrote: > > Hi! > > When will the official release version of 2.14 be available? > > Thanks. > > David > -- > David Taylor, Detayls > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: David T. <da...@de...> - 2013-12-16 21:45:21
|
Hi! When will the official release version of 2.14 be available? Thanks. David -- David Taylor, Detayls |
From: Arun G. <aru...@gm...> - 2013-12-14 07:38:51
|
I included the following log4j.properties: log4j.rootLogger=DEBUG, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%c] %m%n log4j.logger.httpclient.wire.header=DEBUG log4j.logger.org.apache.commons.httpclient=DEBUG in WEB-INF/classes. Also tried setting the properties: System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog"); System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true"); System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire", "debug"); System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient", "debug"); But still don't see any HTTP headers on the console. Seems like I'm missing something trivial ? Arun On Fri, Dec 13, 2013 at 5:30 PM, Ahmed Ashour <asa...@ya...> wrote: > Hi Arun, > > - http://htmlunit.sourceforge.net/logging.html > - > https://sourceforge.net/p/htmlunit/code/HEAD/tree/trunk/htmlunit/src/test/resources/log4j.properties > > Ahmed > ________________________________ > From: Arun Gupta <aru...@gm...> > To: htm...@li... > Sent: Saturday, December 14, 2013 4:09 AM > Subject: [Htmlunit-user] Logging http messages > > Other than using wireshark, is there a programmatic way (such as an > API on WebClient or some other means) to generate HTTP dump of > messages being exchanged ? > > Arun > > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics > Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > -- http://blog.arungupta.me http://twitter.com/arungupta |
From: Ahmed A. <asa...@ya...> - 2013-12-14 01:30:38
|
Hi Arun, - http://htmlunit.sourceforge.net/logging.html - https://sourceforge.net/p/htmlunit/code/HEAD/tree/trunk/htmlunit/src/test/resources/log4j.properties Ahmed ________________________________ From: Arun Gupta <aru...@gm...> To: htm...@li... Sent: Saturday, December 14, 2013 4:09 AM Subject: [Htmlunit-user] Logging http messages Other than using wireshark, is there a programmatic way (such as an API on WebClient or some other means) to generate HTTP dump of messages being exchanged ? Arun |
From: Arun G. <aru...@gm...> - 2013-12-14 01:09:43
|
Other than using wireshark, is there a programmatic way (such as an API on WebClient or some other means) to generate HTTP dump of messages being exchanged ? Arun -- http://blog.arungupta.me http://twitter.com/arungupta |
From: Arun G. <aru...@gm...> - 2013-12-14 01:05:32
|
OK, that fixed it, thanks! On Fri, Dec 13, 2013 at 4:16 PM, Ahmed Ashour <asa...@ya...> wrote: > Arun, > > Your case is invalid. > > - run "mvn package" and deploy the generated war. > - Your java code is not related to the form generated. > - I used: > > WebClient webClient = new WebClient(); > HtmlPage page = > webClient.getPage("http://localhost:8080/security-form-based/"); > final HtmlForm form = page.getForms().get(0); > form.getInputByName("j_username").setValueAttribute("u1"); > form.getInputByName("j_password").setValueAttribute("p1"); > HtmlSubmitInput submitButton = > form.getFirstByXPath("//input[@type='submit']"); > HtmlPage page2 = submitButton.click(); > System.out.println(page2.asText()); > > - The output is "Form-Based Login Error Page...Invalid user name or > password." > > Ahmed > ________________________________ > From: Arun Gupta <aru...@gm...> > To: Ahmed Ashour <asa...@ya...>; htm...@li... > Sent: Saturday, December 14, 2013 2:40 AM > Subject: Re: [Htmlunit-user] Form-based authentication using JSP/Servlet > failing with incorrect credentials > > Putting down random values for username and password in browser shows > the error page, as expected. > > I'm not seeing that behavior with HtmlUnit though. > > Arun > > On Fri, Dec 13, 2013 at 3:34 PM, Ahmed Ashour <asa...@ya...> wrote: >> Hi Arun, >> >> Yes, it is correct. >> >> Does putting random values in real browsers succeed too? If yes, then >> HtmlUnit behaves correctly. >> >> Ahmed >> ________________________________ >> From: Arun Gupta <aru...@gm...> >> To: htm...@li... >> Sent: Saturday, December 14, 2013 2:28 AM >> Subject: [Htmlunit-user] Form-based authentication using JSP/Servlet >> failing >> with incorrect credentials >> >> Trying to write a test for form-based authentication using >> JSP/Servlet. The form looks like: >> >> <form method="POST" action="j_security_check" name="myform"> >> Username: <input type="text" name="j_username"> >> Password: <input type="password" name="j_password" >> autocomplete="off"> >> <input type="submit" value="Submit" name="submitButton"> >> <input type="reset" value="Reset"> >> </form> >> >> POSTing to a form as: >> >> HtmlPage page = webClient.getPage(base + "/index.jsp"); >> final HtmlForm form = page.getFormByName("myform"); >> form.getInputByName("j_username").setValueAttribute("u1"); >> form.getInputByName("j_password").setValueAttribute("p1"); >> HtmlSubmitInput submitButton = form.getInputByName("submitButton"); >> HtmlPage page2 = submitButton.click(); >> assertEquals("Form-based Security - Success", >> page2.getTitleText()); >> >> succeeds. Changing the username and password to some random value >> succeeds as well. >> >> Complete sample, including deployment descriptor, is available at: >> >> >> https://github.com/javaee-samples/javaee7-samples/tree/master/servlet/security-form-based >> >> Is this the correct way of doing form-based authentication ? >> >> Arun >> >> >> -- >> http://blog.arungupta.me >> http://twitter.com/arungupta >> >> >> ------------------------------------------------------------------------------ >> Rapidly troubleshoot problems before they affect your business. Most IT >> organizations don't have a clear picture of how application performance >> affects their revenue. With AppDynamics, you get 100% visibility into your >> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics >> Pro! >> >> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk >> _______________________________________________ >> Htmlunit-user mailing list >> Htm...@li... >> https://lists.sourceforge.net/lists/listinfo/htmlunit-user >> >> >> >> >> ------------------------------------------------------------------------------ >> Rapidly troubleshoot problems before they affect your business. Most IT >> organizations don't have a clear picture of how application performance >> affects their revenue. With AppDynamics, you get 100% visibility into your >> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics >> Pro! >> >> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk >> _______________________________________________ >> Htmlunit-user mailing list >> Htm...@li... >> https://lists.sourceforge.net/lists/listinfo/htmlunit-user > >> > > > > -- > http://blog.arungupta.me > http://twitter.com/arungupta > > -- http://blog.arungupta.me http://twitter.com/arungupta |
From: Ahmed A. <asa...@ya...> - 2013-12-14 00:19:07
|
Please provide minimal test case, so others can see your issue. Ahmed ________________________________ From: ness1 <tz...@re...> To: htm...@li... Sent: Saturday, December 14, 2013 2:46 AM Subject: Re: [Htmlunit-user] sending ajax request to update current page i used the Thread.sleep() and it didnt work, it looks like when i click the link it runs a java script that returns json response. |
From: Ahmed A. <asa...@ya...> - 2013-12-14 00:17:05
|
Arun, Your case is invalid. - run "mvn package" and deploy the generated war. - Your java code is not related to the form generated. - I used: WebClient webClient = new WebClient(); HtmlPage page = webClient.getPage("http://localhost:8080/security-form-based/"); final HtmlForm form = page.getForms().get(0); form.getInputByName("j_username").setValueAttribute("u1"); form.getInputByName("j_password").setValueAttribute("p1"); HtmlSubmitInput submitButton = form.getFirstByXPath("//input[@type='submit']"); HtmlPage page2 = submitButton.click(); System.out.println(page2.asText()); - The output is "Form-Based Login Error Page...Invalid user name or password." Ahmed ________________________________ From: Arun Gupta <aru...@gm...> To: Ahmed Ashour <asa...@ya...>; htm...@li... Sent: Saturday, December 14, 2013 2:40 AM Subject: Re: [Htmlunit-user] Form-based authentication using JSP/Servlet failing with incorrect credentials Putting down random values for username and password in browser shows the error page, as expected. I'm not seeing that behavior with HtmlUnit though. Arun On Fri, Dec 13, 2013 at 3:34 PM, Ahmed Ashour <asa...@ya...> wrote: > Hi Arun, > > Yes, it is correct. > > Does putting random values in real browsers succeed too? If yes, then > HtmlUnit behaves correctly. > > Ahmed > ________________________________ > From: Arun Gupta <aru...@gm...> > To: htm...@li... > Sent: Saturday, December 14, 2013 2:28 AM > Subject: [Htmlunit-user] Form-based authentication using JSP/Servlet failing > with incorrect credentials > > Trying to write a test for form-based authentication using > JSP/Servlet. The form looks like: > > <form method="POST" action="j_security_check" name="myform"> > Username: <input type="text" name="j_username"> > Password: <input type="password" name="j_password" > autocomplete="off"> > <input type="submit" value="Submit" name="submitButton"> > <input type="reset" value="Reset"> > </form> > > POSTing to a form as: > > HtmlPage page = webClient.getPage(base + "/index.jsp"); > final HtmlForm form = page.getFormByName("myform"); > form.getInputByName("j_username").setValueAttribute("u1"); > form.getInputByName("j_password").setValueAttribute("p1"); > HtmlSubmitInput submitButton = form.getInputByName("submitButton"); > HtmlPage page2 = submitButton.click(); > assertEquals("Form-based Security - Success", page2.getTitleText()); > > succeeds. Changing the username and password to some random value > succeeds as well. > > Complete sample, including deployment descriptor, is available at: > > https://github.com/javaee-samples/javaee7-samples/tree/master/servlet/security-form-based > > Is this the correct way of doing form-based authentication ? > > Arun > > > -- > http://blog.arungupta.me > http://twitter.com/arungupta > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics > Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics > Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > -- http://blog.arungupta.me http://twitter.com/arungupta |
From: ness1 <tz...@re...> - 2013-12-13 23:46:48
|
i used the Thread.sleep() and it didnt work, it looks like when i click the link it runs a java script that returns json response. -- View this message in context: http://htmlunit.10904.n7.nabble.com/sending-ajax-request-to-update-current-page-tp32432p32436.html Sent from the HtmlUnit - General mailing list archive at Nabble.com. |
From: Arun G. <aru...@gm...> - 2013-12-13 23:41:00
|
Putting down random values for username and password in browser shows the error page, as expected. I'm not seeing that behavior with HtmlUnit though. Arun On Fri, Dec 13, 2013 at 3:34 PM, Ahmed Ashour <asa...@ya...> wrote: > Hi Arun, > > Yes, it is correct. > > Does putting random values in real browsers succeed too? If yes, then > HtmlUnit behaves correctly. > > Ahmed > ________________________________ > From: Arun Gupta <aru...@gm...> > To: htm...@li... > Sent: Saturday, December 14, 2013 2:28 AM > Subject: [Htmlunit-user] Form-based authentication using JSP/Servlet failing > with incorrect credentials > > Trying to write a test for form-based authentication using > JSP/Servlet. The form looks like: > > <form method="POST" action="j_security_check" name="myform"> > Username: <input type="text" name="j_username"> > Password: <input type="password" name="j_password" > autocomplete="off"> > <input type="submit" value="Submit" name="submitButton"> > <input type="reset" value="Reset"> > </form> > > POSTing to a form as: > > HtmlPage page = webClient.getPage(base + "/index.jsp"); > final HtmlForm form = page.getFormByName("myform"); > form.getInputByName("j_username").setValueAttribute("u1"); > form.getInputByName("j_password").setValueAttribute("p1"); > HtmlSubmitInput submitButton = form.getInputByName("submitButton"); > HtmlPage page2 = submitButton.click(); > assertEquals("Form-based Security - Success", page2.getTitleText()); > > succeeds. Changing the username and password to some random value > succeeds as well. > > Complete sample, including deployment descriptor, is available at: > > https://github.com/javaee-samples/javaee7-samples/tree/master/servlet/security-form-based > > Is this the correct way of doing form-based authentication ? > > Arun > > > -- > http://blog.arungupta.me > http://twitter.com/arungupta > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics > Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics > Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > -- http://blog.arungupta.me http://twitter.com/arungupta |
From: Ahmed A. <asa...@ya...> - 2013-12-13 23:40:51
|
Hi Arun, Your case works correctly with me ("POST" is written) : WebRequest request = new WebRequest(new URL("http://localhost:8080/test.jsp"), HttpMethod.POST); WebClient webClient = new WebClient(); HtmlPage page = webClient.getPage(request); System.out.println(page.asText()); --------------- test.jsp <%=request.getMethod()%> Ahmed ________________________________ From: Arun Gupta <aru...@gm...> To: Ahmed Ashour <asa...@ya...>; htm...@li... Sent: Friday, December 13, 2013 9:31 PM Subject: Re: [Htmlunit-user] NoSuchMethodError AbstractHttpClient.execute That worked. Now I'm trying to POST a request as: WebClient webClient = new WebClient(); WebRequest request = new WebRequest(new URL(base + "SecureServlet"), HttpMethod.POST); HtmlPage page = webClient.getPage(request); Wireshark shows this as GET request though. However it also shows: Accept: POST header. Any suggestions ? Arun On Thu, Dec 12, 2013 at 10:27 PM, Ahmed Ashour <asa...@ya...> wrote: > Hi Arun, > > You have an issue in your classpath. > > Please remove all HttpClient dependencies and leave only HtmlUnit, maven > automatically gets all needed dependencies. > > Yours, > Ahmed > ________________________________ > From: Arun Gupta <aru...@gm...> > To: htm...@li... > Sent: Friday, December 13, 2013 4:23 AM > Subject: [Htmlunit-user] NoSuchMethodError AbstractHttpClient.execute > > Just starting to replace HttpUnit with HtmlUnit and liking the clean > API so far. The original test source is: > > WebConversation conv = new WebConversation(); > GetMethodWebRequest getRequest = new GetMethodWebRequest(base > + "/TestServlet"); > WebResponse getResponse = conv.getResponse(getRequest); > assertTrue(getResponse.getText().contains("<title>Servlet > url-pattern in web.xml</title>")); > > > and replacing it with: > > WebClient webClient = new WebClient(); > HtmlPage page = webClient.getPage(base + "/TestServlet"); > assertEquals("Servlet url-pattern in web.xml", page.getTitleText()); > > I've added the following dependency: > > <dependency> > <groupId>net.sourceforge.htmlunit</groupId> > <artifactId>htmlunit</artifactId> > <version>2.13</version> > <scope>test</scope> > </dependency> > > But running this test gives the following error: > > java.lang.NoSuchMethodError: > org.apache.http.impl.client.AbstractHttpClient.execute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/client/methods/CloseableHttpResponse; > at > com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:167) > at > com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1281) > at > com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1198) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:307) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:376) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:361) > > Googling asked me to add commons-codec dependency so I also added: > > <dependency> > <groupId>commons-codec</groupId> > <artifactId>commons-codec</artifactId> > <version>1.8</version> > <scope>test</scope> > </dependency> > > No cigar though. > > The original test is at: > > https://github.com/javaee-samples/javaee7-samples/blob/master/servlet/metadata-complete/src/test/java/org/javaee7/servlet/metadata/complete/TestServletTest.java > > What am I missing ? > > Arun > > -- > http://blog.arungupta.me > http://twitter.com/arungupta > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics > Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics > Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > -- http://blog.arungupta.me http://twitter.com/arungupta |
From: Ahmed A. <asa...@ya...> - 2013-12-13 23:37:27
|
Hi Arun, Yes, it is correct. Does putting random values in real browsers succeed too? If yes, then HtmlUnit behaves correctly. Ahmed ________________________________ From: Arun Gupta <aru...@gm...> To: htm...@li... Sent: Saturday, December 14, 2013 2:28 AM Subject: [Htmlunit-user] Form-based authentication using JSP/Servlet failing with incorrect credentials Trying to write a test for form-based authentication using JSP/Servlet. The form looks like: <form method="POST" action="j_security_check" name="myform"> Username: <input type="text" name="j_username"> Password: <input type="password" name="j_password" autocomplete="off"> <input type="submit" value="Submit" name="submitButton"> <input type="reset" value="Reset"> </form> POSTing to a form as: HtmlPage page = webClient.getPage(base + "/index.jsp"); final HtmlForm form = page.getFormByName("myform"); form.getInputByName("j_username").setValueAttribute("u1"); form.getInputByName("j_password").setValueAttribute("p1"); HtmlSubmitInput submitButton = form.getInputByName("submitButton"); HtmlPage page2 = submitButton.click(); assertEquals("Form-based Security - Success", page2.getTitleText()); succeeds. Changing the username and password to some random value succeeds as well. Complete sample, including deployment descriptor, is available at: https://github.com/javaee-samples/javaee7-samples/tree/master/servlet/security-form-based Is this the correct way of doing form-based authentication ? Arun -- http://blog.arungupta.me http://twitter.com/arungupta ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Arun G. <aru...@gm...> - 2013-12-13 23:28:39
|
Trying to write a test for form-based authentication using JSP/Servlet. The form looks like: <form method="POST" action="j_security_check" name="myform"> Username: <input type="text" name="j_username"> Password: <input type="password" name="j_password" autocomplete="off"> <input type="submit" value="Submit" name="submitButton"> <input type="reset" value="Reset"> </form> POSTing to a form as: HtmlPage page = webClient.getPage(base + "/index.jsp"); final HtmlForm form = page.getFormByName("myform"); form.getInputByName("j_username").setValueAttribute("u1"); form.getInputByName("j_password").setValueAttribute("p1"); HtmlSubmitInput submitButton = form.getInputByName("submitButton"); HtmlPage page2 = submitButton.click(); assertEquals("Form-based Security - Success", page2.getTitleText()); succeeds. Changing the username and password to some random value succeeds as well. Complete sample, including deployment descriptor, is available at: https://github.com/javaee-samples/javaee7-samples/tree/master/servlet/security-form-based Is this the correct way of doing form-based authentication ? Arun -- http://blog.arungupta.me http://twitter.com/arungupta |
From: Arun G. <aru...@gm...> - 2013-12-13 18:31:45
|
That worked. Now I'm trying to POST a request as: WebClient webClient = new WebClient(); WebRequest request = new WebRequest(new URL(base + "SecureServlet"), HttpMethod.POST); HtmlPage page = webClient.getPage(request); Wireshark shows this as GET request though. However it also shows: Accept: POST header. Any suggestions ? Arun On Thu, Dec 12, 2013 at 10:27 PM, Ahmed Ashour <asa...@ya...> wrote: > Hi Arun, > > You have an issue in your classpath. > > Please remove all HttpClient dependencies and leave only HtmlUnit, maven > automatically gets all needed dependencies. > > Yours, > Ahmed > ________________________________ > From: Arun Gupta <aru...@gm...> > To: htm...@li... > Sent: Friday, December 13, 2013 4:23 AM > Subject: [Htmlunit-user] NoSuchMethodError AbstractHttpClient.execute > > Just starting to replace HttpUnit with HtmlUnit and liking the clean > API so far. The original test source is: > > WebConversation conv = new WebConversation(); > GetMethodWebRequest getRequest = new GetMethodWebRequest(base > + "/TestServlet"); > WebResponse getResponse = conv.getResponse(getRequest); > assertTrue(getResponse.getText().contains("<title>Servlet > url-pattern in web.xml</title>")); > > > and replacing it with: > > WebClient webClient = new WebClient(); > HtmlPage page = webClient.getPage(base + "/TestServlet"); > assertEquals("Servlet url-pattern in web.xml", page.getTitleText()); > > I've added the following dependency: > > <dependency> > <groupId>net.sourceforge.htmlunit</groupId> > <artifactId>htmlunit</artifactId> > <version>2.13</version> > <scope>test</scope> > </dependency> > > But running this test gives the following error: > > java.lang.NoSuchMethodError: > org.apache.http.impl.client.AbstractHttpClient.execute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/client/methods/CloseableHttpResponse; > at > com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:167) > at > com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1281) > at > com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1198) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:307) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:376) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:361) > > Googling asked me to add commons-codec dependency so I also added: > > <dependency> > <groupId>commons-codec</groupId> > <artifactId>commons-codec</artifactId> > <version>1.8</version> > <scope>test</scope> > </dependency> > > No cigar though. > > The original test is at: > > https://github.com/javaee-samples/javaee7-samples/blob/master/servlet/metadata-complete/src/test/java/org/javaee7/servlet/metadata/complete/TestServletTest.java > > What am I missing ? > > Arun > > -- > http://blog.arungupta.me > http://twitter.com/arungupta > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics > Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics > Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > -- http://blog.arungupta.me http://twitter.com/arungupta |
From: asashour <asa...@ya...> - 2013-12-13 06:33:26
|
Hi, - You must subscribe before posting - Please read http://htmlunit.sourceforge.net/submittingJSBugs.html Yours, Ahmed tariq wrote <http://htmlunit.10904.n7.nabble.com/file/n32381/12-11-2013_5-00-20_PM.png> * > Hi all > > i am trying to scrap this page > https://plus.google.com/115016587855962294424/about > <https://plus.google.com/115016587855962294424/about> > . > Everything works fine but when i try to click show more to load more > reviews nothing happens here is my code * > > final WebClient webClient = new WebClient(BrowserVersion.FIREFOX_24); > page = > webClient.getPage("https://plus.google.com/115016587855962294424/about"); > assertEquals(200,page.getWebResponse().getStatusCode()); > assertEquals("OK",page.getWebResponse().getStatusMessage()); > System.out.println(page.getWebResponse().getStatusCode()); * > Clicking show more here * > > HtmlSpan advancedSearchAn = (HtmlSpan) > page.getFirstByXPath("//*[@id=\"115016587855962294424-about-page\"]/div/div[1]/div/div/div[2]/div[3]/span[1]"); > page = advancedSearchAn.click(); * > but nothing happens i even tried * > // webClient.waitForBackgroundJavaScript(10 * 1000); > // webClient.setAjaxController(new > NicelyResynchronizingAjaxController()); > // webClient.setAjaxController(new AjaxController(){ > // @Override > // public boolean processSynchron(HtmlPage page, WebRequest > request, boolean async) > // { > // return true; > // } > // }); > * > Any suggestions ? * -- View this message in context: http://htmlunit.10904.n7.nabble.com/google-page-javascript-Click-show-more-button-not-working-tp32381p32412.html Sent from the HtmlUnit - General mailing list archive at Nabble.com. |
From: Ahmed A. <asa...@ya...> - 2013-12-13 06:27:44
|
Hi Arun, You have an issue in your classpath. Please remove all HttpClient dependencies and leave only HtmlUnit, maven automatically gets all needed dependencies. Yours, Ahmed ________________________________ From: Arun Gupta <aru...@gm...> To: htm...@li... Sent: Friday, December 13, 2013 4:23 AM Subject: [Htmlunit-user] NoSuchMethodError AbstractHttpClient.execute Just starting to replace HttpUnit with HtmlUnit and liking the clean API so far. The original test source is: WebConversation conv = new WebConversation(); GetMethodWebRequest getRequest = new GetMethodWebRequest(base + "/TestServlet"); WebResponse getResponse = conv.getResponse(getRequest); assertTrue(getResponse.getText().contains("<title>Servlet url-pattern in web.xml</title>")); and replacing it with: WebClient webClient = new WebClient(); HtmlPage page = webClient.getPage(base + "/TestServlet"); assertEquals("Servlet url-pattern in web.xml", page.getTitleText()); I've added the following dependency: <dependency> <groupId>net.sourceforge.htmlunit</groupId> <artifactId>htmlunit</artifactId> <version>2.13</version> <scope>test</scope> </dependency> But running this test gives the following error: java.lang.NoSuchMethodError: org.apache.http.impl.client.AbstractHttpClient.execute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/client/methods/CloseableHttpResponse; at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:167) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1281) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1198) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:307) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:376) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:361) Googling asked me to add commons-codec dependency so I also added: <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> <version>1.8</version> <scope>test</scope> </dependency> No cigar though. The original test is at: https://github.com/javaee-samples/javaee7-samples/blob/master/servlet/metadata-complete/src/test/java/org/javaee7/servlet/metadata/complete/TestServletTest.java What am I missing ? Arun -- http://blog.arungupta.me http://twitter.com/arungupta ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Arun G. <aru...@gm...> - 2013-12-13 01:23:36
|
Just starting to replace HttpUnit with HtmlUnit and liking the clean API so far. The original test source is: WebConversation conv = new WebConversation(); GetMethodWebRequest getRequest = new GetMethodWebRequest(base + "/TestServlet"); WebResponse getResponse = conv.getResponse(getRequest); assertTrue(getResponse.getText().contains("<title>Servlet url-pattern in web.xml</title>")); and replacing it with: WebClient webClient = new WebClient(); HtmlPage page = webClient.getPage(base + "/TestServlet"); assertEquals("Servlet url-pattern in web.xml", page.getTitleText()); I've added the following dependency: <dependency> <groupId>net.sourceforge.htmlunit</groupId> <artifactId>htmlunit</artifactId> <version>2.13</version> <scope>test</scope> </dependency> But running this test gives the following error: java.lang.NoSuchMethodError: org.apache.http.impl.client.AbstractHttpClient.execute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/client/methods/CloseableHttpResponse; at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:167) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1281) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1198) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:307) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:376) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:361) Googling asked me to add commons-codec dependency so I also added: <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> <version>1.8</version> <scope>test</scope> </dependency> No cigar though. The original test is at: https://github.com/javaee-samples/javaee7-samples/blob/master/servlet/metadata-complete/src/test/java/org/javaee7/servlet/metadata/complete/TestServletTest.java What am I missing ? Arun -- http://blog.arungupta.me http://twitter.com/arungupta |
From: Ahmed A. <asa...@ya...> - 2013-12-10 16:44:36
|
Hi, Yes, something like: public WebResponse getResponse(WebRequest request) throws IOException { if (request.getUrl().toExternalForm().contains(".js")) { String content = response.getContentAsString("UTF-8"); //save content } return super.getResponse(request); } Ahmed ________________________________ From: 赵芮元 <zry...@16...> To: Ahmed Ashour <asa...@ya...>; htm...@li... Sent: Tuesday, December 10, 2013 6:25 PM Subject: Re:Re: [Htmlunit-user] Extracting Javascript Hi Ahmed, Thank you for your reply, but I still not clear. Did you mean I can intercept all the content through "String content = response.getContentAsString("UTF-8");" or what else in the example? Thank you for your help! yours, Zhao Ruiyuan At 2013-12-10 22:07:38,"Ahmed Ashour" <asa...@ya...> wrote: Hi, > > >You can intercept all the content and save .js files only. > > >Have a look at http://htmlunit.sourceforge.net/faq.html#HowToModifyRequestOrResponse > > >Yours, >Ahmed > >________________________________ > From: 赵芮元 <zry...@16...> >To: htmlunit群邮件 <htm...@li...> >Sent: Tuesday, December 10, 2013 2:03 PM >Subject: [Htmlunit-user] Extracting Javascript > > > >Dear all, >I want to extract all javascript files(.js) from a given URL, Is there a API to achieve this task, or should I modify the source code?Thanks a lot! >Yours, Zhao Ruiyuan > > >------------------------------------------------------------------------------ >Sponsored by Intel(R) XDK >Develop, test and display web and hybrid apps with a single code base. >Download it for free now! >http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk >_______________________________________________ >Htmlunit-user mailing list >Htm...@li... >https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > |
From: Ahmed A. <asa...@ya...> - 2013-12-10 16:43:02
|
Hi, Yes, something like: In your case, you don't need to change the content, or to create t Ahmed ________________________________ From: 赵芮元 <zry...@16...> To: Ahmed Ashour <asa...@ya...>; htm...@li... Sent: Tuesday, December 10, 2013 6:25 PM Subject: Re:Re: [Htmlunit-user] Extracting Javascript Hi Ahmed, Thank you for your reply, but I still not clear. Did you mean I can intercept all the content through "String content = response.getContentAsString("UTF-8");" or what else in the example? Thank you for your help! yours, Zhao Ruiyuan At 2013-12-10 22:07:38,"Ahmed Ashour" <asa...@ya...> wrote: Hi, > > >You can intercept all the content and save .js files only. > > >Have a look at http://htmlunit.sourceforge.net/faq.html#HowToModifyRequestOrResponse > > >Yours, >Ahmed > >________________________________ > From: 赵芮元 <zry...@16...> >To: htmlunit群邮件 <htm...@li...> >Sent: Tuesday, December 10, 2013 2:03 PM >Subject: [Htmlunit-user] Extracting Javascript > > > >Dear all, >I want to extract all javascript files(.js) from a given URL, Is there a API to achieve this task, or should I modify the source code?Thanks a lot! >Yours, Zhao Ruiyuan > > >------------------------------------------------------------------------------ >Sponsored by Intel(R) XDK >Develop, test and display web and hybrid apps with a single code base. >Download it for free now! >http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk >_______________________________________________ >Htmlunit-user mailing list >Htm...@li... >https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > |
From: 赵芮元 <zry...@16...> - 2013-12-10 15:25:21
|
Hi Ahmed, Thank you for your reply, but I still not clear. Did you mean I can intercept all the content through "String content = response.getContentAsString("UTF-8");" or what else in the example? Thank you for your help! yours, Zhao Ruiyuan At 2013-12-10 22:07:38,"Ahmed Ashour" <asa...@ya...> wrote: Hi, You can intercept all the content and save .js files only. Have a look at http://htmlunit.sourceforge.net/faq.html#HowToModifyRequestOrResponse Yours, Ahmed From: 赵芮元 <zry...@16...> To: htmlunit群邮件 <htm...@li...> Sent: Tuesday, December 10, 2013 2:03 PM Subject: [Htmlunit-user] Extracting Javascript Dear all, I want to extract all javascript files(.js) from a given URL, Is there a API to achieve this task, or should I modify the source code?Thanks a lot! Yours, Zhao Ruiyuan ------------------------------------------------------------------------------ Sponsored by Intel(R) XDK Develop, test and display web and hybrid apps with a single code base. Download it for free now! http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Ahmed A. <asa...@ya...> - 2013-12-10 14:07:46
|
Hi, You can intercept all the content and save .js files only. Have a look at http://htmlunit.sourceforge.net/faq.html#HowToModifyRequestOrResponse Yours, Ahmed ________________________________ From: 赵芮元 <zry...@16...> To: htmlunit群邮件 <htm...@li...> Sent: Tuesday, December 10, 2013 2:03 PM Subject: [Htmlunit-user] Extracting Javascript Dear all, I want to extract all javascript files(.js) from a given URL, Is there a API to achieve this task, or should I modify the source code?Thanks a lot! Yours, Zhao Ruiyuan ------------------------------------------------------------------------------ Sponsored by Intel(R) XDK Develop, test and display web and hybrid apps with a single code base. Download it for free now! http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: 赵芮元 <zry...@16...> - 2013-12-10 11:03:51
|
Dear all, I want to extract all javascript files(.js) from a given URL, Is there a API to achieve this task, or should I modify the source code?Thanks a lot! Yours, Zhao Ruiyuan |
From: Fab B. <swo...@ho...> - 2013-12-05 01:45:40
|
Here's the exception that I was talking about: Exception in thread "main" ======= EXCEPTION START ======== EcmaError: lineNumber=[0] column=[0] lineSource=[function () {] name=[ReferenceError] sourceName=[onclick event for HtmlDivision[<div class="_119 stat_elem focus_target mtm mbl _5bsm _6dh _51z6" id="u_0_k" data-location="maincolumn" onclick="Bootloader.loadComponents("ComposerXControllerBootload", emptyFunction);">] in https://www.facebook.com/?_fb_noscript=1] message=[ReferenceError: "Bootloader" is not defined.] com.gargoylesoftware.htmlunit.ScriptException: ReferenceError: "Bootloader" is not defined. at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:684) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:602) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:507) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:616) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:591) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:985) at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventHandler(EventListenersContainer.java:210) at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:230) at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:804) at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:738) at com.gargoylesoftware.htmlunit.html.HtmlElement$1.run(HtmlElement.java:869) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:602) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:507) at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:874) at com.gargoylesoftware.htmlunit.html.HtmlElement.doClickFireClickEvent(HtmlElement.java:1311) at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1253) at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1205) at com.gargoylesoftware.htmlunit.html.HtmlElement.dblClick(HtmlElement.java:1351) at com.gargoylesoftware.htmlunit.html.HtmlElement.dblClick(HtmlElement.java:1326) at test.Mail.main(Mail.java:69) Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: ReferenceError: "Bootloader" is not defined. at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3603) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3587) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3657) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1749) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.name(ScriptRuntime.java:1690) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1622) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:405) at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:309) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3031) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:103) at com.gargoylesoftware.htmlunit.javascript.host.EventHandler.call(EventHandler.java:81) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:609) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:669) ... 19 more Enclosed exception: net.sourceforge.htmlunit.corejs.javascript.EcmaError: ReferenceError: "Bootloader" is not defined. at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3603) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3587) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3657) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1749) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.name(ScriptRuntime.java:1690) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1622) at script.onclick(onclick event for HtmlDivision[<div class="_119 stat_elem focus_target mtm mbl _5bsm _6dh _51z6" id="u_0_k" data-location="maincolumn" onclick="Bootloader.loadComponents("ComposerXControllerBootload", emptyFunction);">] in https://www.facebook.com/?_fb_noscript=1) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:405) at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:309) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3031) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:103) at com.gargoylesoftware.htmlunit.javascript.host.EventHandler.call(EventHandler.java:81) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:609) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:669) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:602) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:507) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:616) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:591) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:985) at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventHandler(EventListenersContainer.java:210) at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:230) at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:804) at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:738) at com.gargoylesoftware.htmlunit.html.HtmlElement$1.run(HtmlElement.java:869) at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:602) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:507) at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:874) at com.gargoylesoftware.htmlunit.html.HtmlElement.doClickFireClickEvent(HtmlElement.java:1311) at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1253) at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1205) at com.gargoylesoftware.htmlunit.html.HtmlElement.dblClick(HtmlElement.java:1351) at com.gargoylesoftware.htmlunit.html.HtmlElement.dblClick(HtmlElement.java:1326) at test.Mail.main(Mail.java:69) == CALLING JAVASCRIPT == function () { [native code, arity=0] } ======= EXCEPTION END ======== -----Messaggio originale----- From: Fab Brio Sent: Tuesday, December 3, 2013 8:24 PM To: htm...@li... Subject: Re: [Htmlunit-user] Problems with Facebook TextBox I fixed the first problem, now i can catch the element due to the js disabled, but I'm still struggling with the link preview, by the way i notice that if i use dblclick method on the text box, htmlunit throws an exception about javascript code. Suggestions? -----Messaggio originale----- From: Ronald Brill Sent: Tuesday, November 26, 2013 9:29 PM To: htm...@li... Subject: Re: [Htmlunit-user] Problems with Facebook TextBox Fab, usually all this fancy web sites are based on AJAX. So the page you finally got in your browser is the result of many request. Try to wait a bit after the login before you ask the WebClient for the current page again. In many cases this helps. For the wait code have a look at http://htmlunit.sourceforge.net/faq.html#AJAXDoesNotWork RBRi -------------------------- Wetator Smart web application testing http://www.wetator.org On Tue, 26 Nov 2013 21:22:51 +0100 Fab Brio wrote: > >Hi, > >I'm trying to build a application on Facebook with HtmlUnit, >So I want to log my profile, post contents on my wall and on groups pages. >I have no problem with the login procedure (I find the text boxes, i fill >them with name and password and I call "click" on the button. > >But I have problem with groups: I fail to grab the text box where I have to >write the message. > > >http://oi43.tinypic.com/28vszr6.jpg > >I proceed this way: > >java.util.logging.Logger.getLogger("com.gargoylesoftware").setLevel( > java.util.logging.Level.OFF); >WebClient client = new WebClient(BrowserVersion.getDefault()); >//log procedure... > >page = webClient.getPage("page_url"); >page.getElementByName("xhpc_message_text"); > >the last line throws an exception or returns null: HtmlUnit fails to find >the element. >I tried with the id (u_0_3a in this case) but it changes every time, the >name is always the same, so that's why I using name instead of id. > >How can I get the textbox element? > >The second problem is with the format in which facebook publish my content, >A normal post shows a title an icon etc. If I use HtmlUnit to fill the box >end click on the button to post it, fb shows only the string. >http://oi42.tinypic.com/2z703k0.jpg > >How can I fix it? > >I hope that someone have an answer for these problems. > ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Fab B. <swo...@ho...> - 2013-12-03 19:31:19
|
I fixed the first problem, now i can catch the element due to the js disabled, but I'm still struggling with the link preview, by the way i notice that if i use dblclick method on the text box, htmlunit throws an exception about javascript code. Suggestions? -----Messaggio originale----- From: Ronald Brill Sent: Tuesday, November 26, 2013 9:29 PM To: htm...@li... Subject: Re: [Htmlunit-user] Problems with Facebook TextBox Fab, usually all this fancy web sites are based on AJAX. So the page you finally got in your browser is the result of many request. Try to wait a bit after the login before you ask the WebClient for the current page again. In many cases this helps. For the wait code have a look at http://htmlunit.sourceforge.net/faq.html#AJAXDoesNotWork RBRi -------------------------- Wetator Smart web application testing http://www.wetator.org On Tue, 26 Nov 2013 21:22:51 +0100 Fab Brio wrote: > >Hi, > >I'm trying to build a application on Facebook with HtmlUnit, >So I want to log my profile, post contents on my wall and on groups pages. >I have no problem with the login procedure (I find the text boxes, i fill >them with name and password and I call "click" on the button. > >But I have problem with groups: I fail to grab the text box where I have to >write the message. > > >http://oi43.tinypic.com/28vszr6.jpg > >I proceed this way: > >java.util.logging.Logger.getLogger("com.gargoylesoftware").setLevel( > java.util.logging.Level.OFF); >WebClient client = new WebClient(BrowserVersion.getDefault()); >//log procedure... > >page = webClient.getPage("page_url"); >page.getElementByName("xhpc_message_text"); > >the last line throws an exception or returns null: HtmlUnit fails to find >the element. >I tried with the id (u_0_3a in this case) but it changes every time, the >name is always the same, so that's why I using name instead of id. > >How can I get the textbox element? > >The second problem is with the format in which facebook publish my content, >A normal post shows a title an icon etc. If I use HtmlUnit to fill the box >end click on the button to post it, fb shows only the string. >http://oi42.tinypic.com/2z703k0.jpg > >How can I fix it? > >I hope that someone have an answer for these problems. > ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |