jwebunit-users Mailing List for JWebUnit (Page 9)
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: Xhenseval, B. <ben...@cr...> - 2010-04-22 13:25:33
|
Hi Like my little "spider" test, is there an easy mechanism to check that all pages are following the document type? Eg. XHTML. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> So I guess some kind of offline validation (http://validator.w3.org/) would be useful to detect as part of our build... As soon as our webmaster starts to get too 'fancy' this would be detected... Thanks, Benoît Xhenseval Project Escape =============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html =============================================================================== |
From: Jevon W. <je...@je...> - 2010-04-22 00:13:01
|
Hi Chinna, That looks like a "basic authentication" dialog box - search for this and you should be able to find some documentation to help :) Cheers Jevon On Thu, Apr 22, 2010 at 8:07 AM, nithin aaaaaa <chi...@gm...>wrote: > Hi, > > I am trying to write a jwebunit test for one of my intranet application.It > has a popup which opens as soon as I enter the URL for the intranet > application in which I need to enter the intranet username and password and > click login which redirects back to my application and then I can move on.I > am not getting a way around to cross the intial entering > of the username and password on the popup window. > > Can you please post me some sample code which can help me out. > > > I have attached the popwindow which comes in my way > > > Thanks in advance for taking your time. > > > Thanks > Chinna > > > > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > |
From: Jevon W. <je...@je...> - 2010-04-22 00:11:11
|
Those results sound great. Thanks for sharing :-) I've never had JWebUnit print out those debug messages for me - but it looks like it is a log4j setting for HtmlUnit. The only debug messages I get printed out are when I enable the NicelySynchronizingAjaxController. Cheers Jevon On Wed, Apr 21, 2010 at 9:12 PM, Xhenseval, Benoit < ben...@cr...> wrote: > Given that everything is in memory for that test (including the DB -> > HSQLDB), it is pretty fast. > We have < 100 different pages and that takes ~2 min. > If I do every possibilities (including the parameters), ~50,000 pages and > ~15 min which is no problem for a regular CI build. > > By the way.... how could I STOP the debug from logging everything? I am > sure it is something that I should do in log4j.xml but so far, I have not > managed... > > Things like this: > > 2010-04-20 14:40:14,591 DEBUG [wire.header#?] (main:) >> "GET > /escape/indexData.html?id=.dMIBE00000PEU HTTP/1.1[\r][\n]" > ... > 2010-04-20 14:40:14,607 DEBUG [wire.content#?] (main:) << "<?xml > version="1.0" encoding="UTF-8" ?>[\r][\n]" > Thanks, > > Benoit. > > ------------------------------ > *From:* Jevon Wright [mailto:je...@je...] > *Sent:* 21 April 2010 10:04 > > *To:* Usage problems for JWebUnit > *Subject:* Re: [JWebUnit-users] How to get all links in current page > > Ah I see what you mean - yes, that's quite a useful check :-) Of course, > this only checks pages accessible through explicit <a> links, not with any > content provided through forms, etc. Thanks for sharing your code. > > How long does it take to run across your site? > > Cheers > Jevon > > On Wed, Apr 21, 2010 at 9:00 PM, Xhenseval, Benoit < > ben...@cr...> wrote: > >> Hi Jevon, >> >> Yes I was hoping to simply check every links of an application whislt >> running integration tests with Maven. The aim is to quickly check that >> there are no exceptions thrown. >> >> I have come up with the following code, which may be useful to others: >> >> private boolean useDiffPagesOnly = true; // only visit a page once, i.e. >> not for different parameters >> >> public void testSpider() { >> final Set<String> identifiedLinks = Sets.newHashSet(); >> final Stack<String> toVisit = new Stack<String>(); >> final String base = "http://localhost:" + getPort(); >> >> final String startPage = "/index.html"; >> identifiedLinks.add(startPage); >> toVisit.push(startPage); >> >> int count = 0; >> // do not check links that CONTAIN the following strings >> final HashSet<String> forbidden = Sets.newHashSet("delete", >> "inventorySummaries.html" >> while (!toVisit.isEmpty()) { >> count++; >> gotoPage(toVisit.pop()); >> grabLinksInPage(identifiedLinks, toVisit, base, forbidden); >> } >> } >> >> private void grabLinksInPage(final Set<String> identifiedLinks, final >> Stack<String> toVisit, final String base, final Set<String> avoid) { >> final List<IElement> elementsByXPath = getElementsByXPath("//a"); >> >> for (final IElement ie : elementsByXPath) { >> final String href = ie.getAttribute("href"); >> >> final String linkForDup = useDiffPagesOnly && href.indexOf("?") > 0 ? >> href.substring(0, href.indexOf("?")) : href; >> >> if (StringUtils.isNotBlank(href) && (href.startsWith(base) || >> !href.startsWith("http://")) && !identifiedLinks.contains(linkForDup)) { >> boolean shouldInclude = true; >> >> for (final String toAvoid : avoid) { >> if (href.contains(toAvoid)) { >> shouldInclude = false; >> break; >> } >> } >> >> identifiedLinks.add(linkForDup); >> if (shouldInclude) { >> toVisit.push(href); >> } >> } >> } >> } >> Benoit >> >> >> ------------------------------ >> *From:* Jevon Wright [mailto:je...@je...] >> *Sent:* 21 April 2010 00:16 >> *To:* Usage problems for JWebUnit >> *Subject:* Re: [JWebUnit-users] How to get all links in current page >> >> Hi Benoit, >> >> Interesting question - I am sure you could do something like that with >> JWebUnit (through xpath, etc), but I imagine using a piece of software >> developed specifically for dumping a site would be better, unless you want >> to verify some unit tests across an entire site? >> >> Software like wget comes to mind. >> >> Cheers >> Jevon >> >> On Tue, Apr 20, 2010 at 10:44 PM, Xhenseval, Benoit < >> ben...@cr...> wrote: >> >>> Hi All >>> >>> I'm new to JWebUnit. >>> >>> I'm trying to develop the most obvious check... A spider that would >>> follow all links within a given domain. >>> >>> Is there support for such a thing? >>> >>> If not, how could I get all links from a given page? >>> >>> I'm not using Selenium. >>> >>> Thanks a lot >>> >>> Benoit >>> >>> >>> =============================================================================== >>> Please access the attached hyperlink for an important electronic >>> communications disclaimer: >>> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html >>> >>> =============================================================================== >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> 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 >>> >> >> >> >> ============================================================================== >> Please access the attached hyperlink for an important electronic >> communications disclaimer: >> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html >> >> ============================================================================== >> >> >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> JWebUnit-users mailing list >> JWe...@li... >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> > > > ============================================================================== > Please access the attached hyperlink for an important electronic > communications disclaimer: > http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html > > ============================================================================== > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > |
From: Xhenseval, B. <ben...@cr...> - 2010-04-21 09:12:40
|
Given that everything is in memory for that test (including the DB -> HSQLDB), it is pretty fast. We have < 100 different pages and that takes ~2 min. If I do every possibilities (including the parameters), ~50,000 pages and ~15 min which is no problem for a regular CI build. By the way.... how could I STOP the debug from logging everything? I am sure it is something that I should do in log4j.xml but so far, I have not managed... Things like this: 2010-04-20 14:40:14,591 DEBUG [wire.header#?] (main:) >> "GET /escape/indexData.html?id=.dMIBE00000PEU HTTP/1.1[\r][\n]" ... 2010-04-20 14:40:14,607 DEBUG [wire.content#?] (main:) << "<?xml version="1.0" encoding="UTF-8" ?>[\r][\n]" Thanks, Benoit. ________________________________ From: Jevon Wright [mailto:je...@je...] Sent: 21 April 2010 10:04 To: Usage problems for JWebUnit Subject: Re: [JWebUnit-users] How to get all links in current page Ah I see what you mean - yes, that's quite a useful check :-) Of course, this only checks pages accessible through explicit <a> links, not with any content provided through forms, etc. Thanks for sharing your code. How long does it take to run across your site? Cheers Jevon On Wed, Apr 21, 2010 at 9:00 PM, Xhenseval, Benoit <ben...@cr...> wrote: Hi Jevon, Yes I was hoping to simply check every links of an application whislt running integration tests with Maven. The aim is to quickly check that there are no exceptions thrown. I have come up with the following code, which may be useful to others: private boolean useDiffPagesOnly = true; // only visit a page once, i.e. not for different parameters public void testSpider() { final Set<String> identifiedLinks = Sets.newHashSet(); final Stack<String> toVisit = new Stack<String>(); final String base = "http://localhost <http://localhost> :" + getPort(); final String startPage = "/index.html"; identifiedLinks.add(startPage); toVisit.push(startPage); int count = 0; // do not check links that CONTAIN the following strings final HashSet<String> forbidden = Sets.newHashSet("delete", "inventorySummaries.html" while (!toVisit.isEmpty()) { count++; gotoPage(toVisit.pop()); grabLinksInPage(identifiedLinks, toVisit, base, forbidden); } } private void grabLinksInPage(final Set<String> identifiedLinks, final Stack<String> toVisit, final String base, final Set<String> avoid) { final List<IElement> elementsByXPath = getElementsByXPath("//a"); for (final IElement ie : elementsByXPath) { final String href = ie.getAttribute("href"); final String linkForDup = useDiffPagesOnly && href.indexOf("?") > 0 ? href.substring(0, href.indexOf("?")) : href; if (StringUtils.isNotBlank(href) && (href.startsWith(base) || !href.startsWith("http://")) && !identifiedLinks.contains(linkForDup)) { boolean shouldInclude = true; for (final String toAvoid : avoid) { if (href.contains(toAvoid)) { shouldInclude = false; break; } } identifiedLinks.add(linkForDup); if (shouldInclude) { toVisit.push(href); } } } } Benoit ________________________________ From: Jevon Wright [mailto:je...@je...] Sent: 21 April 2010 00:16 To: Usage problems for JWebUnit Subject: Re: [JWebUnit-users] How to get all links in current page Hi Benoit, Interesting question - I am sure you could do something like that with JWebUnit (through xpath, etc), but I imagine using a piece of software developed specifically for dumping a site would be better, unless you want to verify some unit tests across an entire site? Software like wget comes to mind. Cheers Jevon On Tue, Apr 20, 2010 at 10:44 PM, Xhenseval, Benoit <ben...@cr...> wrote: Hi All I'm new to JWebUnit. I'm trying to develop the most obvious check... A spider that would follow all links within a given domain. Is there support for such a thing? If not, how could I get all links from a given page? I'm not using Selenium. Thanks a lot Benoit ======================================================================== ======= Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ======================================================================== ======= ------------------------------------------------------------------------ ------ 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 ======================================================================== ====== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ======================================================================== ====== ------------------------------------------------------------------------ ------ _______________________________________________ JWebUnit-users mailing list JWe...@li... https://lists.sourceforge.net/lists/listinfo/jwebunit-users =============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html =============================================================================== |
From: Jevon W. <je...@je...> - 2010-04-21 09:04:34
|
Ah I see what you mean - yes, that's quite a useful check :-) Of course, this only checks pages accessible through explicit <a> links, not with any content provided through forms, etc. Thanks for sharing your code. How long does it take to run across your site? Cheers Jevon On Wed, Apr 21, 2010 at 9:00 PM, Xhenseval, Benoit < ben...@cr...> wrote: > Hi Jevon, > > Yes I was hoping to simply check every links of an application whislt > running integration tests with Maven. The aim is to quickly check that > there are no exceptions thrown. > > I have come up with the following code, which may be useful to others: > > private boolean useDiffPagesOnly = true; // only visit a page once, i.e. > not for different parameters > > public void testSpider() { > final Set<String> identifiedLinks = Sets.newHashSet(); > final Stack<String> toVisit = new Stack<String>(); > final String base = "http://localhost:" + getPort(); > > final String startPage = "/index.html"; > identifiedLinks.add(startPage); > toVisit.push(startPage); > > int count = 0; > // do not check links that CONTAIN the following strings > final HashSet<String> forbidden = Sets.newHashSet("delete", > "inventorySummaries.html" > while (!toVisit.isEmpty()) { > count++; > gotoPage(toVisit.pop()); > grabLinksInPage(identifiedLinks, toVisit, base, forbidden); > } > } > > private void grabLinksInPage(final Set<String> identifiedLinks, final > Stack<String> toVisit, final String base, final Set<String> avoid) { > final List<IElement> elementsByXPath = getElementsByXPath("//a"); > > for (final IElement ie : elementsByXPath) { > final String href = ie.getAttribute("href"); > > final String linkForDup = useDiffPagesOnly && href.indexOf("?") > 0 ? > href.substring(0, href.indexOf("?")) : href; > > if (StringUtils.isNotBlank(href) && (href.startsWith(base) || > !href.startsWith("http://")) && !identifiedLinks.contains(linkForDup)) { > boolean shouldInclude = true; > > for (final String toAvoid : avoid) { > if (href.contains(toAvoid)) { > shouldInclude = false; > break; > } > } > > identifiedLinks.add(linkForDup); > if (shouldInclude) { > toVisit.push(href); > } > } > } > } > Benoit > > > ------------------------------ > *From:* Jevon Wright [mailto:je...@je...] > *Sent:* 21 April 2010 00:16 > *To:* Usage problems for JWebUnit > *Subject:* Re: [JWebUnit-users] How to get all links in current page > > Hi Benoit, > > Interesting question - I am sure you could do something like that with > JWebUnit (through xpath, etc), but I imagine using a piece of software > developed specifically for dumping a site would be better, unless you want > to verify some unit tests across an entire site? > > Software like wget comes to mind. > > Cheers > Jevon > > On Tue, Apr 20, 2010 at 10:44 PM, Xhenseval, Benoit < > ben...@cr...> wrote: > >> Hi All >> >> I'm new to JWebUnit. >> >> I'm trying to develop the most obvious check... A spider that would >> follow all links within a given domain. >> >> Is there support for such a thing? >> >> If not, how could I get all links from a given page? >> >> I'm not using Selenium. >> >> Thanks a lot >> >> Benoit >> >> >> =============================================================================== >> Please access the attached hyperlink for an important electronic >> communications disclaimer: >> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html >> >> =============================================================================== >> >> >> >> ------------------------------------------------------------------------------ >> 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 >> > > > > ============================================================================== > Please access the attached hyperlink for an important electronic > communications disclaimer: > http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html > > ============================================================================== > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > |
From: Xhenseval, B. <ben...@cr...> - 2010-04-21 09:01:07
|
Hi Jevon, Yes I was hoping to simply check every links of an application whislt running integration tests with Maven. The aim is to quickly check that there are no exceptions thrown. I have come up with the following code, which may be useful to others: private boolean useDiffPagesOnly = true; // only visit a page once, i.e. not for different parameters public void testSpider() { final Set<String> identifiedLinks = Sets.newHashSet(); final Stack<String> toVisit = new Stack<String>(); final String base = "http://localhost <http://localhost> :" + getPort(); final String startPage = "/index.html"; identifiedLinks.add(startPage); toVisit.push(startPage); int count = 0; // do not check links that CONTAIN the following strings final HashSet<String> forbidden = Sets.newHashSet("delete", "inventorySummaries.html" while (!toVisit.isEmpty()) { count++; gotoPage(toVisit.pop()); grabLinksInPage(identifiedLinks, toVisit, base, forbidden); } } private void grabLinksInPage(final Set<String> identifiedLinks, final Stack<String> toVisit, final String base, final Set<String> avoid) { final List<IElement> elementsByXPath = getElementsByXPath("//a"); for (final IElement ie : elementsByXPath) { final String href = ie.getAttribute("href"); final String linkForDup = useDiffPagesOnly && href.indexOf("?") > 0 ? href.substring(0, href.indexOf("?")) : href; if (StringUtils.isNotBlank(href) && (href.startsWith(base) || !href.startsWith("http://")) && !identifiedLinks.contains(linkForDup)) { boolean shouldInclude = true; for (final String toAvoid : avoid) { if (href.contains(toAvoid)) { shouldInclude = false; break; } } identifiedLinks.add(linkForDup); if (shouldInclude) { toVisit.push(href); } } } } Benoit ________________________________ From: Jevon Wright [mailto:je...@je...] Sent: 21 April 2010 00:16 To: Usage problems for JWebUnit Subject: Re: [JWebUnit-users] How to get all links in current page Hi Benoit, Interesting question - I am sure you could do something like that with JWebUnit (through xpath, etc), but I imagine using a piece of software developed specifically for dumping a site would be better, unless you want to verify some unit tests across an entire site? Software like wget comes to mind. Cheers Jevon On Tue, Apr 20, 2010 at 10:44 PM, Xhenseval, Benoit <ben...@cr...> wrote: Hi All I'm new to JWebUnit. I'm trying to develop the most obvious check... A spider that would follow all links within a given domain. Is there support for such a thing? If not, how could I get all links from a given page? I'm not using Selenium. Thanks a lot Benoit ======================================================================== ======= Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ======================================================================== ======= ------------------------------------------------------------------------ ------ 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 =============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html =============================================================================== |
From: Jevon W. <je...@je...> - 2010-04-20 23:16:39
|
Hi Benoit, Interesting question - I am sure you could do something like that with JWebUnit (through xpath, etc), but I imagine using a piece of software developed specifically for dumping a site would be better, unless you want to verify some unit tests across an entire site? Software like wget comes to mind. Cheers Jevon On Tue, Apr 20, 2010 at 10:44 PM, Xhenseval, Benoit < ben...@cr...> wrote: > Hi All > > I'm new to JWebUnit. > > I'm trying to develop the most obvious check... A spider that would > follow all links within a given domain. > > Is there support for such a thing? > > If not, how could I get all links from a given page? > > I'm not using Selenium. > > Thanks a lot > > Benoit > > > =============================================================================== > Please access the attached hyperlink for an important electronic > communications disclaimer: > http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html > > =============================================================================== > > > > ------------------------------------------------------------------------------ > 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: Xhenseval, B. <ben...@cr...> - 2010-04-20 10:44:44
|
Hi All I'm new to JWebUnit. I'm trying to develop the most obvious check... A spider that would follow all links within a given domain. Is there support for such a thing? If not, how could I get all links from a given page? I'm not using Selenium. Thanks a lot Benoit =============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html =============================================================================== |
From: lakshmi s. <lso...@gm...> - 2010-04-13 16:14:10
|
Thank you! Eric. I also used setScriptingEnabled() api and it worked for me. I will try the browser version. Thank you, Lakshmi On Mon, Apr 12, 2010 at 2:40 PM, Eric Jelinek <eje...@ho...> wrote: > Lakshmi, > > > > I use the HTMLUnit testing engine and something you might try is creating a > WebClient and during the instantiation you set the browser > > > > WebClient client = new WebClient(BrowserVersion.FIREFOX_3); > > > http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/WebClient.html > > > > As for your javascript, I too have issues with it where I cannot control or > change the js in the app, so I use setScriptingEnabled(false); > > http://jwebunit.sourceforge.net/faq.html#javascript-errors > > > > Good Luck > > Eric > > > > > > *From:* lakshmi somavaram [mailto:lso...@gm...] > *Sent:* Wednesday, March 17, 2010 3:48 PM > *To:* Usage problems for JWebUnit > *Subject:* [JWebUnit-users] Browser problems > > > > Dear Users, > > > > Could you please let me know what is the default browser of JWebUnit? Also, > what API's can I use to change the Browser version? > > > > I am getting some Java Script errors, so I want to be able to try with > different version of browser. > > > > Thank you, > > Lakshmi > > > ------------------------------------------------------------------------------ > 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-04-13 12:45:41
|
Jevon, Would it be preferable to use setThrowExceptionOnScriptError vs setScriptingEnabled? Also I didn't see setThrowExceptionOnScriptError in the api doc, I do see it in HtmlUnit. Eric From: Jevon Wright [mailto:je...@je...] Sent: Monday, April 12, 2010 4:06 PM To: Usage problems for JWebUnit Subject: Re: [JWebUnit-users] Browser problems Hi, For some of my tests I need to use the Google Maps API which throws syntax errors, so I need to disable throwing exceptions on syntax errors: HtmlUnitTestingEngineImpl engine = (HtmlUnitTestingEngineImpl) getTestingEngine(); engine.setThrowExceptionOnScriptError(false); You should only use this sparingly though, to try and catch syntax errors in your own scripts. Cheers Jevon On Tue, Apr 13, 2010 at 7:40 AM, Eric Jelinek <eje...@ho...<mailto:eje...@ho...>> wrote: Lakshmi, I use the HTMLUnit testing engine and something you might try is creating a WebClient and during the instantiation you set the browser WebClient client = new WebClient(BrowserVersion.FIREFOX_3); http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/WebClient.html As for your javascript, I too have issues with it where I cannot control or change the js in the app, so I use setScriptingEnabled(false); http://jwebunit.sourceforge.net/faq.html#javascript-errors Good Luck Eric From: lakshmi somavaram [mailto:lso...@gm...<mailto:lso...@gm...>] Sent: Wednesday, March 17, 2010 3:48 PM To: Usage problems for JWebUnit Subject: [JWebUnit-users] Browser problems Dear Users, Could you please let me know what is the default browser of JWebUnit? Also, what API's can I use to change the Browser version? I am getting some Java Script errors, so I want to be able to try with different version of browser. Thank you, Lakshmi ------------------------------------------------------------------------------ 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 |
From: Jevon W. <je...@je...> - 2010-04-12 21:06:22
|
Hi, For some of my tests I need to use the Google Maps API which throws syntax errors, so I need to disable throwing exceptions on syntax errors: HtmlUnitTestingEngineImpl engine = (HtmlUnitTestingEngineImpl) getTestingEngine(); engine.setThrowExceptionOnScriptError(false); You should only use this sparingly though, to try and catch syntax errors in your own scripts. Cheers Jevon On Tue, Apr 13, 2010 at 7:40 AM, Eric Jelinek <eje...@ho...> wrote: > Lakshmi, > > > > I use the HTMLUnit testing engine and something you might try is creating a > WebClient and during the instantiation you set the browser > > > > WebClient client = new WebClient(BrowserVersion.FIREFOX_3); > > > http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/WebClient.html > > > > As for your javascript, I too have issues with it where I cannot control or > change the js in the app, so I use setScriptingEnabled(false); > > http://jwebunit.sourceforge.net/faq.html#javascript-errors > > > > Good Luck > > Eric > > > > > > *From:* lakshmi somavaram [mailto:lso...@gm...] > *Sent:* Wednesday, March 17, 2010 3:48 PM > *To:* Usage problems for JWebUnit > *Subject:* [JWebUnit-users] Browser problems > > > > Dear Users, > > > > Could you please let me know what is the default browser of JWebUnit? Also, > what API's can I use to change the Browser version? > > > > I am getting some Java Script errors, so I want to be able to try with > different version of browser. > > > > Thank you, > > Lakshmi > > > ------------------------------------------------------------------------------ > 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-04-12 20:14:13
|
Lakshmi, I use the HTMLUnit testing engine and something you might try is creating a WebClient and during the instantiation you set the browser WebClient client = new WebClient(BrowserVersion.FIREFOX_3); http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/WebClient.html As for your javascript, I too have issues with it where I cannot control or change the js in the app, so I use setScriptingEnabled(false); http://jwebunit.sourceforge.net/faq.html#javascript-errors Good Luck Eric From: lakshmi somavaram [mailto:lso...@gm...] Sent: Wednesday, March 17, 2010 3:48 PM To: Usage problems for JWebUnit Subject: [JWebUnit-users] Browser problems Dear Users, Could you please let me know what is the default browser of JWebUnit? Also, what API's can I use to change the Browser version? I am getting some Java Script errors, so I want to be able to try with different version of browser. Thank you, Lakshmi |
From: Jevon W. <je...@je...> - 2010-03-22 08:56:58
|
Hi Dave, One-line support for the NicelyResynchronizingAjaxController() is in progress, but in the meantime you can use the code at: http://sourceforge.net/tracker/?func=detail&aid=2697234&group_id=61302&atid=497985 However, if you are having problems with Javascript on the page executing before the entire page is loaded, I would recommend putting this script into an onload="..." handler on the page, since surely browsers would suffer the same problem. Jevon On Fri, Mar 19, 2010 at 5:38 AM, dave smolin <das...@gm...> wrote: > I've also run into some timing problems when testing for dynamically update > data in a webpage. Sleeping for 1 second or more usually solves this > problem, but it's ugly. I noticed htmlunit implemented some neat new > features, namely the > webClient.setAjaxController(new NicelyResynchronizingAjaxController()); > webClient.waitForBackgroundJavaScript(10000); > webClient.waitForBackgroundJavaScriptStartingBefore(10000); > > calls. Any plans to integrate this support? > > > ------------------------------------------------------------------------------ > 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: dave s. <das...@gm...> - 2010-03-18 16:38:58
|
I've also run into some timing problems when testing for dynamically update data in a webpage. Sleeping for 1 second or more usually solves this problem, but it's ugly. I noticed htmlunit implemented some neat new features, namely the webClient.setAjaxController(new NicelyResynchronizingAjaxController()); webClient.waitForBackgroundJavaScript(10000); webClient.waitForBackgroundJavaScriptStartingBefore(10000); calls. Any plans to integrate this support? |
From: lakshmi s. <lso...@gm...> - 2010-03-17 20:48:29
|
Dear Users, Could you please let me know what is the default browser of JWebUnit? Also, what API's can I use to change the Browser version? I am getting some Java Script errors, so I want to be able to try with different version of browser. Thank you, Lakshmi |
From: lakshmi s. <lso...@gm...> - 2010-03-10 15:21:28
|
Hi Jevon, The following code worked for me by using start-with and contains in the XPath. Thought I will post it here as it might be useful for someone. Thank you! Lakshmi assertElementPresentByXPath("//a[starts-with(@href, ' http://www.company.com/wps/portal/!ut/p/_s.7_0_A/7_0_1OB?') and contains (@href, 'navid=FOIA')]"); clickElementByXPath("//a[starts-with(@href, ' http://www.company.com/wps/portal/!ut/p/_s.7_0_A/7_0_1OB?') and contains (@href, 'navid=FOIA')]"); On Tue, Mar 9, 2010 at 4:05 PM, Jevon Wright <je...@je...> wrote: > Hi, > > Sounds like the XPath is not correct. You could check with > getElementByXPath() which will throw additional exception information if > necessary. Special characters such as & may need to be escaped. > > Since you are checking for a URL, the URL may often change so this may not > be the best approach. It may be best to search for <a> by ID. > > Jevon > > On Wed, Mar 10, 2010 at 5:27 AM, lakshmi somavaram <lso...@gm... > > wrote: > >> Dear Users, >> >> I have trouble using assertElementByXPath for the following link. JWebUnit >> says unable to find element. >> >> Please let me know how to handle the special characters in XPath. >> >> *HTML code:* >> ** >> <a href=" >> http://www.company.com/wps/portal/!ut/p/_s.7_0_A/7_0_1OB?navtype=FT&navid=FOIA<http://www.company.com/wps/portal/%21ut/p/_s.7_0_A/7_0_1OB?navtype=FT&navid=FOIA> >> ">FOIA</a> >> >> *Jwebunit code:* >> >> assertElementPresentByXPath("//a[*@href*=' >> http://www.company.com/wps/portal/!ut/p/_s.7_0_A/7_0_1OB?navtype=FT&navid=FOIA'<http://www.company.com/wps/portal/%21ut/p/_s.7_0_A/7_0_1OB?navtype=FT&navid=FOIA%27> >> ]"); >> >> Thank you, >> >> Lakshmi >> >> >> >> >> ------------------------------------------------------------------------------ >> 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: Jevon W. <je...@je...> - 2010-03-09 22:05:03
|
Hi, Sounds like the XPath is not correct. You could check with getElementByXPath() which will throw additional exception information if necessary. Special characters such as & may need to be escaped. Since you are checking for a URL, the URL may often change so this may not be the best approach. It may be best to search for <a> by ID. Jevon On Wed, Mar 10, 2010 at 5:27 AM, lakshmi somavaram <lso...@gm...>wrote: > Dear Users, > > I have trouble using assertElementByXPath for the following link. JWebUnit > says unable to find element. > > Please let me know how to handle the special characters in XPath. > > *HTML code:* > ** > <a href=" > http://www.company.com/wps/portal/!ut/p/_s.7_0_A/7_0_1OB?navtype=FT&navid=FOIA<http://www.company.com/wps/portal/%21ut/p/_s.7_0_A/7_0_1OB?navtype=FT&navid=FOIA> > ">FOIA</a> > > *Jwebunit code:* > > assertElementPresentByXPath("//a[*@href*=' > http://www.company.com/wps/portal/!ut/p/_s.7_0_A/7_0_1OB?navtype=FT&navid=FOIA'<http://www.company.com/wps/portal/%21ut/p/_s.7_0_A/7_0_1OB?navtype=FT&navid=FOIA%27> > ]"); > > Thank you, > > Lakshmi > > > > > ------------------------------------------------------------------------------ > 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-03-09 16:28:05
|
Dear Users, I have trouble using assertElementByXPath for the following link. JWebUnit says unable to find element. Please let me know how to handle the special characters in XPath. *HTML code:* ** <a href=" http://www.company.com/wps/portal/!ut/p/_s.7_0_A/7_0_1OB?navtype=FT&navid=FOIA ">FOIA</a> *Jwebunit code:* assertElementPresentByXPath("//a[*@href*=' http://www.company.com/wps/portal/!ut/p/_s.7_0_A/7_0_1OB?navtype=FT&navid=FOIA' ]"); Thank you, Lakshmi |
From: Tim P. <ti...@pa...> - 2010-03-03 23:53:28
|
On 3 March 2010 21:49, Julien HENRY wrote: > Hi all, > > I'm please to announce the release of JWebUnit 2.3. This release includes update of backend libraries: HtmlUnit, Selenium and JUnit. Congrats and thank you. Tim |
From: Jevon W. <je...@je...> - 2010-03-03 23:31:18
|
Thanks for sorting out the 2.3 release Julien :) Cheers Jevon On Thu, Mar 4, 2010 at 10:49 AM, Julien HENRY <he...@ya...> wrote: > Hi all, > > I'm please to announce the release of JWebUnit 2.3. This release includes > update of backend libraries: HtmlUnit, Selenium and JUnit. > > Release notes are available: > http://jwebunit.sourceforge.net/changes-report.html > > > Artifacts should be quickly available on the central repository. > > Regards, > > Julien > > > > > > > ------------------------------------------------------------------------------ > 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: Julien H. <he...@ya...> - 2010-03-03 21:49:20
|
Hi all, I'm please to announce the release of JWebUnit 2.3. This release includes update of backend libraries: HtmlUnit, Selenium and JUnit. Release notes are available: http://jwebunit.sourceforge.net/changes-report.html Artifacts should be quickly available on the central repository. Regards, Julien |
From: lakshmi s. <lso...@gm...> - 2010-03-03 17:33:23
|
HI Julien, How do I put the plugin in the class path? Please let me know if my command below is right. I built the jar file using eclipse in dev environment. I am running this jar from windows command prompt. I have no gui tools available in the prod environment. I have highlighted the htmlunit jar files in red in the classpath below. Thanks! Lakshmi *The command that I used is below:* java -Djavax.net.debug=all -classpath c:/JWebUnit/lib/jwebunit-core-2.2.jar;* c:/JWebUnit/lib/jwebunit-htmlunit-plugin-2.1.jar* ;c:/JWebUnit/lib/commons-codec-1.3.jar;c:/JWebUnit/lib/commons-collections-3.2.1.jar;c:/JWebUnit/lib/commons-httpclient-3.1.jar;c:/JWebUnit/lib/commons-io-1.4.jar;c:/JWebUnit/lib/commons-lang-2.4.jar;c:/JWebUnit/lib/commons-logging-1.1.1.jar;c:/JWebUnit/lib/cssp arser-0.9.5.jar;*c:/JWebUnit/lib/htmlunit-2.5.jar*;* c:/JWebUnit/lib/htmlunit-core-js-2.5.jar;* c:/JWebUnit/lib/junit-3.8.2.jar;c:/JWebUnit/lib/log4j-1.2.13.jar;c:/JWebUnit/lib/nekohtml-1.9.12.jar;c:/JWebUnit/lib/regexp-1.3.jar;c:/JWebUni t/lib/sac-1.3.jar;c:/JWebUnit/lib/servlet-api-2.4.jar;c:/JWebUnit/lib/slf4j-api-1.5.0.jar;c:/JWebUnit/lib/slf4j-log4j12-1.5.0.jar;c:/JWebUnit/lib/xalan-2.7.1.jar;c:/JWebUnit/lib/xercesImpl-2.8.1.jar;c:/JWebUnit/lib/xml-apis-1.3.04.j ar;c:/JWebUnit/lib/dbunit-2.4.7.jar;c:/JWebUnit/nrrs.properties;NRRSTestSuite.jar gov.usda.fsa.tco.test.NRRSExample On Wed, Mar 3, 2010 at 10:59 AM, Julien HENRY <he...@ya...> wrote: > Hi, > > As it is said by the message: Check you put at least one plugin in the > classpath. > > How are you running the tool from the command line? Using Maven, Ant ? > > Regards, > > Julien > > > *De :* lakshmi somavaram <lso...@gm...> > *À :* Usage problems for JWebUnit <jwe...@li...> > *Envoyé le :* Mer 3 Mars 2010, 17 h 48 min 40 s > *Objet :* [JWebUnit-users] Null Pointer exception due to testing engine > > Dear Users, > > I am having issues running the JWebUnit test cases as a jar file on a > comand prompt on Windows. It is working fine in the Eclipse environment on > Windows. Please let me know how to specify testing engine in the classpath, > so that it can be loaded into the registry. > > I added: setTestingEngineKey(TestingEngineRegistry.* > TESTING_ENGINE_HTMLUNIT*); to the code after, > I got an error saying: > > java.lang.RuntimeException: TestingEngineRegistry contains no testing > engine. Check you put at least one p > lugin in the classpath. > > After that, I got the Null Pointer exception. > > Please let me know where I am going wrong. > Thank you, > Lakshmi > > > *My setup method:* > * > > public > **void* setUp() { > > *super*.setBaseUrl("URL"); > > setTestingEngineKey(TestingEngineRegistry. > *TESTING_ENGINE_HTMLUNIT*); > > } > > *One of the Test Cases:* > > *public* > *void* testNRRSLoginPage(){ > > Properties props = > *new* Properties(); > > *try* { > > props.load( > *new* FileInputStream("nrrs.properties")); > > } > > *catch* (IOException e) { > > // *TODO* Auto-generated catch block > > e.printStackTrace(); > > } > > beginAt( > http://some url <http://some%20url/>); > > assertTextPresent( > "Web Services Log-In"); > > dumpScreen( > "eAuthScreen"); > > submit( > "ibContinue"); > > assertTextPresent( > "Password"); > > setTextField( > "USER", props.getProperty("user_name")); > > setTextField( > "PASSWORD", props.getProperty("user_password")); > > submit( > "ibLogin"); > > assertTextPresent( > "NRRS"); > > } > > *The command I used for executing the jar:* > > java -Djavax.net.debug=all -classpath > > > c:/JWebUnit/lib/jwebunit-core-2.2.jar;c:/JWebUnit/lib/jwebunit-htmlunit-plugin-2.1.jar;c:/JWebUnit/lib/commons-codec > > > -1.3.jar;c:/JWebUnit/lib/commons-collections-3.2.1.jar;c:/JWebUnit/lib/commons-httpclient-3.1.jar;c:/JWebUnit/lib/co > > > mmons-io-1.4.jar;c:/JWebUnit/lib/commons-lang-2.4.jar;c:/JWebUnit/lib/commons-logging-1.1.1.jar;c:/JWebUnit/lib/cssp > > > arser-0.9.5.jar;c:/JWebUnit/lib/htmlunit-2.5.jar;c:/JWebUnit/lib/htmlunit-core-js-2.5.jar;c:/JWebUnit/lib/junit-3.8. > > > 2.jar;c:/JWebUnit/lib/log4j-1.2.13.jar;c:/JWebUnit/lib/nekohtml-1.9.12.jar;c:/JWebUnit/lib/regexp-1.3.jar;c:/JWebUni > > > t/lib/sac-1.3.jar;c:/JWebUnit/lib/servlet-api-2.4.jar;c:/JWebUnit/lib/slf4j-api-1.5.0.jar;c:/JWebUnit/lib/slf4j-log4 > > > j12-1.5.0.jar;c:/JWebUnit/lib/xalan-2.7.1.jar;c:/JWebUnit/lib/xercesImpl-2.8.1.jar;c:/JWebUnit/lib/xml-apis-1.3.04.j > > ar;c:/JWebUnit/lib/dbunit-2.4.7.jar;c:/JWebUnit/nrrs.properties; > NRRSTestSuite.jar tco.test.NRRSExample > > *The Error I am getting:* > > 2) testNRRSLoginPage(gov.usda.fsa.tco.test.NRRSExample)* > java.lang.NullPointerExce > ption > * at > net.sourceforge.jwebunit.junit.WebTester.initializeDialog(WebTester.j > ava:125) > at > net.sourceforge.jwebunit.junit.WebTester.getTestingEngine(WebTester.j > ava:105) > at > net.sourceforge.jwebunit.junit.WebTester.beginAt(WebTester.java:212) > at > net.sourceforge.jwebunit.junit.WebTestCase.beginAt(WebTestCase.java:1 > 78) > at > gov.usda.fsa.tco.test.NRRSExample.testNRRSLoginPage(NRRSExample.java: > 107) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at > net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:7 > 9) > at gov.usda.fsa.tco.test.NRRSExample.main(NRRSExample.java:34) > > > > > > > > > ------------------------------------------------------------------------------ > 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: Julien H. <he...@ya...> - 2010-03-03 16:59:14
|
Hi, As it is said by the message: Check you put at least one plugin in the classpath. How are you running the tool from the command line? Using Maven, Ant ? Regards, Julien > >De : lakshmi somavaram <lso...@gm...> >À : Usage problems for JWebUnit <jwe...@li...> >Envoyé le : Mer 3 Mars 2010, 17 h 48 min 40 s >Objet : [JWebUnit-users] Null Pointer exception due to testing engine > > >Dear Users, > >I am having issues running the JWebUnit test cases as a jar file on a comand prompt on Windows. It is working fine in the Eclipse environment on Windows. Please let me know how to specify testing engine in the classpath, so that it can be loaded into the registry. > >I added: setTestingEngineKey(TestingEngineRegistry.TESTING_ENGINE_HTMLUNIT); to the code after, >I got an error saying: > >java.lang.RuntimeException: TestingEngineRegistry contains no testing engine. Check you put at least one p >lugin in the classpath. > >After that, I got the Null Pointer exception. > >Please let me know where I am going wrong. >Thank you, >Lakshmi > > >My setup method: >publicvoidsetUp() { >super.setBaseUrl("URL"); > >setTestingEngineKey(TestingEngineRegistry.TESTING_ENGINE_HTMLUNIT); > >} >One of the Test Cases:publicvoidtestNRRSLoginPage(){ >Properties props = newProperties(); >try{ > >props.load(newFileInputStream("nrrs.properties")); > >} catch(IOException e) { >// TODOAuto-generated catch blocke.printStackTrace(); >}beginAt(http://some url); > >assertTextPresent("Web Services Log-In"); > >dumpScreen("eAuthScreen"); > >submit("ibContinue"); > >assertTextPresent("Password"); > >setTextField("USER", props.getProperty("user_name")); > >setTextField("PASSWORD", props.getProperty("user_password")); >submit("ibLogin"); > >assertTextPresent("NRRS"); >} >The command I used for executing the jar: >java -Djavax.net.debug=all -classpath >c:/JWebUnit/lib/jwebunit-core-2.2.jar;c:/JWebUnit/lib/jwebunit-htmlunit-plugin-2.1.jar;c:/JWebUnit/lib/commons-codec >-1.3.jar;c:/JWebUnit/lib/commons-collections-3.2.1.jar;c:/JWebUnit/lib/commons-httpclient-3.1.jar;c:/JWebUnit/lib/co >mmons-io-1.4.jar;c:/JWebUnit/lib/commons-lang-2.4.jar;c:/JWebUnit/lib/commons-logging-1.1.1.jar;c:/JWebUnit/lib/cssp >arser-0.9.5.jar;c:/JWebUnit/lib/htmlunit-2.5.jar;c:/JWebUnit/lib/htmlunit-core-js-2.5.jar;c:/JWebUnit/lib/junit-3.8. >2.jar;c:/JWebUnit/lib/log4j-1.2.13.jar;c:/JWebUnit/lib/nekohtml-1.9.12.jar;c:/JWebUnit/lib/regexp-1.3.jar;c:/JWebUni >t/lib/sac-1.3.jar;c:/JWebUnit/lib/servlet-api-2.4.jar;c:/JWebUnit/lib/slf4j-api-1.5.0.jar;c:/JWebUnit/lib/slf4j-log4 >j12-1.5.0.jar;c:/JWebUnit/lib/xalan-2.7.1.jar;c:/JWebUnit/lib/xercesImpl-2.8.1.jar;c:/JWebUnit/lib/xml-apis-1.3.04.j >ar;c:/JWebUnit/lib/dbunit-2.4.7.jar;c:/JWebUnit/nrrs.properties;NRRSTestSuite.jar tco.test.NRRSExample >The Error I am getting: >2) testNRRSLoginPage(gov.usda.fsa.tco.test.NRRSExample)java.lang.NullPointerExce >ption > at net.sourceforge.jwebunit.junit.WebTester.initializeDialog(WebTester.j >ava:125) > at net.sourceforge.jwebunit.junit.WebTester.getTestingEngine(WebTester.j >>ava:105) > at net.sourceforge.jwebunit.junit.WebTester.beginAt(WebTester.java:212) > at net.sourceforge.jwebunit.junit.WebTestCase.beginAt(WebTestCase.java:1 >78) > at gov.usda.fsa.tco.test.NRRSExample.testNRRSLoginPage(NRRSExample.java: >>107) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) >> at net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:7 >9) > at gov.usda.fsa.tco.test.NRRSExample.main(NRRSExample.java:34) > > |
From: lakshmi s. <lso...@gm...> - 2010-03-03 16:48:48
|
Dear Users, I am having issues running the JWebUnit test cases as a jar file on a comand prompt on Windows. It is working fine in the Eclipse environment on Windows. Please let me know how to specify testing engine in the classpath, so that it can be loaded into the registry. I added: setTestingEngineKey(TestingEngineRegistry.*TESTING_ENGINE_HTMLUNIT *); to the code after, I got an error saying: java.lang.RuntimeException: TestingEngineRegistry contains no testing engine. Check you put at least one p lugin in the classpath. After that, I got the Null Pointer exception. Please let me know where I am going wrong. Thank you, Lakshmi *My setup method:* * public* *void* setUp() { *super*.setBaseUrl("URL"); setTestingEngineKey(TestingEngineRegistry.*TESTING_ENGINE_HTMLUNIT*); } *One of the Test Cases:* *public* *void* testNRRSLoginPage(){ Properties props = *new* Properties(); *try* { props.load(*new* FileInputStream("nrrs.properties")); } *catch* (IOException e) { // *TODO* Auto-generated catch block e.printStackTrace(); } beginAt(http://some url <http://some%20url/>); assertTextPresent("Web Services Log-In"); dumpScreen("eAuthScreen"); submit("ibContinue"); assertTextPresent("Password"); setTextField("USER", props.getProperty("user_name")); setTextField("PASSWORD", props.getProperty("user_password")); submit("ibLogin"); assertTextPresent("NRRS"); } *The command I used for executing the jar:* java -Djavax.net.debug=all -classpath c:/JWebUnit/lib/jwebunit-core-2.2.jar;c:/JWebUnit/lib/jwebunit-htmlunit-plugin-2.1.jar;c:/JWebUnit/lib/commons-codec -1.3.jar;c:/JWebUnit/lib/commons-collections-3.2.1.jar;c:/JWebUnit/lib/commons-httpclient-3.1.jar;c:/JWebUnit/lib/co mmons-io-1.4.jar;c:/JWebUnit/lib/commons-lang-2.4.jar;c:/JWebUnit/lib/commons-logging-1.1.1.jar;c:/JWebUnit/lib/cssp arser-0.9.5.jar;c:/JWebUnit/lib/htmlunit-2.5.jar;c:/JWebUnit/lib/htmlunit-core-js-2.5.jar;c:/JWebUnit/lib/junit-3.8. 2.jar;c:/JWebUnit/lib/log4j-1.2.13.jar;c:/JWebUnit/lib/nekohtml-1.9.12.jar;c:/JWebUnit/lib/regexp-1.3.jar;c:/JWebUni t/lib/sac-1.3.jar;c:/JWebUnit/lib/servlet-api-2.4.jar;c:/JWebUnit/lib/slf4j-api-1.5.0.jar;c:/JWebUnit/lib/slf4j-log4 j12-1.5.0.jar;c:/JWebUnit/lib/xalan-2.7.1.jar;c:/JWebUnit/lib/xercesImpl-2.8.1.jar;c:/JWebUnit/lib/xml-apis-1.3.04.j ar;c:/JWebUnit/lib/dbunit-2.4.7.jar;c:/JWebUnit/nrrs.properties; NRRSTestSuite.jar tco.test.NRRSExample *The Error I am getting:* 2) testNRRSLoginPage(gov.usda.fsa.tco.test.NRRSExample)* java.lang.NullPointerExce ption * at net.sourceforge.jwebunit.junit.WebTester.initializeDialog(WebTester.j ava:125) at net.sourceforge.jwebunit.junit.WebTester.getTestingEngine(WebTester.j ava:105) at net.sourceforge.jwebunit.junit.WebTester.beginAt(WebTester.java:212) at net.sourceforge.jwebunit.junit.WebTestCase.beginAt(WebTestCase.java:1 78) at gov.usda.fsa.tco.test.NRRSExample.testNRRSLoginPage(NRRSExample.java: 107) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:7 9) at gov.usda.fsa.tco.test.NRRSExample.main(NRRSExample.java:34) |
From: lakshmi s. <lso...@gm...> - 2010-02-25 16:26:06
|
Hi Everyone that responded to my query, I used getElementsByXPath and I was able to get what I wanted from the HTML table that had no id or name. Thank you all for your help! Lakshmi On Thu, Feb 25, 2010 at 8:22 AM, Stand Trooper <sta...@gm...>wrote: > 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 >> >> >> > > ------------------------------------------------------------------------------ > 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 > > |