jwebunit-users Mailing List for JWebUnit (Page 7)
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: Eric J. <eje...@ho...> - 2010-10-04 18:17:04
|
+ Error stacktraces are turned on. [INFO] Scanning for projects... [INFO] Reactor build order: [INFO] JWebUnit [INFO] WebTestCase Generator [INFO] Core - API [INFO] Commons Tests [INFO] HtmlUnit Plugin [INFO] Selenium Plugin [INFO] ------------------------------------------------------------------------ [INFO] Building JWebUnit [INFO] task-segment: [compile] [INFO] ------------------------------------------------------------------------ [INFO] [toolchains:toolchain {execution: default}] [INFO] Type:jdk [INFO] Toolchain (jdk) matched:JDK[C:/Tools/Java/jdk1.5.0_22] [INFO] ------------------------------------------------------------------------ [INFO] Building WebTestCase Generator [INFO] task-segment: [compile] [INFO] ------------------------------------------------------------------------ [INFO] [toolchains:toolchain {execution: default}] [INFO] Type:jdk [INFO] Toolchain (jdk) matched:JDK[C:/Tools/Java/jdk1.5.0_22] [INFO] [javacc:javacc {execution: default}] [INFO] Skipping - all grammars up to date [INFO] [resources:resources {execution: default-resources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory C:\Tools\jwebunit\jwebunit-webtestcase-generator\src\main\resources [INFO] [compiler:compile {execution: default-compile}] [INFO] Toolchain in compiler-plugin: JDK[C:/Tools/Java/jdk1.5.0_22] [INFO] Nothing to compile - all classes are up to date [INFO] ------------------------------------------------------------------------ [INFO] Building Core - API [INFO] task-segment: [compile] [INFO] ------------------------------------------------------------------------ [INFO] [toolchains:toolchain {execution: default}] [INFO] Type:jdk [INFO] Toolchain (jdk) matched:JDK[C:/Tools/Java/jdk1.5.0_22] [INFO] Preparing exec:java [WARNING] Removing: java from forked lifecycle, to prevent recursive invocation. [INFO] [toolchains:toolchain {execution: default}] [INFO] Type:jdk [INFO] Toolchain (jdk) matched:JDK[C:/Tools/Java/jdk1.5.0_22] [INFO] [exec:java {execution: default}] WebTestCaseGenerator: Reading from file C:\Tools\jwebunit\jwebunit-core/src/main/java\net\sourceforge\jwebunit\junit\WebTester.java . . . WebTestCaseGenerator: WebTester.java parsed successfully. [INFO] Registering compile source root C:\Tools\jwebunit\jwebunit-core\target\generated-sources\main\java [INFO] [resources:resources {execution: default-resources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 0 resource [INFO] [compiler:compile {execution: default-compile}] [INFO] Toolchain in compiler-plugin: JDK[C:/Tools/Java/jdk1.5.0_22] [INFO] Compiling 1 source file to C:\Tools\jwebunit\jwebunit-core\target\classes [INFO] ------------------------------------------------------------------------ [INFO] Building Commons Tests [INFO] task-segment: [compile] [INFO] ------------------------------------------------------------------------ [INFO] [toolchains:toolchain {execution: default}] [INFO] Type:jdk [INFO] Toolchain (jdk) matched:JDK[C:/Tools/Java/jdk1.5.0_22] [INFO] [resources:resources {execution: default-resources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 96 resources [INFO] [compiler:compile {execution: default-compile}] [INFO] Toolchain in compiler-plugin: JDK[C:/Tools/Java/jdk1.5.0_22] [INFO] Nothing to compile - all classes are up to date [INFO] ------------------------------------------------------------------------ [INFO] Building HtmlUnit Plugin [INFO] task-segment: [compile] [INFO] ------------------------------------------------------------------------ [INFO] [toolchains:toolchain {execution: default}] [INFO] Type:jdk [INFO] Toolchain (jdk) matched:JDK[C:/Tools/Java/jdk1.5.0_22] [INFO] [resources:resources {execution: default-resources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory C:\Tools\jwebunit\jwebunit-htmlunit-plugin\src\main\resources [INFO] [compiler:compile {execution: default-compile}] [INFO] Toolchain in compiler-plugin: JDK[C:/Tools/Java/jdk1.5.0_22] [INFO] Compiling 2 source files to C:\Tools\jwebunit\jwebunit-htmlunit-plugin\target\classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /Tools/jwebunit/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java:[303,43] cannot find symbol symbol : method getSecure() location: interface org.apache.http.cookie.Cookie [INFO] 1error [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Compilation failure /Tools/jwebunit/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java:[303,43] cannot find symbol symbol : method getSecure() location: interface org.apache.http.cookie.Cookie [INFO] ------------------------------------------------------------------------ [INFO] Trace org.apache.maven.BuildFailureException: Compilation failure /Tools/jwebunit/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java:[303,43] cannot find symbol symbol : method getSecure() location: interface org.apache.http.cookie.Cookie at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:715) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) 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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure /Tools/jwebunit/jwebunit-htmlunit-plugin/src/main/java/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.java:[303,43] cannot find symbol symbol : method getSecure() location: interface org.apache.http.cookie.Cookie at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:613) at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:116) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) ... 17 more [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4 seconds [INFO] Finished at: Mon Oct 04 13:16:03 CDT 2010 [INFO] Final Memory: 20M/48M [INFO] ------------------------------------------------------------------------ |
From: Julien H. <he...@ya...> - 2010-10-04 14:02:08
|
Hi Eric, It could be quickly done if there is not too much API change. I'll try to look at it as soon as possible, but on your side you can try to build from trunk after updating htmlunit version in Maven pom. Report any test failure here. Regards, Julien > >De : Eric Jelinek <eje...@ho...> >À : "jwe...@li..." ><jwe...@li...> >Envoyé le : Lun 4 octobre 2010, 14h 53min 05s >Objet : [JWebUnit-users] HtmlUnit 2.8 > > >I'm curious when we might see a jwebunit release with htmlunit 2.8. I've got a >js problem and perusing the htmlunit community shows that my issue "may" be >resolved with htmlunit 2.8. > >Thanks >Eric |
From: Eric J. <eje...@ho...> - 2010-10-04 13:27:04
|
I'm curious when we might see a jwebunit release with htmlunit 2.8. I've got a js problem and perusing the htmlunit community shows that my issue "may" be resolved with htmlunit 2.8. Thanks Eric |
From: Jevon W. <je...@je...> - 2010-09-30 13:20:30
|
Hi Jeff, JWebUnit extends JUnit, so you can create test suites in the same way you would create a test suite for JUnit tests. The test suite can then be run directly. For example: http://code.google.com/p/iaml/source/browse/trunk/org.openiaml.model.tests/src/org/openiaml/model/tests/codegen/model0_5_1/AllModel0_5_1CodegenTests.java?r=2349 Hope this helps, Jevon On Wed, Sep 29, 2010 at 6:52 PM, Jeff Davies <jef...@ya...> wrote: > I was able to create a test case using JWebUnit very easily. Thank you for > all of the hard work you have put into it! > > Now for my question. Is there a way to run a suite of tests instead of > picking a single test case java file and running it? I looked through the > docs and didn't see any mention of such a concept. It would be nice to run a > large number of unit tests all together as a sanity check before a release. > > Thanks in advance! > > - Jeff > > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > |
From: Jevon W. <je...@je...> - 2010-09-30 13:17:17
|
Hi Jeff, Firstly yes, JWebUnit/HtmlUnit handles most types of Javascript, so it should be fine as long as your Javascript is compliant. Yes, using an XPath approach sounds fine. Have you tried searching through all //img, and making sure your image is first present there? Perhaps the @src attribute has whitespace or the URI is automagically made absolute, try using contains() instead. You could also first assert that the H2 exists (through XPath or an element ID) and then assert that it contains an image, and then peeking at the source of the image that way. Hope this helps, Jevon On Thu, Sep 30, 2010 at 2:57 AM, Jeff Davies <jef...@ya...> wrote: > Hi all, > Another quick question. I have some javascript/JQuery that is creating > an img dynamically. I tried using the *assertElementPresentByXPath*() method > but that is not behaving as expected. For example, I have an Ajax call that > builds the img tag as follows: > > xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && > xmlhttp.status==200) { try { tableHTML = "<h2>Administrators <img > id=\"inviteAdmin\" title=\"Invite an administrator\" class=\"clickable\" > src=\"images/icon_envelope.png\" onclick=\"showInviteAdministrator();\" > width=\"48\" height=\"48\" alt=\"Invite administrator\"></img></h2><table>"; > result = JSON.parse(xmlhttp.responseText); > > My JWebUnit test file then tries the following assert: > > assertElementPresentByXPath("//img[@src='images/icon_envelope.png']"); > > Here is the resulting (truncated) trace when the assert fails: > junit.framework.AssertionFailedError: Unable to locate element with xpath > "//img[@src='images/icon_envelope.png']" at > junit.framework.Assert.fail(Assert.java:47) at > junit.framework.Assert.assertTrue(Assert.java:20) at > net.sourceforge.jwebunit.junit.WebTester.assertElementPresentByXPath(WebTester.java:2034) > at > net.sourceforge.jwebunit.junit.WebTestCase.assertElementPresentByXPath(WebTestCase.java:1619) > > Now I am reasonably good with XPath, but I also know how finicky it can be > and how easy it is to overlook something. Here are my questions: > > > - Am I even going about this the right way? > - Can JWebUnit handle dynamic elements created by javascript? > - Is this something HtmlUnit is better suited? > > > Thanks in advance for your help. > > - Jeff > > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > |
From: Jeff D. <jef...@ya...> - 2010-09-30 00:57:44
|
Hi all, Another quick question. I have some javascript/JQuery that is creating an img dynamically. I tried using the assertElementPresentByXPath()method but that is not behaving as expected. For example, I have an Ajax call that builds the img tag as follows: xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { try { tableHTML = "<h2>Administrators <img id=\"inviteAdmin\" title=\"Invite an administrator\" class=\"clickable\" src=\"images/icon_envelope.png\" onclick=\"showInviteAdministrator();\" width=\"48\" height=\"48\" alt=\"Invite administrator\"></img></h2><table>"; result = JSON.parse(xmlhttp.responseText); My JWebUnit test file then tries the following assert: assertElementPresentByXPath("//img[@src='images/icon_envelope.png']"); Here is the resulting (truncated) trace when the assert fails: junit.framework.AssertionFailedError: Unable to locate element with xpath "//img[@src='images/icon_envelope.png']" at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.assertTrue(Assert.java:20) at net.sourceforge.jwebunit.junit.WebTester.assertElementPresentByXPath(WebTester.java:2034) at net.sourceforge.jwebunit.junit.WebTestCase.assertElementPresentByXPath(WebTestCase.java:1619) Now I am reasonably good with XPath, but I also know how finicky it can be and how easy it is to overlook something. Here are my questions: * Am I even going about this the right way? * Can JWebUnit handle dynamic elements created by javascript? * Is this something HtmlUnit is better suited? Thanks in advance for your help. - Jeff |
From: Jeff D. <jef...@ya...> - 2010-09-29 16:52:16
|
I was able to create a test case using JWebUnit very easily. Thank you for all of the hard work you have put into it! Now for my question. Is there a way to run a suite of tests instead of picking a single test case java file and running it? I looked through the docs and didn't see any mention of such a concept. It would be nice to run a large number of unit tests all together as a sanity check before a release. Thanks in advance! - Jeff |
From: Jason M. <jas...@gm...> - 2010-09-02 14:43:31
|
i agree it's not a clean solution, but that's exactly what i was planning on doing. i'm working through the maven setup today and hope to have my env setup, compiled, and tested soon enough. here is what i was planning on doing in HtmlUnitTestingEngineImpl: - Add these: - private RefreshHandler refreshHandler = null; - public void setRefreshHandler(RefreshHandler refreshHandler) - Modify initWebClient() - if (this.refreshHandler == null) { wc.setRefreshHandler(new ImmediateRefreshHandler()); } else { wc.setRefreshHandler(this.refreshHandler); } i'll also be putting the updated jar in my env, to see if this fixes the problem. -Jason- On Thu, Sep 2, 2010 at 1:54 AM, Julien HENRY <he...@ya...> wrote: > This is not a clean solution but an easy fix is to change visibility or add > some methods in HtmlUnitTestingEngineImpl, and cast the use: > ((HtmlUnitTestingEngineImpl) getTestingEngine()).xxxxx (where xxx could be > setDefaultRefreshHandler) before calling beginAt(). > > Regards, > > Julien > > > *De :* Jason McSwain <jas...@gm...> > *À :* Usage problems for JWebUnit <jwe...@li...> > *Envoyé le :* Mer 1 septembre 2010, 18h 34min 35s > *Objet :* Re: [JWebUnit-users] Re : Attempted to refresh a page using an > ImmediateRefreshHandler which could have caused an OutOfMemoryError Please > use WaitingRefreshHandler or ThreadedRefreshHandler instead > > Thank you for the quick response. I would be interested in contributing. > i'm looking through the contribution steps here<http://jwebunit.sourceforge.net/building-maven.html>. > I would assume that it would be an easy fix. Once i have an env setup, i'll > put in a fix, and let you review it. > > Is there any particular way that you would prefer to have this done? > > -Jason- > > > > On Wed, Sep 1, 2010 at 7:26 AM, Julien HENRY <he...@ya...> wrote: > >> Hi Jason, >> >> Currently there is no way to change the refresh handler. There is a long >> standing issue about accessing HtmlUnit internals from JWebUnit API. At >> first it was a choice to prevent user to call HtmlUnit specific API and >> prevent easy switch to another testing engine but now we admit there are >> cases where it should be possible. >> >> We are waiting for contribution in this area. >> >> Regards, >> >> Julien >> >> >> *De :* Jason McSwain <jas...@gm...> >> >> *À :* jwe...@li... >> *Envoyé le :* Mer 1 septembre 2010, 1h 03min 13s >> *Objet :* [JWebUnit-users] Attempted to refresh a page using an >> ImmediateRefreshHandler which could have caused an OutOfMemoryError Please >> use WaitingRefreshHandler or ThreadedRefreshHandler instead >> >> Hello, >> >> I searched both the Development and User forums, but didn't find an >> answer. if this has already been answered please point me to the right >> entry in the archives. Thank you in advance for any help you can provide. >> >> i'm new to the list, but have been using JWebUnit for the last 6 months. >> it works great on one of the products i test, so we decided to use it on >> another product, too. This new product has a page that refreshes every 30 >> seconds, and when i go to setup my WebTester, i get an exception. about >> RefreshHandlers. We are using the HtmlUnit plugin, not selenium. The >> Question i have is how do i change the Refresh handler? This error happens >> when i call WebTester.beginAt("/"), and that method initializes the >> WebClient inside a private method, and sets the refreshHandler to the >> ImmediateRefreshHandler. i'd like to use another type. >> >> >> Error: >> java.lang.RuntimeException: Unexpected Exception during init. >> at TestWebTester.init(TestWebTester.java:53) >> at TestWebTester.<init>(TestWebTester.java:37) >> at TestWebTester.main(TestWebTester.java:60) >> Caused by: java.lang.RuntimeException: Refresh to http://10.10.10.31:90/(30s) aborted by HtmlUnit: Attempted to refresh a page using an >> ImmediateRefreshHandler which could have caused an OutOfMemoryError Please >> use WaitingRefreshHandler or ThreadedRefreshHandler instead. >> at >> com.gargoylesoftware.htmlunit.ImmediateRefreshHandler.handleRefresh(ImmediateRefreshHandler.java:58) >> at >> com.gargoylesoftware.htmlunit.html.HtmlPage.executeRefreshIfNeeded(HtmlPage.java:1279) >> at >> com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:218) >> at >> com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:427) >> at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:303) >> at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:360) >> at >> net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.gotoPage(HtmlUnitTestingEngineImpl.java:248) >> at >> net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.beginAt(HtmlUnitTestingEngineImpl.java:207) >> at >> net.sourceforge.jwebunit.junit.WebTester.beginAt(WebTester.java:228) >> at TestWebTester.init(TestWebTester.java:48) >> >> >> Here is an example code snippet that uncovers the issue: >> >> >> **************************************************************************************** >> public class TestWebTester extends WebTester { >> private String baseUrl; >> >> public TestWebTester() { >> super(); >> init(); >> } >> >> public TestWebTester(String baseUrl) { >> super(); >> this.baseUrl = baseUrl; >> init(); >> } >> >> public void init() { >> System.out.println("TestWebTester.init()"); >> // set base url >> try { >> >> setBaseUrl(this.baseUrl); >> // first part to load >> System.out.println(" -> set begin at = '/'"); >> beginAt("/"); >> >> } catch (TestingEngineResponseException e) { >> throw new RuntimeException("Unexpected >> TestingEngineResponseException during init.", e); >> } catch (Exception e) { >> throw new RuntimeException("Unexpected Exception during >> init.", e); >> } >> } >> >> public static void main(String[] args) { >> System.out.println("----- Begin -----"); >> try { >> TestWebTester twt = new TestWebTester("http://10.10.10.31:90/ >> "); >> } catch (Throwable t) { >> System.out.println("*** ERROR ***"); >> t.printStackTrace(); >> System.out.println(); >> System.out.println("*************"); >> } >> >> System.out.println("----- end -----"); >> } >> } >> >> **************************************************************************************** >> >> >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> This SF.net Dev2Dev email is sponsored by: >> >> Show off your parallel programming skills. >> Enter the Intel(R) Threading Challenge 2010. >> http://p.sf.net/sfu/intel-thread-sfd >> _______________________________________________ >> JWebUnit-users mailing list >> JWe...@li... >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> > > > > ------------------------------------------------------------------------------ > This SF.net Dev2Dev email is sponsored by: > > Show off your parallel programming skills. > Enter the Intel(R) Threading Challenge 2010. > http://p.sf.net/sfu/intel-thread-sfd > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > |
From: Julien H. <he...@ya...> - 2010-09-02 06:54:54
|
This is not a clean solution but an easy fix is to change visibility or add some methods in HtmlUnitTestingEngineImpl, and cast the use: ((HtmlUnitTestingEngineImpl) getTestingEngine()).xxxxx (where xxx could be setDefaultRefreshHandler) before calling beginAt(). Regards, Julien > >De : Jason McSwain <jas...@gm...> >À : Usage problems for JWebUnit <jwe...@li...> >Envoyé le : Mer 1 septembre 2010, 18h 34min 35s >Objet : Re: [JWebUnit-users] Re : Attempted to refresh a page using an >ImmediateRefreshHandler which could have caused an OutOfMemoryError Please use >WaitingRefreshHandler or ThreadedRefreshHandler instead > >Thank you for the quick response. I would be interested in contributing. i'm >looking through the contribution steps here. I would assume that it would be an >easy fix. Once i have an env setup, i'll put in a fix, and let you review it. > >Is there any particular way that you would prefer to have this done? > >-Jason- > > > > >On Wed, Sep 1, 2010 at 7:26 AM, Julien HENRY <he...@ya...> wrote: > >Hi Jason, >> >>Currently there is no way to change the refresh handler. There is a long >>standing issue about accessing HtmlUnit internals from JWebUnit API. At first it >>was a choice to prevent user to call HtmlUnit specific API and prevent easy >>switch to another testing engine but now we admit there are cases where it >>should be possible. >> >>We are waiting for contribution in this area. >> >>Regards, >> >>Julien >> >> >> >>> >>>De : Jason McSwain <jas...@gm...> >>> >>>À : jwe...@li... >>>Envoyé le : Mer 1 septembre 2010, 1h 03min 13s >>>Objet : [JWebUnit-users] Attempted to refresh a page using an >>>ImmediateRefreshHandler which could have caused an OutOfMemoryError Please use >>>WaitingRefreshHandler or ThreadedRefreshHandler instead >>> >>> >>>Hello, >>> >>>I searched both the Development and User forums, but didn't find an answer. if >>>this has already been answered please point me to the right entry in the >>>archives. Thank you in advance for any help you can provide. >>> >>>i'm new to the list, but have been using JWebUnit for the last 6 months. it >>>works great on one of the products i test, so we decided to use it on another >>>product, too. This new product has a page that refreshes every 30 seconds, and >>>when i go to setup my WebTester, i get an exception. about RefreshHandlers. We >>>are using the HtmlUnit plugin, not selenium. The Question i have is how do i >>>change the Refresh handler? This error happens when i call >>>WebTester.beginAt("/"), and that method initializes the WebClient inside a >>>private method, and sets the refreshHandler to the ImmediateRefreshHandler. i'd >>>like to use another type. >>> >>> >>>Error: >>>java.lang.RuntimeException: Unexpected Exception during init. >>> at TestWebTester.init(TestWebTester.java:53) >>> at TestWebTester.<init>(TestWebTester.java:37) >>> at TestWebTester.main(TestWebTester.java:60) >>>Caused by: java.lang.RuntimeException: Refresh to http://10.10.10.31:90/ (30s) >>>aborted by HtmlUnit: Attempted to refresh a page using an >>>ImmediateRefreshHandler which could have caused an OutOfMemoryError Please use >>>WaitingRefreshHandler or ThreadedRefreshHandler instead. >>> at >>>com.gargoylesoftware.htmlunit.ImmediateRefreshHandler.handleRefresh(ImmediateRefreshHandler.java:58) >>> >>> at >>>com.gargoylesoftware.htmlunit.html.HtmlPage.executeRefreshIfNeeded(HtmlPage.java:1279) >>> >>> at >>com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:218) >>> at >>>com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:427) >>> at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:303) >>> at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:360) >>> at >>>net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.gotoPage(HtmlUnitTestingEngineImpl.java:248) >>> >>> at >>>net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.beginAt(HtmlUnitTestingEngineImpl.java:207) >>> >>> at net.sourceforge.jwebunit.junit.WebTester.beginAt(WebTester.java:228) >>> at TestWebTester.init(TestWebTester.java:48) >>> >>> >>>Here is an example code snippet that uncovers the issue: >>> >>>**************************************************************************************** >>> >>>public class TestWebTester extends WebTester { >>> private String baseUrl; >>> >>> public TestWebTester() { >>> super(); >>> init(); >>> } >>> >>> public TestWebTester(String baseUrl) { >>> super(); >>> this.baseUrl = baseUrl; >>> init(); >>> } >>> >>> public void init() { >>> System.out.println("TestWebTester.init()"); >>> // set base url >>> try { >>> >>> setBaseUrl(this.baseUrl); >>> // first part to load >>> System.out.println(" -> set begin at = '/'"); >>> beginAt("/"); >>> >>> } catch (TestingEngineResponseException e) { >>> throw new RuntimeException("Unexpected >>>TestingEngineResponseException during init.", e); >>> } catch (Exception e) { >>> throw new RuntimeException("Unexpected Exception during init.", >e); >>> } >>> } >>> >>> public static void main(String[] args) { >>> System.out.println("----- Begin -----"); >>> try { >>> TestWebTester twt = new TestWebTester("http://10.10.10.31:90/"); >>> } catch (Throwable t) { >>> System.out.println("*** ERROR ***"); >>> t.printStackTrace(); >>> System.out.println(); >>> System.out.println("*************"); >>> } >>> >>> System.out.println("----- end -----"); >>> } >>>} >>>**************************************************************************************** >>> >>> >>> >>> >>> >>> >>> >> >>------------------------------------------------------------------------------ >>This SF.net Dev2Dev email is sponsored by: >> >>Show off your parallel programming skills. >>Enter the Intel(R) Threading Challenge 2010. >>http://p.sf.net/sfu/intel-thread-sfd >>_______________________________________________ >>JWebUnit-users mailing list >>JWe...@li... >>https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> > |
From: Jevon W. <je...@je...> - 2010-09-01 21:22:39
|
Hi Alexandre, I would recommend running the test in a debug environment, and breaking execution intermittently to try and work out why it is taking so long to execute. This is fairly straightforward to do in Eclipse, you may need to install some Java sources as well. Normally HtmlUnit/JWebUnit is much faster for executing Javascript if there are many small files, compared to a browser. I don't know about single large files, though. Jevon On Wed, Sep 1, 2010 at 2:21 PM, Julien HENRY <he...@ya...> wrote: > In this case I'm quite sure it doesn't come from JWebUnit. Try to access > your application in a real browser to see how are performances. > > > *De :* Alexandre Gazola <ale...@ya...> > *À :* Usage problems for JWebUnit <jwe...@li...> > *Envoyé le :* Mer 1 septembre 2010, 15h 09min 38s > *Objet :* [JWebUnit-users] Res: Re : jwebunit with JSF: Dynamic page takes > a long time! > > Hi Julien, > > Thank you for your answer, but that still didn´t work out for me. > > Best, > > Alexandre > > ------------------------------ > *De:* Julien HENRY <he...@ya...> > *Para:* Usage problems for JWebUnit <jwe...@li...> > *Enviadas:* Quarta-feira, 1 de Setembro de 2010 9:28:50 > *Assunto:* [JWebUnit-users] Re : jwebunit with JSF: Dynamic page takes a > long time! > > Hi Alexandre, > > Sometimes this is beacuse of Javascript that takes too much time to execute > under HtmlUnit. TRy to disable scripting (setScriptingEnabled(false)) to see > if performances are better. > > Regards, > > Julien > > > *De :* Alexandre Gazola <ale...@ya...> > *À :* jwe...@li... > *Envoyé le :* Mer 1 septembre 2010, 2h 12min 52s > *Objet :* [JWebUnit-users] jwebunit with JSF: Dynamic page takes a long > time! > > Hi guys! > > I started experimenting with jwebunit on my JSF project. My test takes a > really long time to run (it gets stuck for some time at the "beginAt" > call). The method succeeds, but it is taking a long time to execute. Does > anybody know what is happening ? (this is a JSF 1.2 application). > > ** > > *public* *class* TesteWebUnit { > > * private* WebTester tester; > > @Before > > * public* *void* setUp() *throws* Exception { > > tester = *new* WebTester(); > > tester.setBaseUrl(http://localhost:8180/Test); > > } > > @Test > > * public* *void* login() { > > tester.beginAt("/login/login.html"); > > tester.assertTitleEquals("Login Page"); > > } > > } > > > > Thanks! > > > > > > > > > > > ------------------------------------------------------------------------------ > This SF.net Dev2Dev email is sponsored by: > > Show off your parallel programming skills. > Enter the Intel(R) Threading Challenge 2010. > http://p.sf.net/sfu/intel-thread-sfd > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > |
From: Jason M. <jas...@gm...> - 2010-09-01 16:35:03
|
Thank you for the quick response. I would be interested in contributing. i'm looking through the contribution steps here<http://jwebunit.sourceforge.net/building-maven.html>. I would assume that it would be an easy fix. Once i have an env setup, i'll put in a fix, and let you review it. Is there any particular way that you would prefer to have this done? -Jason- On Wed, Sep 1, 2010 at 7:26 AM, Julien HENRY <he...@ya...> wrote: > Hi Jason, > > Currently there is no way to change the refresh handler. There is a long > standing issue about accessing HtmlUnit internals from JWebUnit API. At > first it was a choice to prevent user to call HtmlUnit specific API and > prevent easy switch to another testing engine but now we admit there are > cases where it should be possible. > > We are waiting for contribution in this area. > > Regards, > > Julien > > > *De :* Jason McSwain <jas...@gm...> > > *À :* jwe...@li... > *Envoyé le :* Mer 1 septembre 2010, 1h 03min 13s > *Objet :* [JWebUnit-users] Attempted to refresh a page using an > ImmediateRefreshHandler which could have caused an OutOfMemoryError Please > use WaitingRefreshHandler or ThreadedRefreshHandler instead > > Hello, > > I searched both the Development and User forums, but didn't find an > answer. if this has already been answered please point me to the right > entry in the archives. Thank you in advance for any help you can provide. > > i'm new to the list, but have been using JWebUnit for the last 6 months. > it works great on one of the products i test, so we decided to use it on > another product, too. This new product has a page that refreshes every 30 > seconds, and when i go to setup my WebTester, i get an exception. about > RefreshHandlers. We are using the HtmlUnit plugin, not selenium. The > Question i have is how do i change the Refresh handler? This error happens > when i call WebTester.beginAt("/"), and that method initializes the > WebClient inside a private method, and sets the refreshHandler to the > ImmediateRefreshHandler. i'd like to use another type. > > > Error: > java.lang.RuntimeException: Unexpected Exception during init. > at TestWebTester.init(TestWebTester.java:53) > at TestWebTester.<init>(TestWebTester.java:37) > at TestWebTester.main(TestWebTester.java:60) > Caused by: java.lang.RuntimeException: Refresh to http://10.10.10.31:90/(30s) aborted by HtmlUnit: Attempted to refresh a page using an > ImmediateRefreshHandler which could have caused an OutOfMemoryError Please > use WaitingRefreshHandler or ThreadedRefreshHandler instead. > at > com.gargoylesoftware.htmlunit.ImmediateRefreshHandler.handleRefresh(ImmediateRefreshHandler.java:58) > at > com.gargoylesoftware.htmlunit.html.HtmlPage.executeRefreshIfNeeded(HtmlPage.java:1279) > at > com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:218) > at > com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:427) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:303) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:360) > at > net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.gotoPage(HtmlUnitTestingEngineImpl.java:248) > at > net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.beginAt(HtmlUnitTestingEngineImpl.java:207) > at net.sourceforge.jwebunit.junit.WebTester.beginAt(WebTester.java:228) > at TestWebTester.init(TestWebTester.java:48) > > > Here is an example code snippet that uncovers the issue: > > > **************************************************************************************** > public class TestWebTester extends WebTester { > private String baseUrl; > > public TestWebTester() { > super(); > init(); > } > > public TestWebTester(String baseUrl) { > super(); > this.baseUrl = baseUrl; > init(); > } > > public void init() { > System.out.println("TestWebTester.init()"); > // set base url > try { > > setBaseUrl(this.baseUrl); > // first part to load > System.out.println(" -> set begin at = '/'"); > beginAt("/"); > > } catch (TestingEngineResponseException e) { > throw new RuntimeException("Unexpected > TestingEngineResponseException during init.", e); > } catch (Exception e) { > throw new RuntimeException("Unexpected Exception during init.", > e); > } > } > > public static void main(String[] args) { > System.out.println("----- Begin -----"); > try { > TestWebTester twt = new TestWebTester("http://10.10.10.31:90/ > "); > } catch (Throwable t) { > System.out.println("*** ERROR ***"); > t.printStackTrace(); > System.out.println(); > System.out.println("*************"); > } > > System.out.println("----- end -----"); > } > } > > **************************************************************************************** > > > > > > > > > ------------------------------------------------------------------------------ > This SF.net Dev2Dev email is sponsored by: > > Show off your parallel programming skills. > Enter the Intel(R) Threading Challenge 2010. > http://p.sf.net/sfu/intel-thread-sfd > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > |
From: Julien H. <he...@ya...> - 2010-09-01 13:21:44
|
In this case I'm quite sure it doesn't come from JWebUnit. Try to access your application in a real browser to see how are performances. > >De : Alexandre Gazola <ale...@ya...> >À : Usage problems for JWebUnit <jwe...@li...> >Envoyé le : Mer 1 septembre 2010, 15h 09min 38s >Objet : [JWebUnit-users] Res: Re : jwebunit with JSF: Dynamic page takes a long >time! > > >Hi Julien, > >Thank you for your answer, but that still didn´t work out for me. > >Best, > >Alexandre > > > ________________________________ De: Julien HENRY <he...@ya...> >Para: Usage problems for JWebUnit <jwe...@li...> >Enviadas: Quarta-feira, 1 de Setembro de 2010 9:28:50 >Assunto: [JWebUnit-users] Re : jwebunit with JSF: Dynamic page takes a long >time! > > >Hi Alexandre, > >Sometimes this is beacuse of Javascript that takes too much time to execute >under HtmlUnit. TRy to disable scripting (setScriptingEnabled(false)) to see if >performances are better. > >Regards, > >Julien > > >> >>De : Alexandre Gazola <ale...@ya...> >>À : jwe...@li... >>Envoyé le : Mer 1 septembre 2010, 2h 12min 52s >>Objet : [JWebUnit-users] jwebunit with JSF: Dynamic page takes a long time! >> >> >>Hi guys! >> >>I started experimenting with jwebunit on my JSF project. My test takes a really >>long time to run (it gets stuck for some time at the "beginAt" call). The >>method succeeds, but it is taking a long time to execute. Does anybody know what >>is happening ? (this is a JSF 1.2 application). >> >> >> >>publicclassTesteWebUnit { >> privateWebTester tester; >> @Before >> publicvoidsetUp() throwsException { >> tester= newWebTester(); >> tester.setBaseUrl(http://localhost:8180/Test); >> } >> @Test >> publicvoidlogin() { >> tester.beginAt("/login/login.html"); >> tester.assertTitleEquals("Login Page"); >> } >>} >> >>Thanks! >> > > |
From: Alexandre G. <ale...@ya...> - 2010-09-01 13:09:51
|
Hi Julien, Thank you for your answer, but that still didn´t work out for me. Best, Alexandre ________________________________ De: Julien HENRY <he...@ya...> Para: Usage problems for JWebUnit <jwe...@li...> Enviadas: Quarta-feira, 1 de Setembro de 2010 9:28:50 Assunto: [JWebUnit-users] Re : jwebunit with JSF: Dynamic page takes a long time! Hi Alexandre, Sometimes this is beacuse of Javascript that takes too much time to execute under HtmlUnit. TRy to disable scripting (setScriptingEnabled(false)) to see if performances are better. Regards, Julien > >De : Alexandre Gazola <ale...@ya...> >À : jwe...@li... >Envoyé le : Mer 1 septembre 2010, 2h 12min 52s >Objet : [JWebUnit-users] jwebunit with JSF: Dynamic page takes a long time! > > >Hi guys! > >I started experimenting with jwebunit on my JSF project. My test takes a really >long time to run (it gets stuck for some time at the "beginAt" call). The >method succeeds, but it is taking a long time to execute. Does anybody know what >is happening ? (this is a JSF 1.2 application). > > >publicclassTesteWebUnit { > privateWebTester tester; > @Before > publicvoidsetUp() throwsException { > tester= newWebTester(); > tester.setBaseUrl(http://localhost:8180/Test); > } > @Test > publicvoidlogin() { > tester.beginAt("/login/login.html"); > tester.assertTitleEquals("Login Page"); > } >} > >Thanks! > |
From: Julien H. <he...@ya...> - 2010-09-01 12:28:57
|
Hi Alexandre, Sometimes this is beacuse of Javascript that takes too much time to execute under HtmlUnit. TRy to disable scripting (setScriptingEnabled(false)) to see if performances are better. Regards, Julien > >De : Alexandre Gazola <ale...@ya...> >À : jwe...@li... >Envoyé le : Mer 1 septembre 2010, 2h 12min 52s >Objet : [JWebUnit-users] jwebunit with JSF: Dynamic page takes a long time! > > >Hi guys! > >I started experimenting with jwebunit on my JSF project. My test takes a really >long time to run (it gets stuck for some time at the "beginAt" call). The >method succeeds, but it is taking a long time to execute. Does anybody know what >is happening ? (this is a JSF 1.2 application). > > >publicclassTesteWebUnit { > privateWebTester tester; > @Before > publicvoidsetUp() throwsException { > tester= newWebTester(); > tester.setBaseUrl(http://localhost:8180/Test); > } > @Test > publicvoidlogin() { > tester.beginAt("/login/login.html"); > tester.assertTitleEquals("Login Page"); > } >} > >Thanks! > |
From: Julien H. <he...@ya...> - 2010-09-01 12:26:33
|
Hi Jason, Currently there is no way to change the refresh handler. There is a long standing issue about accessing HtmlUnit internals from JWebUnit API. At first it was a choice to prevent user to call HtmlUnit specific API and prevent easy switch to another testing engine but now we admit there are cases where it should be possible. We are waiting for contribution in this area. Regards, Julien > >De : Jason McSwain <jas...@gm...> >À : jwe...@li... >Envoyé le : Mer 1 septembre 2010, 1h 03min 13s >Objet : [JWebUnit-users] Attempted to refresh a page using an >ImmediateRefreshHandler which could have caused an OutOfMemoryError Please use >WaitingRefreshHandler or ThreadedRefreshHandler instead > >Hello, > >I searched both the Development and User forums, but didn't find an answer. if >this has already been answered please point me to the right entry in the >archives. Thank you in advance for any help you can provide. > >i'm new to the list, but have been using JWebUnit for the last 6 months. it >works great on one of the products i test, so we decided to use it on another >product, too. This new product has a page that refreshes every 30 seconds, and >when i go to setup my WebTester, i get an exception. about RefreshHandlers. We >are using the HtmlUnit plugin, not selenium. The Question i have is how do i >change the Refresh handler? This error happens when i call >WebTester.beginAt("/"), and that method initializes the WebClient inside a >private method, and sets the refreshHandler to the ImmediateRefreshHandler. i'd >like to use another type. > > >Error: >java.lang.RuntimeException: Unexpected Exception during init. > at TestWebTester.init(TestWebTester.java:53) > at TestWebTester.<init>(TestWebTester.java:37) > at TestWebTester.main(TestWebTester.java:60) >Caused by: java.lang.RuntimeException: Refresh to http://10.10.10.31:90/ (30s) >aborted by HtmlUnit: Attempted to refresh a page using an >ImmediateRefreshHandler which could have caused an OutOfMemoryError Please use >WaitingRefreshHandler or ThreadedRefreshHandler instead. > at >com.gargoylesoftware.htmlunit.ImmediateRefreshHandler.handleRefresh(ImmediateRefreshHandler.java:58) > > at >com.gargoylesoftware.htmlunit.html.HtmlPage.executeRefreshIfNeeded(HtmlPage.java:1279) > > at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:218) > at >com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:427) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:303) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:360) > at >net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.gotoPage(HtmlUnitTestingEngineImpl.java:248) > > at >net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.beginAt(HtmlUnitTestingEngineImpl.java:207) > > at net.sourceforge.jwebunit.junit.WebTester.beginAt(WebTester.java:228) > at TestWebTester.init(TestWebTester.java:48) > > >Here is an example code snippet that uncovers the issue: > >**************************************************************************************** > >public class TestWebTester extends WebTester { > private String baseUrl; > > public TestWebTester() { > super(); > init(); > } > > public TestWebTester(String baseUrl) { > super(); > this.baseUrl = baseUrl; > init(); > } > > public void init() { > System.out.println("TestWebTester.init()"); > // set base url > try { > > setBaseUrl(this.baseUrl); > // first part to load > System.out.println(" -> set begin at = '/'"); > beginAt("/"); > > } catch (TestingEngineResponseException e) { > throw new RuntimeException("Unexpected >TestingEngineResponseException during init.", e); > } catch (Exception e) { > throw new RuntimeException("Unexpected Exception during init.", e); > } > } > > public static void main(String[] args) { > System.out.println("----- Begin -----"); > try { > TestWebTester twt = new TestWebTester("http://10.10.10.31:90/"); > } catch (Throwable t) { > System.out.println("*** ERROR ***"); > t.printStackTrace(); > System.out.println(); > System.out.println("*************"); > } > > System.out.println("----- end -----"); > } >} >**************************************************************************************** > > > > > > > |
From: Alexandre G. <ale...@ya...> - 2010-09-01 00:12:59
|
Hi guys! I started experimenting with jwebunit on my JSF project. My test takes a really long time to run (it gets stuck for some time at the "beginAt" call). The method succeeds, but it is taking a long time to execute. Does anybody know what is happening ? (this is a JSF 1.2 application). publicclassTesteWebUnit { privateWebTester tester; @Before } publicvoidsetUp() throwsException { tester= newWebTester(); tester.setBaseUrl(http://localhost:8180/Test); @Test publicvoidlogin() { tester.beginAt("/login/login.html"); } } Thanks! tester.assertTitleEquals("Login Page"); |
From: Jason M. <jas...@gm...> - 2010-08-31 23:03:40
|
Hello, I searched both the Development and User forums, but didn't find an answer. if this has already been answered please point me to the right entry in the archives. Thank you in advance for any help you can provide. i'm new to the list, but have been using JWebUnit for the last 6 months. it works great on one of the products i test, so we decided to use it on another product, too. This new product has a page that refreshes every 30 seconds, and when i go to setup my WebTester, i get an exception. about RefreshHandlers. We are using the HtmlUnit plugin, not selenium. The Question i have is how do i change the Refresh handler? This error happens when i call WebTester.beginAt("/"), and that method initializes the WebClient inside a private method, and sets the refreshHandler to the ImmediateRefreshHandler. i'd like to use another type. Error: java.lang.RuntimeException: Unexpected Exception during init. at TestWebTester.init(TestWebTester.java:53) at TestWebTester.<init>(TestWebTester.java:37) at TestWebTester.main(TestWebTester.java:60) Caused by: java.lang.RuntimeException: Refresh to http://10.10.10.31:90/(30s) aborted by HtmlUnit: Attempted to refresh a page using an ImmediateRefreshHandler which could have caused an OutOfMemoryError Please use WaitingRefreshHandler or ThreadedRefreshHandler instead. at com.gargoylesoftware.htmlunit.ImmediateRefreshHandler.handleRefresh(ImmediateRefreshHandler.java:58) at com.gargoylesoftware.htmlunit.html.HtmlPage.executeRefreshIfNeeded(HtmlPage.java:1279) at com.gargoylesoftware.htmlunit.html.HtmlPage.initialize(HtmlPage.java:218) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:427) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:303) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:360) at net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.gotoPage(HtmlUnitTestingEngineImpl.java:248) at net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.beginAt(HtmlUnitTestingEngineImpl.java:207) at net.sourceforge.jwebunit.junit.WebTester.beginAt(WebTester.java:228) at TestWebTester.init(TestWebTester.java:48) Here is an example code snippet that uncovers the issue: **************************************************************************************** public class TestWebTester extends WebTester { private String baseUrl; public TestWebTester() { super(); init(); } public TestWebTester(String baseUrl) { super(); this.baseUrl = baseUrl; init(); } public void init() { System.out.println("TestWebTester.init()"); // set base url try { setBaseUrl(this.baseUrl); // first part to load System.out.println(" -> set begin at = '/'"); beginAt("/"); } catch (TestingEngineResponseException e) { throw new RuntimeException("Unexpected TestingEngineResponseException during init.", e); } catch (Exception e) { throw new RuntimeException("Unexpected Exception during init.", e); } } public static void main(String[] args) { System.out.println("----- Begin -----"); try { TestWebTester twt = new TestWebTester("http://10.10.10.31:90/"); } catch (Throwable t) { System.out.println("*** ERROR ***"); t.printStackTrace(); System.out.println(); System.out.println("*************"); } System.out.println("----- end -----"); } } **************************************************************************************** |
From: Jevon W. <je...@je...> - 2010-08-22 10:58:01
|
Hi, If the row, cell or containing label or span has a particular ID, you could use IElement getElementByID(); otherwise you could use an XPath expression like //table[@id=XXX]/tr[2]/td[2], etc. Jevon On Fri, Aug 20, 2010 at 8:38 PM, Rajiv Abraham <raj...@gm...>wrote: > Hi, My web page displays the following table( in an html format, but > simplified here). > > ItemId Item_Description Price Status > > ItemId_100 Item_Descr_COOKIE $68.00 Eligible > > ItemId_123 Item_Descr_RADIO $94.00 Eligible > > ItemId_300 Item_Descr_DIAPERS $54.00 Returned > > How do I use jwebunit to make an assertion that there is some row in this > table with ItemId=300 and status = "Returned" . That would in this case be > the third row in the table above. > > > -- > Thanks, > Rajiv > Nothing selected > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > |
From: Rajiv A. <raj...@gm...> - 2010-08-20 19:38:56
|
Hi, My web page displays the following table( in an html format, but simplified here). ItemId Item_Description Price Status ItemId_100 Item_Descr_COOKIE $68.00 Eligible ItemId_123 Item_Descr_RADIO $94.00 Eligible ItemId_300 Item_Descr_DIAPERS $54.00 Returned How do I use jwebunit to make an assertion that there is some row in this table with ItemId=300 and status = "Returned" . That would in this case be the third row in the table above. -- Thanks, Rajiv Nothing selected |
From: Glyn N. <gno...@vm...> - 2010-07-15 09:37:01
|
Hi Julien Many thanks for doing this. Eclipse Virgo can now move forward to consume JWebUnit. I'm sure others will benefit too. Glyn On 15 Jul 2010, at 10:24, Julien HENRY wrote: > JWebUnit 2.4 is released. Notable change is re-licensing to L-GPL instead of > GPL. |
From: Julien H. <he...@ya...> - 2010-07-15 09:24:53
|
Hi all, JWebUnit 2.4 is released. Notable change is re-licensing to L-GPL instead of GPL. Regards, Julien |
From: Glyn N. <gno...@vm...> - 2010-07-15 09:21:52
|
Thanks! On 15 Jul 2010, at 09:57, Julien HENRY wrote: > http://repo2.maven.org/maven2/net/sourceforge/jwebunit/ > > > > ----- Message d'origine ---- >> De : Glyn Normington <gno...@vm...> >> À : Usage problems for JWebUnit <jwe...@li...> >> Envoyé le : Jeu 15 juillet 2010, 10h 36min 54s >> Objet : Re: [JWebUnit-users] Re : Re : Re : GPL Exception? >> >> Hi Julien >> >> That's great news. Unfortunately I can't find the 2.4 bundle in Maven central >> e.g. using http://repository.sonatype.org/. Please could you point me at the >> JARs in Maven central? (I'm not a Maven user, so please bear with me.) >> >> If it's too complicated, I'll just have to wait until you can put the bundle >> on the download page... >> >> Glyn >> On 15 Jul 2010, at 08:55, Julien HENRY wrote: >> >>> Hi Glyn, >>> >>> The release was done and is now synced to central. It took a bit more time >> as we >> >>> are now using OSS nexus repository provided by Sonatype and the steps to >> release >> >>> are much more complicated (GPG signature, staging, ...). >>> New site was deployed too. >>> >>> The last step is to put jwebunit 2.4 bundle for non Maven users on >> Sourceforge >> >>> download page. I'll do that as soon as my wife let me approach a computer at >> >>> home (NB: it's a joke). >>> >>> Regards, >>> >>> Julien >>> >>> >>> >>> >>> ----- Message d'origine ---- >>>> De : Glyn Normington <gno...@vm...> >>>> À : Usage problems for JWebUnit <jwe...@li...> >>>> Envoyé le : Mer 14 juillet 2010, 10h 04min 43s >>>> Objet : Re: [JWebUnit-users] Re : Re : GPL Exception? >>>> >>>> Hi Julien >>>> >>>> Just following up now that early July has passed. Any chance of a release > >>>> soon? >>>> >>>> Thanks and hope you are enjoying married life, >>>> Gyn >>>> On 22 Jun 2010, at 18:17, Julien HENRY wrote: >>>> >>>>> Hi Glyn, >>>>> >>>>> Sorry for the delay. I forgot to do it last week and now I am full time >> busy >> >>>> to prepare my wedding that will take place next saturday. I will be back >> at >> >>>> work in early July and this time I will try to *really* do the release. >>>>> >>>>> Regards, >>>>> >>>>> Julien >>>> >>>> >>>> >> ------------------------------------------------------------------------------ >>>> This SF.net email is sponsored by Sprint >>>> What will you do first with EVO, the first 4G phone? >>>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >>>> _______________________________________________ >>>> JWebUnit-users mailing list >>>> JWe...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>> >>> >>> >>> >>> >>> >> ------------------------------------------------------------------------------ >>> This SF.net email is sponsored by Sprint >>> What will you do first with EVO, the first 4G phone? >>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >>> _______________________________________________ >>> JWebUnit-users mailing list >>> JWe...@li... >>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> JWebUnit-users mailing list >> JWe...@li... >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users |
From: Julien H. <he...@ya...> - 2010-07-15 08:57:56
|
http://repo2.maven.org/maven2/net/sourceforge/jwebunit/ ----- Message d'origine ---- > De : Glyn Normington <gno...@vm...> > À : Usage problems for JWebUnit <jwe...@li...> > Envoyé le : Jeu 15 juillet 2010, 10h 36min 54s > Objet : Re: [JWebUnit-users] Re : Re : Re : GPL Exception? > > Hi Julien > > That's great news. Unfortunately I can't find the 2.4 bundle in Maven central >e.g. using http://repository.sonatype.org/. Please could you point me at the >JARs in Maven central? (I'm not a Maven user, so please bear with me.) > > If it's too complicated, I'll just have to wait until you can put the bundle >on the download page... > > Glyn > On 15 Jul 2010, at 08:55, Julien HENRY wrote: > > > Hi Glyn, > > > > The release was done and is now synced to central. It took a bit more time >as we > > > are now using OSS nexus repository provided by Sonatype and the steps to >release > > > are much more complicated (GPG signature, staging, ...). > > New site was deployed too. > > > > The last step is to put jwebunit 2.4 bundle for non Maven users on >Sourceforge > > > download page. I'll do that as soon as my wife let me approach a computer at > > > home (NB: it's a joke). > > > > Regards, > > > > Julien > > > > > > > > > > ----- Message d'origine ---- > >> De : Glyn Normington <gno...@vm...> > >> À : Usage problems for JWebUnit <jwe...@li...> > >> Envoyé le : Mer 14 juillet 2010, 10h 04min 43s > >> Objet : Re: [JWebUnit-users] Re : Re : GPL Exception? > >> > >> Hi Julien > >> > >> Just following up now that early July has passed. Any chance of a release > >> soon? > >> > >> Thanks and hope you are enjoying married life, > >> Gyn > >> On 22 Jun 2010, at 18:17, Julien HENRY wrote: > >> > >>> Hi Glyn, > >>> > >>> Sorry for the delay. I forgot to do it last week and now I am full time >busy > > >> to prepare my wedding that will take place next saturday. I will be back >at > > >> work in early July and this time I will try to *really* do the release. > >>> > >>> Regards, > >>> > >>> Julien > >> > >> > >> >------------------------------------------------------------------------------ > >> This SF.net email is sponsored by Sprint > >> What will you do first with EVO, the first 4G phone? > >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > >> _______________________________________________ > >> JWebUnit-users mailing list > >> JWe...@li... > >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users > >> > > > > > > > > > > >------------------------------------------------------------------------------ > > This SF.net email is sponsored by Sprint > > What will you do first with EVO, the first 4G phone? > > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > > _______________________________________________ > > JWebUnit-users mailing list > > JWe...@li... > > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > |
From: Glyn N. <gno...@vm...> - 2010-07-15 08:37:02
|
Hi Julien That's great news. Unfortunately I can't find the 2.4 bundle in Maven central e.g. using http://repository.sonatype.org/. Please could you point me at the JARs in Maven central? (I'm not a Maven user, so please bear with me.) If it's too complicated, I'll just have to wait until you can put the bundle on the download page... Glyn On 15 Jul 2010, at 08:55, Julien HENRY wrote: > Hi Glyn, > > The release was done and is now synced to central. It took a bit more time as we > are now using OSS nexus repository provided by Sonatype and the steps to release > are much more complicated (GPG signature, staging, ...). > New site was deployed too. > > The last step is to put jwebunit 2.4 bundle for non Maven users on Sourceforge > download page. I'll do that as soon as my wife let me approach a computer at > home (NB: it's a joke). > > Regards, > > Julien > > > > > ----- Message d'origine ---- >> De : Glyn Normington <gno...@vm...> >> À : Usage problems for JWebUnit <jwe...@li...> >> Envoyé le : Mer 14 juillet 2010, 10h 04min 43s >> Objet : Re: [JWebUnit-users] Re : Re : GPL Exception? >> >> Hi Julien >> >> Just following up now that early July has passed. Any chance of a release >> soon? >> >> Thanks and hope you are enjoying married life, >> Gyn >> On 22 Jun 2010, at 18:17, Julien HENRY wrote: >> >>> Hi Glyn, >>> >>> Sorry for the delay. I forgot to do it last week and now I am full time busy >> to prepare my wedding that will take place next saturday. I will be back at >> work in early July and this time I will try to *really* do the release. >>> >>> Regards, >>> >>> Julien >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> JWebUnit-users mailing list >> JWe...@li... >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users |
From: Julien H. <he...@ya...> - 2010-07-15 07:55:48
|
Hi Glyn, The release was done and is now synced to central. It took a bit more time as we are now using OSS nexus repository provided by Sonatype and the steps to release are much more complicated (GPG signature, staging, ...). New site was deployed too. The last step is to put jwebunit 2.4 bundle for non Maven users on Sourceforge download page. I'll do that as soon as my wife let me approach a computer at home (NB: it's a joke). Regards, Julien ----- Message d'origine ---- > De : Glyn Normington <gno...@vm...> > À : Usage problems for JWebUnit <jwe...@li...> > Envoyé le : Mer 14 juillet 2010, 10h 04min 43s > Objet : Re: [JWebUnit-users] Re : Re : GPL Exception? > > Hi Julien > > Just following up now that early July has passed. Any chance of a release >soon? > > Thanks and hope you are enjoying married life, > Gyn > On 22 Jun 2010, at 18:17, Julien HENRY wrote: > > > Hi Glyn, > > > > Sorry for the delay. I forgot to do it last week and now I am full time busy >to prepare my wedding that will take place next saturday. I will be back at >work in early July and this time I will try to *really* do the release. > > > > Regards, > > > > Julien > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > |