jwebunit-users Mailing List for JWebUnit (Page 10)
Brought to you by:
henryju
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(42) |
Jul
(34) |
Aug
(19) |
Sep
(70) |
Oct
(22) |
Nov
(28) |
Dec
(15) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(11) |
Feb
(30) |
Mar
(36) |
Apr
(14) |
May
(48) |
Jun
(39) |
Jul
(30) |
Aug
(35) |
Sep
(21) |
Oct
(19) |
Nov
(8) |
Dec
(30) |
2006 |
Jan
(25) |
Feb
(24) |
Mar
(45) |
Apr
(13) |
May
(28) |
Jun
(60) |
Jul
(68) |
Aug
(26) |
Sep
(50) |
Oct
(71) |
Nov
(42) |
Dec
(24) |
2007 |
Jan
(59) |
Feb
(23) |
Mar
(43) |
Apr
(12) |
May
(25) |
Jun
(12) |
Jul
(10) |
Aug
(5) |
Sep
(38) |
Oct
(16) |
Nov
(11) |
Dec
(8) |
2008 |
Jan
(7) |
Feb
(11) |
Mar
(9) |
Apr
(8) |
May
(8) |
Jun
(3) |
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(12) |
Nov
|
Dec
(1) |
2009 |
Jan
(4) |
Feb
(5) |
Mar
(6) |
Apr
(8) |
May
(17) |
Jun
(5) |
Jul
(37) |
Aug
(19) |
Sep
(2) |
Oct
(11) |
Nov
(5) |
Dec
(11) |
2010 |
Jan
(2) |
Feb
(26) |
Mar
(12) |
Apr
(19) |
May
(1) |
Jun
(17) |
Jul
(7) |
Aug
(3) |
Sep
(13) |
Oct
(19) |
Nov
(4) |
Dec
(4) |
2011 |
Jan
(7) |
Feb
(4) |
Mar
(3) |
Apr
(1) |
May
(2) |
Jun
(2) |
Jul
|
Aug
(14) |
Sep
(3) |
Oct
(3) |
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
(12) |
Sep
(11) |
Oct
(3) |
Nov
(6) |
Dec
|
2013 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(1) |
Jul
(4) |
Aug
|
Sep
|
Oct
(4) |
Nov
|
Dec
|
2014 |
Jan
|
Feb
(2) |
Mar
(4) |
Apr
|
May
(4) |
Jun
|
Jul
(7) |
Aug
(2) |
Sep
(6) |
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(6) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
From: Stand T. <sta...@gm...> - 2010-02-25 14:22:45
|
I haven't used Xpather, but I do use firefinder quite a bit. thx timo On Thu, Feb 25, 2010 at 5:05 AM, Jonathan Slate <js...@mt...> wrote: > I've found the XPather Firefox add-on to be helpful in this regard, fwiw. > > Jevon Wright wrote: > > Hi Lakshmi, > > You could try getElementsByXPath("//table/tr[0]/th[contains(text(), > 'Attempts'])") or something similar. There's no straightforward way to do > what you're asking, but using a series of XPath expressions I think you > should be able to manage that. > > Perhaps something like > > 1. Get the index # of "Attempts" in "/table/tr[0]/th" > 2. Use this to access all td's with that #, e.g. "/table/tr/td[$i]" > > My XPath is a little rusty so these queries probably don't work :-) > > Cheers > Jevon > > On Thu, Feb 25, 2010 at 8:38 AM, lakshmi somavaram <lso...@gm...>wrote: > >> Hi Jwebunit Users, >> >> The following is the HTML table code. Is there a way to count the number >> of rows, or get the data in the table using JWebUnit? >> >> Here the table *does not have the table id or name* associated with it. >> Without changing the HTML code, I want to be able to get the value of the >> column with the heading "Attempts" in this table. >> >> Also, there are some more tables in this page that have no names and id's. >> Please direct me in the right direction. >> >> Thank you, >> Lakshmi >> >> <table> >> <tr> >> <th class="columnheader">Type</th> >> <th class="columnheader">Attempts</th> >> <th class="columnheader">Initial Failure Date</th> >> <th class="columnheader">Office</th> >> <th class="columnheader">Cust Name</th> >> <th class="columnheader">Recv Id</th> >> >> </tr> >> >> >> >> >> <tr class="oddRow"> >> <td class="tablerow">Notification</td> >> <td class="tablerow">1</td> >> <td class="tablerow">02/24/2010</td> >> <td class="tablerow">FSA KANSAS CITY >> COMPLEX-FSA</td> >> <td class="tablerow">AQUA-GULF TRANSPORT INC</td> >> <td class="tablerow">554474</td> >> </tr> >> <tr> >> <td> </td><th class="columnheader" >> colspan="6">Reasons</th> >> </tr> >> >> <tr><td> </td><td class="tablerow" >> colspan="7">Received null office for state and county</td></tr> >> >> >> >> <tr class="evenRow"> >> <td class="tablerow">Notification</td> >> <td class="tablerow">2</td> >> <td class="tablerow">02/23/2010</td> >> <td class="tablerow">FSA KANSAS CITY >> COMPLEX-FSA</td> >> <td class="tablerow">INTERFREIGHT TRANSPORT >> SYSTEMS</td> >> <td class="tablerow">547681</td> >> </tr> >> <tr> >> <td> </td><th class="columnheader" >> colspan="6">Reasons</th> >> </tr> >> >> <tr><td> </td><td class="tablerow" >> colspan="7">Received null office for state and county</td></tr> >> >> >> >> <tr class="oddRow"> >> <td class="tablerow">Notification</td> >> <td class="tablerow">3</td> >> <td class="tablerow">02/23/2010</td> >> <td class="tablerow">FSA KANSAS CITY >> COMPLEX-FSA</td> >> <td class="tablerow">WETERN AG RESOURCES</td> >> <td class="tablerow">547577</td> >> </tr> >> <tr><td colspan="5"> </td></tr> >> </table> >> >> >> >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> JWebUnit-users mailing list >> JWe...@li... >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> > ------------------------------ > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta.http://p.sf.net/sfu/intel-sw-dev > > ------------------------------ > > _______________________________________________ > JWebUnit-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > > |
From: Jonathan S. <js...@mt...> - 2010-02-25 11:22:47
|
I've found the XPather Firefox add-on to be helpful in this regard, fwiw. Jevon Wright wrote: > Hi Lakshmi, > > You could try getElementsByXPath("//table/tr[0]/th[contains(text(), > 'Attempts'])") or something similar. There's no straightforward way to > do what you're asking, but using a series of XPath expressions I think > you should be able to manage that. > > Perhaps something like > > 1. Get the index # of "Attempts" in "/table/tr[0]/th" > 2. Use this to access all td's with that #, e.g. "/table/tr/td[$i]" > > My XPath is a little rusty so these queries probably don't work :-) > > Cheers > Jevon > > On Thu, Feb 25, 2010 at 8:38 AM, lakshmi somavaram > <lso...@gm... <mailto:lso...@gm...>> wrote: > > Hi Jwebunit Users, > > The following is the HTML table code. Is there a way to count the > number of rows, or get the data in the table using JWebUnit? > > Here the table *does not have the table id or name* associated > with it. Without changing the HTML code, I want to be able to get > the value of the column with the heading "Attempts" in this table. > > Also, there are some more tables in this page that have no names > and id's. > Please direct me in the right direction. > > Thank you, > Lakshmi > > <table> > <tr> > <th class="columnheader">Type</th> > <th class="columnheader">Attempts</th> > <th class="columnheader">Initial Failure Date</th> > <th class="columnheader">Office</th> > <th class="columnheader">Cust Name</th> > <th class="columnheader">Recv Id</th> > > </tr> > > > > > <tr class="oddRow"> > <td class="tablerow">Notification</td> > <td class="tablerow">1</td> > <td class="tablerow">02/24/2010</td> > <td class="tablerow">FSA KANSAS CITY > COMPLEX-FSA</td> > <td class="tablerow">AQUA-GULF TRANSPORT > INC</td> > <td class="tablerow">554474</td> > </tr> > <tr> > <td> </td><th class="columnheader" > colspan="6">Reasons</th> > </tr> > > <tr><td> </td><td > class="tablerow" colspan="7">Received null office for state and > county</td></tr> > > > > <tr class="evenRow"> > <td class="tablerow">Notification</td> > <td class="tablerow">2</td> > <td class="tablerow">02/23/2010</td> > <td class="tablerow">FSA KANSAS CITY > COMPLEX-FSA</td> > <td class="tablerow">INTERFREIGHT > TRANSPORT SYSTEMS</td> > <td class="tablerow">547681</td> > </tr> > <tr> > <td> </td><th class="columnheader" > colspan="6">Reasons</th> > </tr> > > <tr><td> </td><td > class="tablerow" colspan="7">Received null office for state and > county</td></tr> > > > > <tr class="oddRow"> > <td class="tablerow">Notification</td> > <td class="tablerow">3</td> > <td class="tablerow">02/23/2010</td> > <td class="tablerow">FSA KANSAS CITY > COMPLEX-FSA</td> > <td class="tablerow">WETERN AG RESOURCES</td> > <td class="tablerow">547577</td> > </tr> > <tr><td colspan="5"> </td></tr> > </table> > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > <mailto:JWe...@li...> > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > ------------------------------------------------------------------------ > > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > |
From: Jevon W. <je...@je...> - 2010-02-24 23:02:22
|
Hi Lakshmi, You could try getElementsByXPath("//table/tr[0]/th[contains(text(), 'Attempts'])") or something similar. There's no straightforward way to do what you're asking, but using a series of XPath expressions I think you should be able to manage that. Perhaps something like 1. Get the index # of "Attempts" in "/table/tr[0]/th" 2. Use this to access all td's with that #, e.g. "/table/tr/td[$i]" My XPath is a little rusty so these queries probably don't work :-) Cheers Jevon On Thu, Feb 25, 2010 at 8:38 AM, lakshmi somavaram <lso...@gm...>wrote: > Hi Jwebunit Users, > > The following is the HTML table code. Is there a way to count the number of > rows, or get the data in the table using JWebUnit? > > Here the table *does not have the table id or name* associated with it. > Without changing the HTML code, I want to be able to get the value of the > column with the heading "Attempts" in this table. > > Also, there are some more tables in this page that have no names and id's. > Please direct me in the right direction. > > Thank you, > Lakshmi > > <table> > <tr> > <th class="columnheader">Type</th> > <th class="columnheader">Attempts</th> > <th class="columnheader">Initial Failure Date</th> > <th class="columnheader">Office</th> > <th class="columnheader">Cust Name</th> > <th class="columnheader">Recv Id</th> > > </tr> > > > > > <tr class="oddRow"> > <td class="tablerow">Notification</td> > <td class="tablerow">1</td> > <td class="tablerow">02/24/2010</td> > <td class="tablerow">FSA KANSAS CITY > COMPLEX-FSA</td> > <td class="tablerow">AQUA-GULF TRANSPORT INC</td> > <td class="tablerow">554474</td> > </tr> > <tr> > <td> </td><th class="columnheader" > colspan="6">Reasons</th> > </tr> > > <tr><td> </td><td class="tablerow" > colspan="7">Received null office for state and county</td></tr> > > > > <tr class="evenRow"> > <td class="tablerow">Notification</td> > <td class="tablerow">2</td> > <td class="tablerow">02/23/2010</td> > <td class="tablerow">FSA KANSAS CITY > COMPLEX-FSA</td> > <td class="tablerow">INTERFREIGHT TRANSPORT > SYSTEMS</td> > <td class="tablerow">547681</td> > </tr> > <tr> > <td> </td><th class="columnheader" > colspan="6">Reasons</th> > </tr> > > <tr><td> </td><td class="tablerow" > colspan="7">Received null office for state and county</td></tr> > > > > <tr class="oddRow"> > <td class="tablerow">Notification</td> > <td class="tablerow">3</td> > <td class="tablerow">02/23/2010</td> > <td class="tablerow">FSA KANSAS CITY > COMPLEX-FSA</td> > <td class="tablerow">WETERN AG RESOURCES</td> > <td class="tablerow">547577</td> > </tr> > <tr><td colspan="5"> </td></tr> > </table> > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > |
From: Eric J. <eje...@ho...> - 2010-02-24 22:59:41
|
Lakshmi, In the past I have used getElement. Then loop through the table finding the column you are looking for, then loop through the rows looking for your value. Of course this depends on your intent. Mine was to validate that options were appearing in a particular row for a particular drop down that did not have ids, the table did not have an id, and the form was named the same for each row. Quite annoying really. I have since forced the devs to change the HTML. Good luck. Eric From: lakshmi somavaram [mailto:lso...@gm...] Sent: Wednesday, February 24, 2010 1:38 PM To: Usage problems for JWebUnit Subject: [JWebUnit-users] How to use JWebUnit Table API's for HTML Tables without names or id Hi Jwebunit Users, The following is the HTML table code. Is there a way to count the number of rows, or get the data in the table using JWebUnit? Here the table does not have the table id or name associated with it. Without changing the HTML code, I want to be able to get the value of the column with the heading "Attempts" in this table. Also, there are some more tables in this page that have no names and id's. Please direct me in the right direction. Thank you, Lakshmi <table> <tr> <th class="columnheader">Type</th> <th class="columnheader">Attempts</th> <th class="columnheader">Initial Failure Date</th> <th class="columnheader">Office</th> <th class="columnheader">Cust Name</th> <th class="columnheader">Recv Id</th> </tr> <tr class="oddRow"> <td class="tablerow">Notification</td> <td class="tablerow">1</td> <td class="tablerow">02/24/2010</td> <td class="tablerow">FSA KANSAS CITY COMPLEX-FSA</td> <td class="tablerow">AQUA-GULF TRANSPORT INC</td> <td class="tablerow">554474</td> </tr> <tr> <td> </td><th class="columnheader" colspan="6">Reasons</th> </tr> <tr><td> </td><td class="tablerow" colspan="7">Received null office for state and county</td></tr> <tr class="evenRow"> <td class="tablerow">Notification</td> <td class="tablerow">2</td> <td class="tablerow">02/23/2010</td> <td class="tablerow">FSA KANSAS CITY COMPLEX-FSA</td> <td class="tablerow">INTERFREIGHT TRANSPORT SYSTEMS</td> <td class="tablerow">547681</td> </tr> <tr> <td> </td><th class="columnheader" colspan="6">Reasons</th> </tr> <tr><td> </td><td class="tablerow" colspan="7">Received null office for state and county</td></tr> <tr class="oddRow"> <td class="tablerow">Notification</td> <td class="tablerow">3</td> <td class="tablerow">02/23/2010</td> <td class="tablerow">FSA KANSAS CITY COMPLEX-FSA</td> <td class="tablerow">WETERN AG RESOURCES</td> <td class="tablerow">547577</td> </tr> <tr><td colspan="5"> </td></tr> </table> |
From: lakshmi s. <lso...@gm...> - 2010-02-24 19:38:30
|
Hi Jwebunit Users, The following is the HTML table code. Is there a way to count the number of rows, or get the data in the table using JWebUnit? Here the table *does not have the table id or name* associated with it. Without changing the HTML code, I want to be able to get the value of the column with the heading "Attempts" in this table. Also, there are some more tables in this page that have no names and id's. Please direct me in the right direction. Thank you, Lakshmi <table> <tr> <th class="columnheader">Type</th> <th class="columnheader">Attempts</th> <th class="columnheader">Initial Failure Date</th> <th class="columnheader">Office</th> <th class="columnheader">Cust Name</th> <th class="columnheader">Recv Id</th> </tr> <tr class="oddRow"> <td class="tablerow">Notification</td> <td class="tablerow">1</td> <td class="tablerow">02/24/2010</td> <td class="tablerow">FSA KANSAS CITY COMPLEX-FSA</td> <td class="tablerow">AQUA-GULF TRANSPORT INC</td> <td class="tablerow">554474</td> </tr> <tr> <td> </td><th class="columnheader" colspan="6">Reasons</th> </tr> <tr><td> </td><td class="tablerow" colspan="7">Received null office for state and county</td></tr> <tr class="evenRow"> <td class="tablerow">Notification</td> <td class="tablerow">2</td> <td class="tablerow">02/23/2010</td> <td class="tablerow">FSA KANSAS CITY COMPLEX-FSA</td> <td class="tablerow">INTERFREIGHT TRANSPORT SYSTEMS</td> <td class="tablerow">547681</td> </tr> <tr> <td> </td><th class="columnheader" colspan="6">Reasons</th> </tr> <tr><td> </td><td class="tablerow" colspan="7">Received null office for state and county</td></tr> <tr class="oddRow"> <td class="tablerow">Notification</td> <td class="tablerow">3</td> <td class="tablerow">02/23/2010</td> <td class="tablerow">FSA KANSAS CITY COMPLEX-FSA</td> <td class="tablerow">WETERN AG RESOURCES</td> <td class="tablerow">547577</td> </tr> <tr><td colspan="5"> </td></tr> </table> |
From: Julien H. <he...@ya...> - 2010-02-24 09:03:15
|
Hi all, ----- Message d'origine ---- > De : Tim Pizey <ti...@pa...> > À : Usage problems for JWebUnit <jwe...@li...> > Cc : JWebUnit Development mail list <jwe...@li...> > Envoyé le : Mar 23 Février 2010, 23 h 42 min 45 s > Objet : Re: [JWebUnit-users] Hi and thanks > > Hi Jevon, > > On 23 February 2010 22:29, Jevon Wright wrote: > > Hi Tim, > > > > 1- The list is managed by Sourceforge so it is public. The archives are > > online at > > http://sourceforge.net/mailarchive/forum.php?forum_name=jwebunit-users. > > Cool, thanks, didn't see it mentioned in the list-admin page. > > > 2- If I recall correctly, we moved from 2.x to 3.0 in anticipation of some > > major contributions by another contributor. I don't think these have > > happened. Perhaps we should release an interim version 2.2, since (as far as > > I can tell) there haven't been any significant API changes. > > If there is not much to do then this would be great, but wouldn't > going backwards > hurt your snapshot repository? We don't have an official SNAPSHOT repository so rolling back to 2.3 is not a problem. If everybody agree I'll start the release process. > > There is little, if any, downside to just rolling out a 3.0, or 3.0.0 > As I am sure you are aware I cannot release my next version with a > SNAPSHOT dependency, > and we are releasing every sprint. > > > 3- That's interesting. I haven't needed to set HtmlUnit manually. How are > > you initialising JWebUnit? > > I do not have my code in front of me, but it was calling > firstAvailable() if memory serves, > that was returning a selenium engine which in turn was throwing an > unconfigured exception. > > Fixed by explicitly setting my default engine. The problem would seem > to be relying upon the order of the > engines coming out of the engine Map. Concerning testing engines, it works when you have only one in the classpath (HtmlUnit or Selenium) but if you need both in the classpath, you may need to explicitly select the right one. > > cheers > Tim > Regards, Julien |
From: Tim P. <ti...@pa...> - 2010-02-23 22:42:53
|
Hi Jevon, On 23 February 2010 22:29, Jevon Wright wrote: > Hi Tim, > > 1- The list is managed by Sourceforge so it is public. The archives are > online at > http://sourceforge.net/mailarchive/forum.php?forum_name=jwebunit-users. Cool, thanks, didn't see it mentioned in the list-admin page. > 2- If I recall correctly, we moved from 2.x to 3.0 in anticipation of some > major contributions by another contributor. I don't think these have > happened. Perhaps we should release an interim version 2.2, since (as far as > I can tell) there haven't been any significant API changes. If there is not much to do then this would be great, but wouldn't going backwards hurt your snapshot repository? There is little, if any, downside to just rolling out a 3.0, or 3.0.0 As I am sure you are aware I cannot release my next version with a SNAPSHOT dependency, and we are releasing every sprint. > 3- That's interesting. I haven't needed to set HtmlUnit manually. How are > you initialising JWebUnit? I do not have my code in front of me, but it was calling firstAvailable() if memory serves, that was returning a selenium engine which in turn was throwing an unconfigured exception. Fixed by explicitly setting my default engine. The problem would seem to be relying upon the order of the engines coming out of the engine Map. cheers Tim |
From: Jevon W. <je...@je...> - 2010-02-23 22:29:42
|
Hi Tim, 1- The list is managed by Sourceforge so it is public. The archives are online at http://sourceforge.net/mailarchive/forum.php?forum_name=jwebunit-users. 2- If I recall correctly, we moved from 2.x to 3.0 in anticipation of some major contributions by another contributor. I don't think these have happened. Perhaps we should release an interim version 2.2, since (as far as I can tell) there haven't been any significant API changes. 3- That's interesting. I haven't needed to set HtmlUnit manually. How are you initialising JWebUnit? Cheers Jevon On Wed, Feb 24, 2010 at 2:11 AM, Tim Pizey <ti...@pa...> wrote: > Hi, > > thanks for a great project. > > I have used JWebUnit on a few projects for about five years, > it is great to see that it is still dynamic. > > > A few questions: > > The list archive does not appear to be public. > > I have had to download and install locally version 3-SNAPSHOT > as I need access to WebClient to enable authorisation: when is version > 3 going to be released? > What needs to be done to get version 3 released? > > I have had to manually set HtmlUnit as my default testing engine, > though the javadoc states that it is meant to be. > > thanks again > Tim > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > |
From: lakshmi s. <lso...@gm...> - 2010-02-23 18:12:02
|
Jevon, I will talk to my developers and see what is going on the server side. Thanks a lot for your help, Lakshmi On Thu, Feb 18, 2010 at 4:48 PM, Jevon Wright <je...@je...> wrote: > Hi, > > In that stack trace, it is indicating that the server through a 500 > Internal Server Error - in other words, the script on the server side > crashed. This is beyond JWebUnit's control and indicates a problem with the > application you are testing. You may need to debug your server-side script. > > Jevon > > > On Fri, Feb 19, 2010 at 4:24 AM, lakshmi somavaram <lso...@gm...>wrote: > >> Hi Jevon, >> >> Yes, you are right, the stack trace that I showed is for assertText >> failure. I showed that just to show you how the buttons look at the bottom. >> You can see the 2 problem buttons with ??? marks. >> >> Also, assertSubmitButtonPresent("buttonValue","???button.select???"); >> works fine. So, the select buttons value actually is "???button.select???" >> and not "Select" as seen in view source. >> >> I tried the XPath again with the expression that you have given, I still >> get an error. The stack trace this time is as below: >> >> Thank you, >> Lakshmi. >> >> com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException: 500 Internal >> Server Error for >> http://outlet.cert.sc.egov.usda.gov/NRRS/processProgramCodeResults.do >> at >> com.gargoylesoftware.htmlunit.WebClient.throwFailingHttpStatusCodeExceptionIfNecessary(WebClient.java:530) >> at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:330) >> at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:354) >> at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:179) >> at >> com.gargoylesoftware.htmlunit.html.HtmlSubmitInput.doClickAction(HtmlSubmitInput.java:82) >> at >> com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1329) >> at >> com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1288) >> at >> com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1257) >> at >> net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.clickElementByXPath(HtmlUnitTestingEngineImpl.java:1864) >> at >> net.sourceforge.jwebunit.junit.WebTester.clickElementByXPath(WebTester.java:2574) >> at >> net.sourceforge.jwebunit.junit.WebTestCase.clickElementByXPath(WebTestCase.java:2067) >> at >> gov.usda.fsa.tco.test.NRRSExample.testNRRS_EstablishReceivable(NRRSExample.java:224) >> >> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> at java.lang.reflect.Method.invoke(Method.java:585) >> at junit.framework.TestCase.runTest(TestCase.java:164) >> at junit.framework.TestCase.runBare(TestCase.java:130) >> at >> net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:79) >> at junit.framework.TestResult$1.protect(TestResult.java:106) >> at junit.framework.TestResult.runProtected(TestResult.java:124) >> at junit.framework.TestResult.run(TestResult.java:109) >> at junit.framework.TestCase.run(TestCase.java:120) >> at junit.framework.TestSuite.runTest(TestSuite.java:230) >> at junit.framework.TestSuite.run(TestSuite.java:225) >> at >> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) >> at >> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) >> at >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) >> at >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) >> at >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) >> at >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) >> >> >> On Wed, Feb 17, 2010 at 5:41 PM, Jevon Wright <je...@je...> wrote: >> >>> Hi Lakshmi, >>> >>> It looks like there is a problem with your XPath expression: change '@type='submit', >>> @name='buttonValue' and @value='???button.select???'' to '@type='submit' >>> * and *@name='buttonValue' and @value='???button.select???''. >>> >>> The stack trace you are providing does not relate to clicking a button, >>> but rather the text content not being visible on the page. If the element >>> could not be clicked, a different exception would have been thrown. I also >>> don't understand the '@value='???...???'' XPath, because that content isn't >>> on the page source attached. >>> >>> Jevon >>> >>> >>> On Thu, Feb 18, 2010 at 3:51 AM, lakshmi somavaram <lso...@gm... >>> > wrote: >>> >>>> Hi Jevon, >>>> >>>> *Here is the code for the buttons from view source of web page:* >>>> >>>> <input type="submit" name="buttonValue" value="Select" >>>> class="actionbutton"> >>>> <input type="reset" value="Reset" class="actionbutton"> >>>> >>>> <input type="submit" name="buttonValue" value="Back" >>>> class="actionbutton"> >>>> <input type="submit" name="org.apache.struts.taglib.html.CANCEL" >>>> value="Cancel" onclick="bCancel=true;" class="actionbutton"> >>>> >>>> *Here is the code for the clickElementByXPath:* >>>> >>>> clickElementByXPath("//input[@type='submit' and @value='Select']"); >>>> >>>> clickElementByXPath("//input[@type='submit', @name='buttonValue' and >>>> @value='???button.select???']"); >>>> >>>> *When assert text was used with the wrong text, the page source looked >>>> like below:* >>>> We can notice below that the buttons with problem are resolved with >>>> question marks like ???button.select??? Reset ???button.back??? Cancel >>>> >>>> ----------------------------------------------------------------------------------------------------------------------------- >>>> junit.framework.AssertionFailedError: Expected text not found in >>>> current page: [Create New Receivable] >>>> Page content was: [National Receipts & Receivables System >>>> >>>> >>>> Farm Service Agency >>>> National Receipts & Receivables System >>>> Home About USDA Help Contact Us Log Off >>>> >>>> Program Code Search Results >>>> ???label.accounting.program.codes??? >>>> ???label.general.name? <http://label.general.name/?> >>>> ?? ???label.general.description??? >>>> checked 01ADDLNINTAPNT ADD'L LOAN INTEREST - PEANUTS, ADD'L >>>> unchecked 01APNTSLNT LOAN TRANSFER - PEANUTS, ADD'L >>>> ???button.select??? Reset ???button.back??? Cancel >>>> NRRS-Web-2.21 >>>> >>>> | Home | USDA Internet | USDA Intranet | FSA Internet | FSA Intranet >>>> | FOIA | Accessibility Statement | Privacy Policy | Non-Discrimination >>>> Statement | Information Quality | FirstGov | White House |] >>>> at junit.framework.Assert.fail(Assert.java:47) >>>> at >>>> net.sourceforge.jwebunit.junit.WebTester.assertTextPresent(WebTester.java:442) >>>> at >>>> net.sourceforge.jwebunit.junit.WebTestCase.assertTextPresent(WebTestCase.java:372) >>>> at >>>> gov.usda.fsa.tco.test.NRRSExample.testNRRS_EstablishReceivable(NRRSExample.java:231) >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>> at >>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >>>> at >>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >>>> at java.lang.reflect.Method.invoke(Method.java:585) >>>> at junit.framework.TestCase.runTest(TestCase.java:164) >>>> at junit.framework.TestCase.runBare(TestCase.java:130) >>>> at >>>> net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:79) >>>> at junit.framework.TestResult$1.protect(TestResult.java:106) >>>> at junit.framework.TestResult.runProtected(TestResult.java:124) >>>> at junit.framework.TestResult.run(TestResult.java:109) >>>> at junit.framework.TestCase.run(TestCase.java:120) >>>> at junit.framework.TestSuite.runTest(TestSuite.java:230) >>>> at junit.framework.TestSuite.run(TestSuite.java:225) >>>> at >>>> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) >>>> at >>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) >>>> at >>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) >>>> at >>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) >>>> at >>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) >>>> at >>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) >>>> >>>> >>>> >>>> ----------------------------------------------------------------------------------------------------------------------------- >>>> Thank you, >>>> Lakshmi >>>> >>>> >>>> >>>> >>>> On Tue, Feb 16, 2010 at 3:48 PM, Jevon Wright <je...@je...> wrote: >>>> >>>>> Hi Lakshmi, >>>>> >>>>> Can you post the HTML source code of the generated buttons, and the >>>>> code you were trying to use with clickElementByXPath()? >>>>> >>>>> The two libraries you have mentioned are server-side libraries. >>>>> JWebUnit actually navigates the web application from the point of view of a >>>>> browser, using HtmlUnit. It has no idea which server-side technology you are >>>>> using - so for example, you could test JSP, PHP, .Net or even CGI >>>>> applications with it. >>>>> >>>>> Jevon >>>>> >>>>> On Wed, Feb 17, 2010 at 5:13 AM, lakshmi somavaram < >>>>> lso...@gm...> wrote: >>>>> >>>>>> Dear users, >>>>>> >>>>>> I have 4 buttons on a webpage and JwebUnit (clickButtonWithText) >>>>>> recognizes 2 of them and not the other 2. >>>>>> After speaking with developers, I heard that 2 that are recognized >>>>>> were created using struts.apache.org/tags-html tag library >>>>>> The 2 that do not work were created with java.sun.com/jsp/jstl/fmtlibrary >>>>>> >>>>>> I have tried using all the submit() functions as well. I also used, >>>>>> clickElementByXPath. >>>>>> >>>>>> Any idea how this can be resolved? Also, what is used for rendering >>>>>> the pages in JWebUnit? Does theJWebUnit program that renders the webpage >>>>>> use both the libraries that I have mentioned? >>>>>> >>>>>> Any help will be greatly appreciated. >>>>>> >>>>>> Thank you, >>>>>> Lakshmi. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> SOLARIS 10 is the OS for Data Centers - provides features such as >>>>>> DTrace, >>>>>> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW >>>>>> http://p.sf.net/sfu/solaris-dev2dev >>>>>> _______________________________________________ >>>>>> JWebUnit-users mailing list >>>>>> JWe...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>>>> >>>>>> >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> SOLARIS 10 is the OS for Data Centers - provides features such as >>>>> DTrace, >>>>> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW >>>>> http://p.sf.net/sfu/solaris-dev2dev >>>>> _______________________________________________ >>>>> JWebUnit-users mailing list >>>>> JWe...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>>> >>>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> SOLARIS 10 is the OS for Data Centers - provides features such as >>>> DTrace, >>>> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW >>>> http://p.sf.net/sfu/solaris-dev2dev >>>> _______________________________________________ >>>> JWebUnit-users mailing list >>>> JWe...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>> >>>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Download Intel® Parallel Studio Eval >>> Try the new software tools for yourself. Speed compiling, find bugs >>> proactively, and fine-tune applications for parallel performance. >>> See why Intel Parallel Studio got high marks during beta. >>> http://p.sf.net/sfu/intel-sw-dev >>> >>> _______________________________________________ >>> JWebUnit-users mailing list >>> JWe...@li... >>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>> >>> >> >> >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> JWebUnit-users mailing list >> JWe...@li... >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > |
From: Tim P. <ti...@pa...> - 2010-02-23 13:19:46
|
Hi, thanks for a great project. I have used JWebUnit on a few projects for about five years, it is great to see that it is still dynamic. A few questions: The list archive does not appear to be public. I have had to download and install locally version 3-SNAPSHOT as I need access to WebClient to enable authorisation: when is version 3 going to be released? What needs to be done to get version 3 released? I have had to manually set HtmlUnit as my default testing engine, though the javadoc states that it is meant to be. thanks again Tim |
From: Jevon W. <je...@je...> - 2010-02-18 22:48:46
|
Hi, In that stack trace, it is indicating that the server through a 500 Internal Server Error - in other words, the script on the server side crashed. This is beyond JWebUnit's control and indicates a problem with the application you are testing. You may need to debug your server-side script. Jevon On Fri, Feb 19, 2010 at 4:24 AM, lakshmi somavaram <lso...@gm...>wrote: > Hi Jevon, > > Yes, you are right, the stack trace that I showed is for assertText > failure. I showed that just to show you how the buttons look at the bottom. > You can see the 2 problem buttons with ??? marks. > > Also, assertSubmitButtonPresent("buttonValue","???button.select???"); > works fine. So, the select buttons value actually is "???button.select???" > and not "Select" as seen in view source. > > I tried the XPath again with the expression that you have given, I still > get an error. The stack trace this time is as below: > > Thank you, > Lakshmi. > > com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException: 500 Internal > Server Error for > http://outlet.cert.sc.egov.usda.gov/NRRS/processProgramCodeResults.do > at > com.gargoylesoftware.htmlunit.WebClient.throwFailingHttpStatusCodeExceptionIfNecessary(WebClient.java:530) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:330) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:354) > at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:179) > at > com.gargoylesoftware.htmlunit.html.HtmlSubmitInput.doClickAction(HtmlSubmitInput.java:82) > at > com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1329) > at > com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1288) > at > com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1257) > at > net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.clickElementByXPath(HtmlUnitTestingEngineImpl.java:1864) > at > net.sourceforge.jwebunit.junit.WebTester.clickElementByXPath(WebTester.java:2574) > at > net.sourceforge.jwebunit.junit.WebTestCase.clickElementByXPath(WebTestCase.java:2067) > at > gov.usda.fsa.tco.test.NRRSExample.testNRRS_EstablishReceivable(NRRSExample.java:224) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at junit.framework.TestCase.runTest(TestCase.java:164) > at junit.framework.TestCase.runBare(TestCase.java:130) > at net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:79) > at junit.framework.TestResult$1.protect(TestResult.java:106) > at junit.framework.TestResult.runProtected(TestResult.java:124) > at junit.framework.TestResult.run(TestResult.java:109) > at junit.framework.TestCase.run(TestCase.java:120) > at junit.framework.TestSuite.runTest(TestSuite.java:230) > at junit.framework.TestSuite.run(TestSuite.java:225) > at > org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) > at > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) > > > On Wed, Feb 17, 2010 at 5:41 PM, Jevon Wright <je...@je...> wrote: > >> Hi Lakshmi, >> >> It looks like there is a problem with your XPath expression: change '@type='submit', >> @name='buttonValue' and @value='???button.select???'' to '@type='submit'*and >> *@name='buttonValue' and @value='???button.select???''. >> >> The stack trace you are providing does not relate to clicking a button, >> but rather the text content not being visible on the page. If the element >> could not be clicked, a different exception would have been thrown. I also >> don't understand the '@value='???...???'' XPath, because that content isn't >> on the page source attached. >> >> Jevon >> >> >> On Thu, Feb 18, 2010 at 3:51 AM, lakshmi somavaram <lso...@gm...>wrote: >> >>> Hi Jevon, >>> >>> *Here is the code for the buttons from view source of web page:* >>> >>> <input type="submit" name="buttonValue" value="Select" >>> class="actionbutton"> >>> <input type="reset" value="Reset" class="actionbutton"> >>> >>> <input type="submit" name="buttonValue" value="Back" >>> class="actionbutton"> >>> <input type="submit" name="org.apache.struts.taglib.html.CANCEL" >>> value="Cancel" onclick="bCancel=true;" class="actionbutton"> >>> >>> *Here is the code for the clickElementByXPath:* >>> >>> clickElementByXPath("//input[@type='submit' and @value='Select']"); >>> >>> clickElementByXPath("//input[@type='submit', @name='buttonValue' and >>> @value='???button.select???']"); >>> >>> *When assert text was used with the wrong text, the page source looked >>> like below:* >>> We can notice below that the buttons with problem are resolved with >>> question marks like ???button.select??? Reset ???button.back??? Cancel >>> >>> ----------------------------------------------------------------------------------------------------------------------------- >>> junit.framework.AssertionFailedError: Expected text not found in >>> current page: [Create New Receivable] >>> Page content was: [National Receipts & Receivables System >>> >>> >>> Farm Service Agency >>> National Receipts & Receivables System >>> Home About USDA Help Contact Us Log Off >>> >>> Program Code Search Results >>> ???label.accounting.program.codes??? >>> ???label.general.name? <http://label.general.name/?> >>> ?? ???label.general.description??? >>> checked 01ADDLNINTAPNT ADD'L LOAN INTEREST - PEANUTS, ADD'L >>> unchecked 01APNTSLNT LOAN TRANSFER - PEANUTS, ADD'L >>> ???button.select??? Reset ???button.back??? Cancel >>> NRRS-Web-2.21 >>> >>> | Home | USDA Internet | USDA Intranet | FSA Internet | FSA Intranet >>> | FOIA | Accessibility Statement | Privacy Policy | Non-Discrimination >>> Statement | Information Quality | FirstGov | White House |] >>> at junit.framework.Assert.fail(Assert.java:47) >>> at >>> net.sourceforge.jwebunit.junit.WebTester.assertTextPresent(WebTester.java:442) >>> at >>> net.sourceforge.jwebunit.junit.WebTestCase.assertTextPresent(WebTestCase.java:372) >>> at >>> gov.usda.fsa.tco.test.NRRSExample.testNRRS_EstablishReceivable(NRRSExample.java:231) >>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>> at >>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >>> at >>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >>> at java.lang.reflect.Method.invoke(Method.java:585) >>> at junit.framework.TestCase.runTest(TestCase.java:164) >>> at junit.framework.TestCase.runBare(TestCase.java:130) >>> at >>> net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:79) >>> at junit.framework.TestResult$1.protect(TestResult.java:106) >>> at junit.framework.TestResult.runProtected(TestResult.java:124) >>> at junit.framework.TestResult.run(TestResult.java:109) >>> at junit.framework.TestCase.run(TestCase.java:120) >>> at junit.framework.TestSuite.runTest(TestSuite.java:230) >>> at junit.framework.TestSuite.run(TestSuite.java:225) >>> at >>> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) >>> at >>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) >>> at >>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) >>> at >>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) >>> at >>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) >>> at >>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) >>> >>> >>> >>> ----------------------------------------------------------------------------------------------------------------------------- >>> Thank you, >>> Lakshmi >>> >>> >>> >>> >>> On Tue, Feb 16, 2010 at 3:48 PM, Jevon Wright <je...@je...> wrote: >>> >>>> Hi Lakshmi, >>>> >>>> Can you post the HTML source code of the generated buttons, and the code >>>> you were trying to use with clickElementByXPath()? >>>> >>>> The two libraries you have mentioned are server-side libraries. JWebUnit >>>> actually navigates the web application from the point of view of a browser, >>>> using HtmlUnit. It has no idea which server-side technology you are using - >>>> so for example, you could test JSP, PHP, .Net or even CGI applications with >>>> it. >>>> >>>> Jevon >>>> >>>> On Wed, Feb 17, 2010 at 5:13 AM, lakshmi somavaram < >>>> lso...@gm...> wrote: >>>> >>>>> Dear users, >>>>> >>>>> I have 4 buttons on a webpage and JwebUnit (clickButtonWithText) >>>>> recognizes 2 of them and not the other 2. >>>>> After speaking with developers, I heard that 2 that are recognized were >>>>> created using struts.apache.org/tags-html tag library >>>>> The 2 that do not work were created with java.sun.com/jsp/jstl/fmtlibrary >>>>> >>>>> I have tried using all the submit() functions as well. I also used, >>>>> clickElementByXPath. >>>>> >>>>> Any idea how this can be resolved? Also, what is used for rendering the >>>>> pages in JWebUnit? Does theJWebUnit program that renders the webpage use >>>>> both the libraries that I have mentioned? >>>>> >>>>> Any help will be greatly appreciated. >>>>> >>>>> Thank you, >>>>> Lakshmi. >>>>> >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> SOLARIS 10 is the OS for Data Centers - provides features such as >>>>> DTrace, >>>>> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW >>>>> http://p.sf.net/sfu/solaris-dev2dev >>>>> _______________________________________________ >>>>> JWebUnit-users mailing list >>>>> JWe...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>>> >>>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> SOLARIS 10 is the OS for Data Centers - provides features such as >>>> DTrace, >>>> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW >>>> http://p.sf.net/sfu/solaris-dev2dev >>>> _______________________________________________ >>>> JWebUnit-users mailing list >>>> JWe...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>> >>>> >>> >>> >>> ------------------------------------------------------------------------------ >>> SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, >>> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW >>> http://p.sf.net/sfu/solaris-dev2dev >>> _______________________________________________ >>> JWebUnit-users mailing list >>> JWe...@li... >>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>> >>> >> >> >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> >> _______________________________________________ >> JWebUnit-users mailing list >> JWe...@li... >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > |
From: lakshmi s. <lso...@gm...> - 2010-02-18 15:24:51
|
Hi Jevon, Yes, you are right, the stack trace that I showed is for assertText failure. I showed that just to show you how the buttons look at the bottom. You can see the 2 problem buttons with ??? marks. Also, assertSubmitButtonPresent("buttonValue","???button.select???"); works fine. So, the select buttons value actually is "???button.select???" and not "Select" as seen in view source. I tried the XPath again with the expression that you have given, I still get an error. The stack trace this time is as below: Thank you, Lakshmi. com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException: 500 Internal Server Error for http://outlet.cert.sc.egov.usda.gov/NRRS/processProgramCodeResults.do at com.gargoylesoftware.htmlunit.WebClient.throwFailingHttpStatusCodeExceptionIfNecessary(WebClient.java:530) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:330) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:354) at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:179) at com.gargoylesoftware.htmlunit.html.HtmlSubmitInput.doClickAction(HtmlSubmitInput.java:82) at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1329) at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1288) at com.gargoylesoftware.htmlunit.html.HtmlElement.click(HtmlElement.java:1257) at net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.clickElementByXPath(HtmlUnitTestingEngineImpl.java:1864) at net.sourceforge.jwebunit.junit.WebTester.clickElementByXPath(WebTester.java:2574) at net.sourceforge.jwebunit.junit.WebTestCase.clickElementByXPath(WebTestCase.java:2067) at gov.usda.fsa.tco.test.NRRSExample.testNRRS_EstablishReceivable(NRRSExample.java:224) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:164) at junit.framework.TestCase.runBare(TestCase.java:130) at net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:79) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) On Wed, Feb 17, 2010 at 5:41 PM, Jevon Wright <je...@je...> wrote: > Hi Lakshmi, > > It looks like there is a problem with your XPath expression: change '@type='submit', > @name='buttonValue' and @value='???button.select???'' to '@type='submit'*and > *@name='buttonValue' and @value='???button.select???''. > > The stack trace you are providing does not relate to clicking a button, but > rather the text content not being visible on the page. If the element could > not be clicked, a different exception would have been thrown. I also don't > understand the '@value='???...???'' XPath, because that content isn't on the > page source attached. > > Jevon > > > On Thu, Feb 18, 2010 at 3:51 AM, lakshmi somavaram <lso...@gm...>wrote: > >> Hi Jevon, >> >> *Here is the code for the buttons from view source of web page:* >> >> <input type="submit" name="buttonValue" value="Select" >> class="actionbutton"> >> <input type="reset" value="Reset" class="actionbutton"> >> >> <input type="submit" name="buttonValue" value="Back" >> class="actionbutton"> >> <input type="submit" name="org.apache.struts.taglib.html.CANCEL" >> value="Cancel" onclick="bCancel=true;" class="actionbutton"> >> >> *Here is the code for the clickElementByXPath:* >> >> clickElementByXPath("//input[@type='submit' and @value='Select']"); >> >> clickElementByXPath("//input[@type='submit', @name='buttonValue' and >> @value='???button.select???']"); >> >> *When assert text was used with the wrong text, the page source looked >> like below:* >> We can notice below that the buttons with problem are resolved with >> question marks like ???button.select??? Reset ???button.back??? Cancel >> >> ----------------------------------------------------------------------------------------------------------------------------- >> junit.framework.AssertionFailedError: Expected text not found in current >> page: [Create New Receivable] >> Page content was: [National Receipts & Receivables System >> >> >> Farm Service Agency >> National Receipts & Receivables System >> Home About USDA Help Contact Us Log Off >> >> Program Code Search Results >> ???label.accounting.program.codes??? >> ???label.general.name? <http://label.general.name/?> >> ?? ???label.general.description??? >> checked 01ADDLNINTAPNT ADD'L LOAN INTEREST - PEANUTS, ADD'L >> unchecked 01APNTSLNT LOAN TRANSFER - PEANUTS, ADD'L >> ???button.select??? Reset ???button.back??? Cancel >> NRRS-Web-2.21 >> >> | Home | USDA Internet | USDA Intranet | FSA Internet | FSA Intranet >> | FOIA | Accessibility Statement | Privacy Policy | Non-Discrimination >> Statement | Information Quality | FirstGov | White House |] >> at junit.framework.Assert.fail(Assert.java:47) >> at >> net.sourceforge.jwebunit.junit.WebTester.assertTextPresent(WebTester.java:442) >> at >> net.sourceforge.jwebunit.junit.WebTestCase.assertTextPresent(WebTestCase.java:372) >> at >> gov.usda.fsa.tco.test.NRRSExample.testNRRS_EstablishReceivable(NRRSExample.java:231) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> at java.lang.reflect.Method.invoke(Method.java:585) >> at junit.framework.TestCase.runTest(TestCase.java:164) >> at junit.framework.TestCase.runBare(TestCase.java:130) >> at >> net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:79) >> at junit.framework.TestResult$1.protect(TestResult.java:106) >> at junit.framework.TestResult.runProtected(TestResult.java:124) >> at junit.framework.TestResult.run(TestResult.java:109) >> at junit.framework.TestCase.run(TestCase.java:120) >> at junit.framework.TestSuite.runTest(TestSuite.java:230) >> at junit.framework.TestSuite.run(TestSuite.java:225) >> at >> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) >> at >> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) >> at >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) >> at >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) >> at >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) >> at >> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) >> >> >> >> ----------------------------------------------------------------------------------------------------------------------------- >> Thank you, >> Lakshmi >> >> >> >> >> On Tue, Feb 16, 2010 at 3:48 PM, Jevon Wright <je...@je...> wrote: >> >>> Hi Lakshmi, >>> >>> Can you post the HTML source code of the generated buttons, and the code >>> you were trying to use with clickElementByXPath()? >>> >>> The two libraries you have mentioned are server-side libraries. JWebUnit >>> actually navigates the web application from the point of view of a browser, >>> using HtmlUnit. It has no idea which server-side technology you are using - >>> so for example, you could test JSP, PHP, .Net or even CGI applications with >>> it. >>> >>> Jevon >>> >>> On Wed, Feb 17, 2010 at 5:13 AM, lakshmi somavaram < >>> lso...@gm...> wrote: >>> >>>> Dear users, >>>> >>>> I have 4 buttons on a webpage and JwebUnit (clickButtonWithText) >>>> recognizes 2 of them and not the other 2. >>>> After speaking with developers, I heard that 2 that are recognized were >>>> created using struts.apache.org/tags-html tag library >>>> The 2 that do not work were created with java.sun.com/jsp/jstl/fmtlibrary >>>> >>>> I have tried using all the submit() functions as well. I also used, >>>> clickElementByXPath. >>>> >>>> Any idea how this can be resolved? Also, what is used for rendering the >>>> pages in JWebUnit? Does theJWebUnit program that renders the webpage use >>>> both the libraries that I have mentioned? >>>> >>>> Any help will be greatly appreciated. >>>> >>>> Thank you, >>>> Lakshmi. >>>> >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> SOLARIS 10 is the OS for Data Centers - provides features such as >>>> DTrace, >>>> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW >>>> http://p.sf.net/sfu/solaris-dev2dev >>>> _______________________________________________ >>>> JWebUnit-users mailing list >>>> JWe...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>> >>>> >>> >>> >>> ------------------------------------------------------------------------------ >>> SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, >>> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW >>> http://p.sf.net/sfu/solaris-dev2dev >>> _______________________________________________ >>> JWebUnit-users mailing list >>> JWe...@li... >>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>> >>> >> >> >> ------------------------------------------------------------------------------ >> SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, >> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW >> http://p.sf.net/sfu/solaris-dev2dev >> _______________________________________________ >> JWebUnit-users mailing list >> JWe...@li... >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > |
From: Jevon W. <je...@je...> - 2010-02-17 23:41:58
|
Hi Lakshmi, It looks like there is a problem with your XPath expression: change '@type='submit', @name='buttonValue' and @value='???button.select???'' to '@type='submit'*and *@name='buttonValue' and @value='???button.select???''. The stack trace you are providing does not relate to clicking a button, but rather the text content not being visible on the page. If the element could not be clicked, a different exception would have been thrown. I also don't understand the '@value='???...???'' XPath, because that content isn't on the page source attached. Jevon On Thu, Feb 18, 2010 at 3:51 AM, lakshmi somavaram <lso...@gm...>wrote: > Hi Jevon, > > *Here is the code for the buttons from view source of web page:* > > <input type="submit" name="buttonValue" value="Select" > class="actionbutton"> > <input type="reset" value="Reset" class="actionbutton"> > > <input type="submit" name="buttonValue" value="Back" > class="actionbutton"> > <input type="submit" name="org.apache.struts.taglib.html.CANCEL" > value="Cancel" onclick="bCancel=true;" class="actionbutton"> > > *Here is the code for the clickElementByXPath:* > > clickElementByXPath("//input[@type='submit' and @value='Select']"); > > clickElementByXPath("//input[@type='submit', @name='buttonValue' and > @value='???button.select???']"); > > *When assert text was used with the wrong text, the page source looked > like below:* > We can notice below that the buttons with problem are resolved with > question marks like ???button.select??? Reset ???button.back??? Cancel > > ----------------------------------------------------------------------------------------------------------------------------- > junit.framework.AssertionFailedError: Expected text not found in current > page: [Create New Receivable] > Page content was: [National Receipts & Receivables System > > > Farm Service Agency > National Receipts & Receivables System > Home About USDA Help Contact Us Log Off > > Program Code Search Results > ???label.accounting.program.codes??? > ???label.general.name??? ???label.general.description??? > checked 01ADDLNINTAPNT ADD'L LOAN INTEREST - PEANUTS, ADD'L > unchecked 01APNTSLNT LOAN TRANSFER - PEANUTS, ADD'L > ???button.select??? Reset ???button.back??? Cancel > NRRS-Web-2.21 > > | Home | USDA Internet | USDA Intranet | FSA Internet | FSA Intranet > | FOIA | Accessibility Statement | Privacy Policy | Non-Discrimination > Statement | Information Quality | FirstGov | White House |] > at junit.framework.Assert.fail(Assert.java:47) > at > net.sourceforge.jwebunit.junit.WebTester.assertTextPresent(WebTester.java:442) > at > net.sourceforge.jwebunit.junit.WebTestCase.assertTextPresent(WebTestCase.java:372) > at > gov.usda.fsa.tco.test.NRRSExample.testNRRS_EstablishReceivable(NRRSExample.java:231) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at junit.framework.TestCase.runTest(TestCase.java:164) > at junit.framework.TestCase.runBare(TestCase.java:130) > at net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:79) > at junit.framework.TestResult$1.protect(TestResult.java:106) > at junit.framework.TestResult.runProtected(TestResult.java:124) > at junit.framework.TestResult.run(TestResult.java:109) > at junit.framework.TestCase.run(TestCase.java:120) > at junit.framework.TestSuite.runTest(TestSuite.java:230) > at junit.framework.TestSuite.run(TestSuite.java:225) > at > org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) > at > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) > > > > ----------------------------------------------------------------------------------------------------------------------------- > Thank you, > Lakshmi > > > > > On Tue, Feb 16, 2010 at 3:48 PM, Jevon Wright <je...@je...> wrote: > >> Hi Lakshmi, >> >> Can you post the HTML source code of the generated buttons, and the code >> you were trying to use with clickElementByXPath()? >> >> The two libraries you have mentioned are server-side libraries. JWebUnit >> actually navigates the web application from the point of view of a browser, >> using HtmlUnit. It has no idea which server-side technology you are using - >> so for example, you could test JSP, PHP, .Net or even CGI applications with >> it. >> >> Jevon >> >> On Wed, Feb 17, 2010 at 5:13 AM, lakshmi somavaram < >> lso...@gm...> wrote: >> >>> Dear users, >>> >>> I have 4 buttons on a webpage and JwebUnit (clickButtonWithText) >>> recognizes 2 of them and not the other 2. >>> After speaking with developers, I heard that 2 that are recognized were >>> created using struts.apache.org/tags-html tag library >>> The 2 that do not work were created with java.sun.com/jsp/jstl/fmtlibrary >>> >>> I have tried using all the submit() functions as well. I also used, >>> clickElementByXPath. >>> >>> Any idea how this can be resolved? Also, what is used for rendering the >>> pages in JWebUnit? Does theJWebUnit program that renders the webpage use >>> both the libraries that I have mentioned? >>> >>> Any help will be greatly appreciated. >>> >>> Thank you, >>> Lakshmi. >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, >>> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW >>> http://p.sf.net/sfu/solaris-dev2dev >>> _______________________________________________ >>> JWebUnit-users mailing list >>> JWe...@li... >>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>> >>> >> >> >> ------------------------------------------------------------------------------ >> SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, >> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW >> http://p.sf.net/sfu/solaris-dev2dev >> _______________________________________________ >> JWebUnit-users mailing list >> JWe...@li... >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> > > > ------------------------------------------------------------------------------ > SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, > Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW > http://p.sf.net/sfu/solaris-dev2dev > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > |
From: lakshmi s. <lso...@gm...> - 2010-02-17 14:51:16
|
Hi Jevon, *Here is the code for the buttons from view source of web page:* <input type="submit" name="buttonValue" value="Select" class="actionbutton"> <input type="reset" value="Reset" class="actionbutton"> <input type="submit" name="buttonValue" value="Back" class="actionbutton"> <input type="submit" name="org.apache.struts.taglib.html.CANCEL" value="Cancel" onclick="bCancel=true;" class="actionbutton"> *Here is the code for the clickElementByXPath:* clickElementByXPath("//input[@type='submit' and @value='Select']"); clickElementByXPath("//input[@type='submit', @name='buttonValue' and @value='???button.select???']"); *When assert text was used with the wrong text, the page source looked like below:* We can notice below that the buttons with problem are resolved with question marks like ???button.select??? Reset ???button.back??? Cancel ----------------------------------------------------------------------------------------------------------------------------- junit.framework.AssertionFailedError: Expected text not found in current page: [Create New Receivable] Page content was: [National Receipts & Receivables System Farm Service Agency National Receipts & Receivables System Home About USDA Help Contact Us Log Off Program Code Search Results ???label.accounting.program.codes??? ???label.general.name??? ???label.general.description??? checked 01ADDLNINTAPNT ADD'L LOAN INTEREST - PEANUTS, ADD'L unchecked 01APNTSLNT LOAN TRANSFER - PEANUTS, ADD'L ???button.select??? Reset ???button.back??? Cancel NRRS-Web-2.21 | Home | USDA Internet | USDA Intranet | FSA Internet | FSA Intranet | FOIA | Accessibility Statement | Privacy Policy | Non-Discrimination Statement | Information Quality | FirstGov | White House |] at junit.framework.Assert.fail(Assert.java:47) at net.sourceforge.jwebunit.junit.WebTester.assertTextPresent(WebTester.java:442) at net.sourceforge.jwebunit.junit.WebTestCase.assertTextPresent(WebTestCase.java:372) at gov.usda.fsa.tco.test.NRRSExample.testNRRS_EstablishReceivable(NRRSExample.java:231) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:164) at junit.framework.TestCase.runBare(TestCase.java:130) at net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:79) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) ----------------------------------------------------------------------------------------------------------------------------- Thank you, Lakshmi On Tue, Feb 16, 2010 at 3:48 PM, Jevon Wright <je...@je...> wrote: > Hi Lakshmi, > > Can you post the HTML source code of the generated buttons, and the code > you were trying to use with clickElementByXPath()? > > The two libraries you have mentioned are server-side libraries. JWebUnit > actually navigates the web application from the point of view of a browser, > using HtmlUnit. It has no idea which server-side technology you are using - > so for example, you could test JSP, PHP, .Net or even CGI applications with > it. > > Jevon > > On Wed, Feb 17, 2010 at 5:13 AM, lakshmi somavaram <lso...@gm... > > wrote: > >> Dear users, >> >> I have 4 buttons on a webpage and JwebUnit (clickButtonWithText) >> recognizes 2 of them and not the other 2. >> After speaking with developers, I heard that 2 that are recognized were >> created using struts.apache.org/tags-html tag library >> The 2 that do not work were created with java.sun.com/jsp/jstl/fmtlibrary >> >> I have tried using all the submit() functions as well. I also used, >> clickElementByXPath. >> >> Any idea how this can be resolved? Also, what is used for rendering the >> pages in JWebUnit? Does theJWebUnit program that renders the webpage use >> both the libraries that I have mentioned? >> >> Any help will be greatly appreciated. >> >> Thank you, >> Lakshmi. >> >> >> >> >> ------------------------------------------------------------------------------ >> SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, >> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW >> http://p.sf.net/sfu/solaris-dev2dev >> _______________________________________________ >> JWebUnit-users mailing list >> JWe...@li... >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> > > > ------------------------------------------------------------------------------ > SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, > Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW > http://p.sf.net/sfu/solaris-dev2dev > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > |
From: Jevon W. <je...@je...> - 2010-02-16 21:48:27
|
Hi Lakshmi, Can you post the HTML source code of the generated buttons, and the code you were trying to use with clickElementByXPath()? The two libraries you have mentioned are server-side libraries. JWebUnit actually navigates the web application from the point of view of a browser, using HtmlUnit. It has no idea which server-side technology you are using - so for example, you could test JSP, PHP, .Net or even CGI applications with it. Jevon On Wed, Feb 17, 2010 at 5:13 AM, lakshmi somavaram <lso...@gm...>wrote: > Dear users, > > I have 4 buttons on a webpage and JwebUnit (clickButtonWithText) recognizes > 2 of them and not the other 2. > After speaking with developers, I heard that 2 that are recognized were > created using struts.apache.org/tags-html tag library > The 2 that do not work were created with java.sun.com/jsp/jstl/fm tlibrary > > I have tried using all the submit() functions as well. I also used, > clickElementByXPath. > > Any idea how this can be resolved? Also, what is used for rendering the > pages in JWebUnit? Does theJWebUnit program that renders the webpage use > both the libraries that I have mentioned? > > Any help will be greatly appreciated. > > Thank you, > Lakshmi. > > > > > ------------------------------------------------------------------------------ > SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, > Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW > http://p.sf.net/sfu/solaris-dev2dev > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > |
From: Julien H. <he...@ya...> - 2010-02-16 16:52:54
|
Hi, I'm sorry I have no idea of the cause of your issue. Could you please try with latest JWebUnit code from trunk? Perhaps an updated version of HtmlUnit may fix your problem... Regards, Julien > >De : Francisca Todikromo <fra...@gm...> >À : jwe...@li... >Envoyé le : Mar 16 Février 2010, 11 h 59 min 40 s >Objet : [JWebUnit-users] IOException Stream closed at beginAt > >Hi, > >I'm trying to execute a test that opens a https page. >I've set the proxy using the following line: > tester.getTestContext().setProxyAuthorization(null, null, WebTestConstants.PROXY, WebTestConstants.PROXY_PORT); > >But I got a "java.io.IOException: Stream closed" exception. (See stacktrace below). >I've debugged it and found out that at some point JWebUnit closed the stream, and when it returned back to the calling method, it throws the exception. >>Any idea what happened and how to fix it? >I'm using JWebUnit 2.2. > >TIA. > >java.lang.RuntimeException: java.io.IOException: Stream closed > at net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.gotoPage(HtmlUnitTestingEngineImpl.java:244) >> at net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.beginAt(HtmlUnitTestingEngineImpl.java:193) > at net.sourceforge.jwebunit.junit.WebTester.beginAt(WebTester.java:212) > ..... > >Caused by: java.io.IOException: Stream closed >> at java.io.BufferedInputStream.getBufIfOpen(Unknown Source) > at java.io.BufferedInputStream.read(Unknown Source) > at org.apache.commons.httpclient.ContentLengthInputStream.read(ContentLengthInputStream.java:170) >> at java.io.FilterInputStream.read(Unknown Source) > at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:108) > at java.io.FilterInputStream.read(Unknown Source) > at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:127) >> at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1025) > at org.apache.commons.io.IOUtils.copy(IOUtils.java:999) > at org.apache.commons.io.IOUtils.toByteArray(IOUtils.java:218) > at com.gargoylesoftware.htmlunit.WebResponseData.getBody(WebResponseData.java:131) >> at com.gargoylesoftware.htmlunit.WebResponseData.<init>(WebResponseData.java:84) > at com.gargoylesoftware.htmlunit.HttpWebConnection.newWebResponseDataInstance(HttpWebConnection.java:449) > at com.gargoylesoftware.htmlunit.HttpWebConnection.makeWebResponse(HttpWebConnection.java:429) >> at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:100) > at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1430) > at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1388) >> at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:325) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:386) > at net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.gotoPage(HtmlUnitTestingEngineImpl.java:234) >> ... 24 more > > > |
From: lakshmi s. <lso...@gm...> - 2010-02-16 16:36:20
|
Dear users, I have 4 buttons on a webpage and JwebUnit (clickButtonWithText) recognizes 2 of them and not the other 2. After speaking with developers, I heard that 2 that are recognized were created using struts.apache.org/tags-html tag library The 2 that do not work were created with java.sun.com/jsp/jstl/fm tlibrary I have tried using all the submit() functions as well. I also used, clickElementByXPath. Any idea how this can be resolved? Also, what is used for rendering the pages in JWebUnit? Does theJWebUnit program that renders the webpage use both the libraries that I have mentioned? Any help will be greatly appreciated. Thank you, Lakshmi. |
From: Francisca T. <fra...@gm...> - 2010-02-16 10:59:47
|
Hi, I'm trying to execute a test that opens a https page. I've set the proxy using the following line: tester.getTestContext().setProxyAuthorization(null, null, WebTestConstants.PROXY, WebTestConstants.PROXY_PORT); But I got a "java.io.IOException: Stream closed" exception. (See stacktrace below). I've debugged it and found out that at some point JWebUnit closed the stream, and when it returned back to the calling method, it throws the exception. Any idea what happened and how to fix it? I'm using JWebUnit 2.2. TIA. java.lang.RuntimeException: java.io.IOException: Stream closed at net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.gotoPage(HtmlUnitTestingEngineImpl.java:244) at net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.beginAt(HtmlUnitTestingEngineImpl.java:193) at net.sourceforge.jwebunit.junit.WebTester.beginAt(WebTester.java:212) ..... Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getBufIfOpen(Unknown Source) at java.io.BufferedInputStream.read(Unknown Source) at org.apache.commons.httpclient.ContentLengthInputStream.read(ContentLengthInputStream.java:170) at java.io.FilterInputStream.read(Unknown Source) at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:108) at java.io.FilterInputStream.read(Unknown Source) at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:127) at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1025) at org.apache.commons.io.IOUtils.copy(IOUtils.java:999) at org.apache.commons.io.IOUtils.toByteArray(IOUtils.java:218) at com.gargoylesoftware.htmlunit.WebResponseData.getBody(WebResponseData.java:131) at com.gargoylesoftware.htmlunit.WebResponseData.<init>(WebResponseData.java:84) at com.gargoylesoftware.htmlunit.HttpWebConnection.newWebResponseDataInstance(HttpWebConnection.java:449) at com.gargoylesoftware.htmlunit.HttpWebConnection.makeWebResponse(HttpWebConnection.java:429) at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:100) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1430) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1388) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:325) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:386) at net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.gotoPage(HtmlUnitTestingEngineImpl.java:234) ... 24 more |
From: Stand T. <sta...@gm...> - 2010-02-15 20:08:41
|
Thank you, that answers my question...if JWebUnit can't see it, then it can't deal with it, it only makes requests to the server and receives responses that it then parses and implements the code created by tests as if JWebUnit were a browser. Our company is going to require that we have an integrated environment of both front end testing and the ability to set some request attributes so that we can test different scenarios on our pages e.g. we have some login sections that require ldap logins, we can circumvent this by setting a mock request object with mock information and we're needing to test all of those sections where right now a lot of manual work is done. thx for your replies timo On Mon, Feb 15, 2010 at 1:52 PM, Julien HENRY <he...@ya...> wrote: > When you talk about request and attributes are you talking about Java > servlet API? Because JWebUnit is about testing web application from the end > user point of view (emulating a web browser). JWebUnit is not accessing your > server code and consequently is not able to help if you need special > configuration on server side when running your tests. > > > > > >De : Stand Trooper <sta...@gm...> > >À : Usage problems for JWebUnit <jwe...@li...> > >Envoyé le : Lun 15 Février 2010, 20 h 15 min 28 s > >Objet : Re: [JWebUnit-users] Re : Request Objects > > > > > >Thx for the reply. Basically, I need to pass an object I create to the > request as an attribute. Basically, this isn't currently an implementation > within JWebUnit, that I can find. > > > >Is this something that will be coming up on the roadmap for an > implementation? I'd like to be able to use whatever kind of request object > I have (MockHttpServletRequest, easymock, whatever) to do this. Ideally, > I'd like to do this through JWebUnit as it's our primary testing framework > for our frontend testing and not have to outline to developers a 2ndary > route for providing mock requests. Currently, all freemarker work is being > tested with the spring frameworks, and JWebUnit was my first choice for > unified testing of our front end. > > > > > > > >thx > > > >timo > > > > > >On Mon, Feb 15, 2010 at 12:50 PM, Julien HENRY <he...@ya...> wrote: > > > >Hi, > >> > >>There is a similar functionality in HtmlUnit [1]. Therefore it may > require to acces JWebUnit internal code so I don't know if all components > have the needed visibility. > >> > >>Another solution is to use the same mecanism as JWebUnit JUnit tests. You > can load an HTML file or access an embedded web server that will be able to > generate the content your code is expecting. > >> > >>[1] > http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/MockWebConnection.html > >> > >>>>Regards, > >> > >>Julien > >> > >> > >>> > >>>De : Stand Trooper <sta...@gm...> > >>>À : jwe...@li... > >>>Envoyé le : Lun 15 Février 2010, 19 h 30 min 22 s > >>>Objet : [JWebUnit-users] Request Objects > >>> > >>> > >>> > >>>I've tried looking through the documentation and some of the archives > for the mailing list. I'm looking to find out if there's a way to pass in a > MockHttpRequest or some sort of mock request object so I can > >>> test specific portions of the code that require certain elements to be > present. > >>> > >>>Any help would be greatly appreciated. > >>> > >>>thx > >>> > >>>timo > >>> > |
From: Julien H. <he...@ya...> - 2010-02-15 19:53:04
|
When you talk about request and attributes are you talking about Java servlet API? Because JWebUnit is about testing web application from the end user point of view (emulating a web browser). JWebUnit is not accessing your server code and consequently is not able to help if you need special configuration on server side when running your tests. > >De : Stand Trooper <sta...@gm...> >À : Usage problems for JWebUnit <jwe...@li...> >Envoyé le : Lun 15 Février 2010, 20 h 15 min 28 s >Objet : Re: [JWebUnit-users] Re : Request Objects > > >Thx for the reply. Basically, I need to pass an object I create to the request as an attribute. Basically, this isn't currently an implementation within JWebUnit, that I can find. > >Is this something that will be coming up on the roadmap for an implementation? I'd like to be able to use whatever kind of request object I have (MockHttpServletRequest, easymock, whatever) to do this. Ideally, I'd like to do this through JWebUnit as it's our primary testing framework for our frontend testing and not have to outline to developers a 2ndary route for providing mock requests. Currently, all freemarker work is being tested with the spring frameworks, and JWebUnit was my first choice for unified testing of our front end. > > > >thx > >timo > > >On Mon, Feb 15, 2010 at 12:50 PM, Julien HENRY <he...@ya...> wrote: > >Hi, >> >>There is a similar functionality in HtmlUnit [1]. Therefore it may require to acces JWebUnit internal code so I don't know if all components have the needed visibility. >> >>Another solution is to use the same mecanism as JWebUnit JUnit tests. You can load an HTML file or access an embedded web server that will be able to generate the content your code is expecting. >> >>[1] http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/MockWebConnection.html >> >>>>Regards, >> >>Julien >> >> >>> >>>De : Stand Trooper <sta...@gm...> >>>À : jwe...@li... >>>Envoyé le : Lun 15 Février 2010, 19 h 30 min 22 s >>>Objet : [JWebUnit-users] Request Objects >>> >>> >>> >>>I've tried looking through the documentation and some of the archives for the mailing list. I'm looking to find out if there's a way to pass in a MockHttpRequest or some sort of mock request object so I can >>> test specific portions of the code that require certain elements to be present. >>> >>>Any help would be greatly appreciated. >>> >>>thx >>> >>>timo >>> >> >>------------------------------------------------------------------------------ >>>>SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, >>>>Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW >>http://p.sf.net/sfu/solaris-dev2dev >>_______________________________________________ >>>>JWebUnit-users mailing list >>JWe...@li... >>https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> > > |
From: Stand T. <sta...@gm...> - 2010-02-15 19:15:35
|
Thx for the reply. Basically, I need to pass an object I create to the request as an attribute. Basically, this isn't currently an implementation within JWebUnit, that I can find. Is this something that will be coming up on the roadmap for an implementation? I'd like to be able to use whatever kind of request object I have (MockHttpServletRequest, easymock, whatever) to do this. Ideally, I'd like to do this through JWebUnit as it's our primary testing framework for our frontend testing and not have to outline to developers a 2ndary route for providing mock requests. Currently, all freemarker work is being tested with the spring frameworks, and JWebUnit was my first choice for unified testing of our front end. thx timo On Mon, Feb 15, 2010 at 12:50 PM, Julien HENRY <he...@ya...> wrote: > Hi, > > There is a similar functionality in HtmlUnit [1]. Therefore it may require > to acces JWebUnit internal code so I don't know if all components have the > needed visibility. > > Another solution is to use the same mecanism as JWebUnit JUnit tests. You > can load an HTML file or access an embedded web server that will be able to > generate the content your code is expecting. > > [1] > http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/MockWebConnection.html > > Regards, > > Julien > > > *De :* Stand Trooper <sta...@gm...> > *À :* jwe...@li... > *Envoyé le :* Lun 15 Février 2010, 19 h 30 min 22 s > *Objet :* [JWebUnit-users] Request Objects > > I've tried looking through the documentation and some of the archives for > the mailing list. I'm looking to find out if there's a way to pass in a > MockHttpRequest or some sort of mock request object so I can test specific > portions of the code that require certain elements to be present. > > Any help would be greatly appreciated. > > thx > > timo > > > > > ------------------------------------------------------------------------------ > SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, > Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW > http://p.sf.net/sfu/solaris-dev2dev > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > |
From: Julien H. <he...@ya...> - 2010-02-15 18:50:46
|
Hi, There is a similar functionality in HtmlUnit [1]. Therefore it may require to acces JWebUnit internal code so I don't know if all components have the needed visibility. Another solution is to use the same mecanism as JWebUnit JUnit tests. You can load an HTML file or access an embedded web server that will be able to generate the content your code is expecting. [1] http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/MockWebConnection.html Regards, Julien > >De : Stand Trooper <sta...@gm...> >À : jwe...@li... >Envoyé le : Lun 15 Février 2010, 19 h 30 min 22 s >Objet : [JWebUnit-users] Request Objects > > >I've tried looking through the documentation and some of the archives for the mailing list. I'm looking to find out if there's a way to pass in a MockHttpRequest or some sort of mock request object so I can test specific portions of the code that require certain elements to be present. > >Any help would be greatly appreciated. > >thx > >timo > |
From: Stand T. <sta...@gm...> - 2010-02-15 18:30:24
|
I've tried looking through the documentation and some of the archives for the mailing list. I'm looking to find out if there's a way to pass in a MockHttpRequest or some sort of mock request object so I can test specific portions of the code that require certain elements to be present. Any help would be greatly appreciated. thx timo |
From: Julien H. <he...@ya...> - 2010-02-06 19:34:24
|
Hi all JWebUnit users, It seems there is a security issue when using JWebUnit to access malicious web site (see details below). Latest HtmlUnit version seems to be unaffected so I suggest people using JWebUnit to crawl random pages to update to latest JWebUnit from SVN trunk. Regards, Julien ----- Message transféré ---- > De : Matthias -apoc- Hecker <ap...@si...> > À : he...@us... > Envoyé le : Dim 31 Janvier 2010, 21 h 10 min 48 s > Objet : JWebUnit: JavaScript Execution Security Problem > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Dear Julien Henry, > > i'm writing to inform you about a security problem that occurred to me > in jwebunit 2.2. The problem is the possibility to use any java standard > library by arbitrary javascript that is executed by jwebunit. The > following HTML/JS is an example for this: > > < script type="text/javascript" > > var run = java.lang.Runtime.getRuntime(); > run.exec('/usr/bin/xclock'); > < /script > > > This problem is originally by using the Rhino JavaScript library wrong, > without changing the default execution Context, however the library > htmlunit seems not to be affected by this/or is already fixed(tested 2.6). > > I had planned to make this problem public on the 8th February 2010. > Please inform me if you need more time to adress this problem. > > > Yours Sincerely > > Matthias -apoc- Hecker > - -- > (a) (p)roof (o)f (c)oncept .. > http://apoc.sixserv.org/ > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAktl48gACgkQWlhozqFVuMvX5gCfSYm6w0d0BjZxDBKHTGw9kSp8 > ak4AmwTJqXcTOgSGAJ7zWwxP1FkVgB+5 > =Lcgs > -----END PGP SIGNATURE----- |
From: Jevon W. <je...@je...> - 2010-01-11 22:19:44
|
Hi Emerson, Try adding something like this to your Javascript: if (!tinyMCE) alert("tinyMCE has not been loaded yet"); This might help in debugging why your tinyMCE implementation isn't working. If you insert the tiny_mce.js file directly inline your script, does it work then? setExpectedJavaScriptConfirm(String[], boolean[]) checks for expected confirm boxes in the order provided in the array. Are you sure your confirmation boxes are coming up correctly? In Firefox at least, a confirm order A B C will actually appear as C B A in a browser (since they pop over each other), but you will have to specify them as A B C in JWebUnit. Otherwise, try checking the stacktrace of your exception. Hope this helps, Jevon On Mon, Jan 4, 2010 at 11:39 PM, emerson sanchez <es_...@ya...>wrote: > Hi Jevon, > Thanks for your suggestion about the confirm box. Its now working, > thanks to you. I just still can't fix the issue with tinyMce. I tried to > include the ff code at the head section of my jsp to make sure it is defined > before it was loaded but I still got the exception. Please check if what I > did was wrong. > > <head> > <script type="text/javascript" src="/scripts/tinymce/tiny_mce.js"></script> > <script language="javascript" type="text/javascript"> > tinyMCE.init({ > mode : 'textareas', > theme : "advanced", > /*plugins : "advimage",*/ > theme_advanced_buttons1_add_before : "save,separator", > theme_advanced_buttons1_add : "fontselect,fontsizeselect", > theme_advanced_buttons2_add : > "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor", > theme_advanced_buttons2_add_before: > "cut,copy,paste,separator,search,replace,separator", > theme_advanced_buttons3_add_before : "tablecontrols,separator", > theme_advanced_buttons3_add : > "emotions,iespell,flash,advhr,separator,print", > theme_advanced_toolbar_location : "top", > theme_advanced_toolbar_align : "left", > theme_advanced_path_location : "bottom", > plugin_insertdate_dateFormat : "%Y-%m-%d", > plugin_insertdate_timeFormat : "%H:%M:%S", > extended_valid_elements : > "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]", > external_link_list_url : "", > external_image_list_url : "", > flash_external_list_url : "", > }); > </script> > </head> > > I also want to ask another question. How can I set the expected two > consecutive confirm boxes? I tried the method that requires a string array > and a boolean array (setExpectedJavaScriptConfirm(String[], boolean[])) but > it didnt work. I got the same exception as before with this. Can you help me > out a little further? > > Thanks a lot in advance, > Emerson > > > Check me out! <http://www.myspace.com/emersonsanchez> > > --- On *Tue, 22/12/09, Jevon Wright <je...@je...>* wrote: > > > From: Jevon Wright <je...@je...> > Subject: Re: [JWebUnit-users] Issues running JWebUnit test (tinyMce and > javascript Confirm box) > To: "Usage problems for JWebUnit" <jwe...@li...> > Date: Tuesday, 22 December, 2009, 7:35 PM > > > Hi Emerson, > > For your first exception, it looks like it is being thrown when the page is > accessed. It looks like the "tinyMCE" variable is not defined. Can you debug > your script to make sure that it is defined before it is loaded? We use > HtmlUnit natively and it appears this supports TinyMCE without any problems, > so it may be a problem with your setup. > > For your second exception, you need to set the expected prompt _before_ > navigating away from the page: > > setExpectedJavaScriptConfirm("You are about to remove BrandService(s) > from this site. Continue?",true); // before navigating away > > checkCheckbox("selectedBrandServiceIds"); > > clickButtonWithText("Remove"); > > Hope this helps > Jevon > > On Fri, Dec 18, 2009 at 7:01 PM, emerson sanchez <es_...@ya...<http://mc/compose?to=es_...@ya...> > > wrote: > >> Hi, >> I'm having some issues using JWebUnit. I'm using version 2.1. First is, >> I wasn't able to fill in a textarea which implements tinyMce. Although the >> build was successful, it throws an exception and the text I typed wasn't >> saved. Another is that I can't configure JWebUnit to answer yes to a >> javascript confirm box. I have a code that clicks a button which then >> triggers a confirm box. As I checked the mailing list, there are some who >> has the same problem as I mine but AFAIK they didn't find a solution yet. >> Are these issues fixed already that I just can't make my own code work? >> >> Here is the code regarding the textarea issue >> setTextField("h1SearchText", "Configurable H1 Text"); //this is >> the textarea >> >> clickButton("saveH1Search"); //this >> is a submit button >> >> Here is the exception. >> Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "tinyMCE" is >> not defined. (JavaScriptBackgroundJob#1) >> at >> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3558) >> >> at >> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3536) >> >> at >> org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3621) >> at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1653) >> >> at >> org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3413) >> at >> org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484) >> at >> org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164) >> >> at >> org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401) >> at >> com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:170) >> >> at >> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3004) >> at >> org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175) >> >> at >> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$5.doRun(JavaScriptEngine.java:396) >> >> at >> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:522) >> >> --------------------------------------------------------------------------------------------------------------------------------------------------- >> >> Here is the code for the confirm box. >> >> checkCheckbox("selectedBrandServiceIds"); >> >> clickButtonWithText("Remove"); >> setExpectedJavaScriptConfirm("You are about to remove BrandService(s) from >> this site. Continue?",true); >> >> Exception: >> Tests run: 12, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 56.734 >> sec <<< FAILURE! >> testRemoveBrandServiceFromSite(com.voxsant.pcs.jwebunit.WebTest) Time >> elapsed: 7.704 sec <<< ERROR! >> java.lang.RuntimeException: com.gargoylesoftware.htmlunit.ScriptException: >> Wrapped >> net.sourceforge.jwebunit.exception.UnexpectedJavascriptConfirmException: A >> unexpected confirm with message [You are about to remove BrandService(s) >> from this site. Continue?] was displayed (script in >> http://localhost:8080/edit-site.html?id=1 from (471, 32) to (668, >> 10)#532) >> at >> net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.clickButtonWithText(HtmlUnitTestingEngineImpl.java:1886) >> >> at >> net.sourceforge.jwebunit.junit.WebTester.clickButtonWithText(WebTester.java:2530) >> >> at >> net.sourceforge.jwebunit.junit.WebTestCase.clickButtonWithText(WebTestCase.java:2029) >> >> at >> com.voxsant.pcs.jwebunit.WebTest.testRemoveBrandServiceFromSite(WebTest.java:551) >> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> >> at java.lang.reflect.Method.invoke(Method.java:597) >> at junit.framework.TestCase.runTest(TestCase.java:168) >> at junit.framework.TestCase.runBare(TestCase.java:134) >> at >> net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:79) >> at junit.framework.TestResult$1.protect(TestResult.java:110) >> at junit.framework.TestResult.runProtected(TestResult.java:128) >> at junit.framework.TestResult.run(TestResult.java:113) >> at junit.framework.TestCase.run(TestCase.java:124) >> at junit.framework.TestSuite.runTest(TestSuite.java:232) >> at junit.framework.TestSuite.run(TestSuite.java:227) >> at >> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81) >> >> at >> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) >> >> at >> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) >> >> at >> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) >> >> at org.apache.maven.surefire.Surefire.run(Surefire.java:177) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> >> at java.lang.reflect.Method.invoke(Method.java:597) >> at >> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345) >> >> at >> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009) >> >> Caused by: com.gargoylesoftware.htmlunit.ScriptException: Wrapped >> net.sourceforge.jwebunit.exception.UnexpectedJavascriptConfirmException: A >> unexpected confirm with message [You are about to remove BrandService(s) >> from this site. Continue?] was displayed (script in >> http://localhost:8080/edit-site.html?id=1 from (471, 32) to (668, >> 10)#532) >> at >> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:528) >> >> at org.mozilla.javascript.Context.call(Context.java:502) >> at >> org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511) >> at >> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:437) >> >> at >> com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:917) >> >> at >> com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventHandler(EventListenersContainer.java:143) >> >> at >> com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:156) >> >> at >> com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:550) >> at >> com.gargoylesoftware.htmlunit.html.HtmlElement$2.run(HtmlElement.java:1251) >> at org.mozilla.javascript.Context.call(Context.java:502) >> at >> org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511) >> at >> com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:1255) >> >> at >> com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:136) >> >> at >> com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:107) >> >> at >> com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:76) >> >> at >> net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.clickButtonWithText(HtmlUnitTestingEngineImpl.java:1884) >> >> ... 27 more >> Caused by: org.mozilla.javascript.WrappedException: Wrapped >> net.sourceforge.jwebunit.exception.UnexpectedJavascriptConfirmException: A >> unexpected confirm with message [You are about to remove BrandService(s) >> from this site. Continue?] was displayed (script in >> http://localhost:8080/edit-site.html?id=1 from (471, 32) to (668, >> 10)#532) >> at >> org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1657) >> at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:176) >> at >> org.mozilla.javascript.FunctionObject.call(FunctionObject.java:478) >> at >> org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3335) >> at >> org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484) >> at >> org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164) >> >> at >> org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401) >> at >> com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:170) >> >> at >> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3004) >> at >> org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162) >> >> at >> com.gargoylesoftware.htmlunit.javascript.host.EventHandler.call(EventHandler.java:78) >> >> at >> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:465) >> >> at >> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:430) >> >> at >> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:522) >> >> ... 42 more >> Caused by: >> net.sourceforge.jwebunit.exception.UnexpectedJavascriptConfirmException: A >> unexpected confirm with message [You are about to remove BrandService(s) >> from this site. Continue?] was displayed >> at >> net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl$3.handleConfirm(HtmlUnitTestingEngineImpl.java:830) >> >> at >> com.gargoylesoftware.htmlunit.javascript.host.Window.jsxFunction_confirm(Window.java:168) >> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> >> at java.lang.reflect.Method.invoke(Method.java:597) >> at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161) >> ... 54 more >> >> >> Thanks, >> Emerson >> >> >> >> >> Check me out! <http://www.myspace.com/emersonsanchez> >> ------------------------------ >> Get your new Email address! >> <http://sg.rd.yahoo.com/aa/mail/domainchoice/mail/signature/*http://mail.promotions.yahoo.com/newdomains/aa/> >> Grab the Email name you've always wanted before someone else does! >> >> ------------------------------------------------------------------------------ >> This SF.Net email is sponsored by the Verizon Developer Community >> Take advantage of Verizon's best-in-class app development support >> A streamlined, 14 day to market process makes app distribution fast and >> easy >> Join now and get one step closer to millions of Verizon customers >> http://p.sf.net/sfu/verizon-dev2dev >> _______________________________________________ >> JWebUnit-users mailing list >> JWe...@li...<http://mc/compose?to=JWe...@li...> >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> > > -----Inline Attachment Follows----- > > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and > easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > > -----Inline Attachment Follows----- > > > _______________________________________________ > JWebUnit-users mailing list > JWe...@li...<http://mc/compose?to=JWe...@li...> > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > > ------------------------------ > Get your preferred Email name! > <http://sg.rd.yahoo.com/aa/mail/domainchoice/mail/signature/*http://mail.promotions.yahoo.com/newdomains/aa/> > Now you can @ymail.com and @rocketmail.com. > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and > easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > |