jwebunit-users Mailing List for JWebUnit (Page 3)
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: Julien H. <he...@ya...> - 2012-11-23 08:25:07
|
Hi everybody, I'm pleased to announce the release of JWebUnit 3.1. This release contains a few bug fixes as long as update to HtmlUnit 2.11. As a result Java 1.6 is now a minimum requirement. Artifacts should now be available on Maven central and on Sourceforge. Regards, Julien |
From: Julien H. <he...@ya...> - 2012-11-22 08:09:14
|
Hi Kenny, The snapshot that is published in Maven repo is a timestamped one. See [1]. Most of the time I am doing a release when people ask for. Regards, Julien [1] https://oss.sonatype.org/content/repositories/snapshots/net/sourceforge/jwebunit/jwebunit-htmlunit-plugin/3.1-SNAPSHOT/jwebunit-htmlunit-plugin-3.1-20121112.174400-1.pom >________________________________ > De : Kenneth MacLeod <kma...@at...> >À : Julien HENRY <he...@ya...>; Usage problems for JWebUnit <jwe...@li...> >Envoyé le : Jeudi 22 novembre 2012 2h08 >Objet : Re: [JWebUnit-users] New version of JWebUnit incorporating HtmlUnit 2.11? > > >Hu Julien, > >Thanks for getting back to me. > >Would you be able to publish a timestamped snapshot on the maven repo for the latest build? I'd like to use an artifact with a tracked version and an "official" origin, rather than an unversioned snapshot or one that I build myself from source. > >More generally, I've noticed that while you seem be fixing bugs and adding features to JWebUnit fairly quickly, you only seem to release new versions every few months. For example, the last release of JWebUnit depends on HtmlUnit 2.9, even though you've updated your code on trunk to use 2.10 and then 2.11. > >Is there a reason for this? We use JWebUnit heavily here, and we'd like to contribute some of our patches, but a slow release cycle makes this difficult to manage. Would you be willing to go to a faster release cycle? > >Many thanks, > >Kenny > > > > > >On 21 November 2012 18:57, Julien HENRY <he...@ya...> wrote: > >Can you give a try to the latest snapshot version? >> >>Maven repo: http://oss.sonatype.org/content/repositories/snapshots/ >>Bundle: https://dl.dropbox.com/u/20894864/jwebunit-3.1-SNAPSHOT-release.zip >> >> >>If you can confirm everything is fine I will try to publish a release in the coming days. >> >>Regards, >> >>Julien >> >>>________________________________ >>> De : Kenneth MacLeod <kma...@at...> >>>À : jwe...@li... >>>Envoyé le : Mercredi 21 novembre 2012 1h24 >>>Objet : [JWebUnit-users] New version of JWebUnit incorporating HtmlUnit 2.11? >> >>> >>> >>>Hi there, >>> >>>There was a new version of HtmlUnit released recently (2.11) which incorporates a major bugfix for us. However, JWebUnit-HtmlUnit-Plugin does not compile against this version of HtmlUnit. >>> >>>Can we have a new release of JWebUnit incorporating this new HtmlUnit dependency, please? >>> >>>Regards, >>>Kenny >>> >>> >>>------------------------------------------------------------------------------ >>>Monitor your physical, virtual and cloud infrastructure from a single >>>web console. Get in-depth insight into apps, servers, databases, vmware, >>>SAP, cloud infrastructure, etc. Download 30-day Free Trial. >>>Pricing starts from $795 for 25 servers or applications! >>>http://p.sf.net/sfu/zoho_dev2dev_nov >>>_______________________________________________ >>>JWebUnit-users mailing list >>>JWe...@li... >>>https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>> >>> >>> >> >>------------------------------------------------------------------------------ >>Monitor your physical, virtual and cloud infrastructure from a single >>web console. Get in-depth insight into apps, servers, databases, vmware, >>SAP, cloud infrastructure, etc. Download 30-day Free Trial. >>Pricing starts from $795 for 25 servers or applications! >>http://p.sf.net/sfu/zoho_dev2dev_nov >>_______________________________________________ >>JWebUnit-users mailing list >>JWe...@li... >>https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> > > > |
From: Kenneth M. <kma...@at...> - 2012-11-22 01:08:19
|
Hu Julien, Thanks for getting back to me. Would you be able to publish a timestamped snapshot on the maven repo for the latest build? I'd like to use an artifact with a tracked version and an "official" origin, rather than an unversioned snapshot or one that I build myself from source. More generally, I've noticed that while you seem be fixing bugs and adding features to JWebUnit fairly quickly, you only seem to release new versions every few months. For example, the last release of JWebUnit depends on HtmlUnit 2.9, even though you've updated your code on trunk to use 2.10 and then 2.11. Is there a reason for this? We use JWebUnit heavily here, and we'd like to contribute some of our patches, but a slow release cycle makes this difficult to manage. Would you be willing to go to a faster release cycle? Many thanks, Kenny On 21 November 2012 18:57, Julien HENRY <he...@ya...> wrote: > Can you give a try to the latest snapshot version? > > Maven repo: http://oss.sonatype.org/content/repositories/snapshots/ > Bundle: > https://dl.dropbox.com/u/20894864/jwebunit-3.1-SNAPSHOT-release.zip > > > If you can confirm everything is fine I will try to publish a release in > the coming days. > > Regards, > > Julien > > >________________________________ > > De : Kenneth MacLeod <kma...@at...> > >À : jwe...@li... > >Envoyé le : Mercredi 21 novembre 2012 1h24 > >Objet : [JWebUnit-users] New version of JWebUnit incorporating HtmlUnit > 2.11? > > > > > >Hi there, > > > >There was a new version of HtmlUnit released recently (2.11) which > incorporates a major bugfix for us. However, JWebUnit-HtmlUnit-Plugin does > not compile against this version of HtmlUnit. > > > >Can we have a new release of JWebUnit incorporating this new HtmlUnit > dependency, please? > > > >Regards, > >Kenny > > > > > > >------------------------------------------------------------------------------ > >Monitor your physical, virtual and cloud infrastructure from a single > >web console. Get in-depth insight into apps, servers, databases, vmware, > >SAP, cloud infrastructure, etc. Download 30-day Free Trial. > >Pricing starts from $795 for 25 servers or applications! > >http://p.sf.net/sfu/zoho_dev2dev_nov > >_______________________________________________ > >JWebUnit-users mailing list > >JWe...@li... > >https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > > > > > > > > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from $795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > |
From: Julien H. <he...@ya...> - 2012-11-21 07:57:39
|
Can you give a try to the latest snapshot version? Maven repo: http://oss.sonatype.org/content/repositories/snapshots/ Bundle: https://dl.dropbox.com/u/20894864/jwebunit-3.1-SNAPSHOT-release.zip If you can confirm everything is fine I will try to publish a release in the coming days. Regards, Julien >________________________________ > De : Kenneth MacLeod <kma...@at...> >À : jwe...@li... >Envoyé le : Mercredi 21 novembre 2012 1h24 >Objet : [JWebUnit-users] New version of JWebUnit incorporating HtmlUnit 2.11? > > >Hi there, > >There was a new version of HtmlUnit released recently (2.11) which incorporates a major bugfix for us. However, JWebUnit-HtmlUnit-Plugin does not compile against this version of HtmlUnit. > >Can we have a new release of JWebUnit incorporating this new HtmlUnit dependency, please? > >Regards, >Kenny > > >------------------------------------------------------------------------------ >Monitor your physical, virtual and cloud infrastructure from a single >web console. Get in-depth insight into apps, servers, databases, vmware, >SAP, cloud infrastructure, etc. Download 30-day Free Trial. >Pricing starts from $795 for 25 servers or applications! >http://p.sf.net/sfu/zoho_dev2dev_nov >_______________________________________________ >JWebUnit-users mailing list >JWe...@li... >https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > > |
From: Kenneth M. <kma...@at...> - 2012-11-21 00:51:48
|
Hi there, There was a new version of HtmlUnit released recently (2.11) which incorporates a major bugfix for us. However, JWebUnit-HtmlUnit-Plugin does not compile against this version of HtmlUnit. Can we have a new release of JWebUnit incorporating this new HtmlUnit dependency, please? Regards, Kenny |
From: Julien H. <he...@ya...> - 2012-11-13 16:11:37
|
Hi Cyril, I don't have the same error running the same test. I have error like: 9248 [main] ERROR com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter - runtimeError: message=[An invalid or illegal selector was specified (selector: '[test^='']' error: Invalid selectors: [test^='']).] sourceName=[http://www.primefaces.org/showcase/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces] line=[21] lineSource=[null] lineOffset=[0] Can you tell me what is present in your Maven dependencies classpath in Eclipse? I still suspect that we don't use the same version. Regards, Julien [1] http://sourceforge.net/p/htmlunit/bugs/1171/ >________________________________ > De : "Nestor, Cyril" <cn...@bi...> >À : 'Julien HENRY' <he...@ya...> >Cc : "Parham, Clinton" <cp...@bi...> >Envoyé le : Mardi 13 novembre 2012 16h32 >Objet : PrimeFaces issue. > > >Hi Julien, > >Thanks for the answer. >I still have the error with the 3.1 SNAPSHOT you provided. My JDK is 1.6 (java version "1.6.0_31"). I enclosed my workspace definition below. You can see that running the test against the Primefaces demo site generates some errors. >Furthermore if I run this test against the Richfaces demo site ("http://livedemo.exadel.com/richfaces-demo"), I don’t have any error, thus reinforcing the fact that my configuration might be correct. >It looks to me that the problem is related to Primefaces only. > >What’s your thought? > >Thanks again > >Cyril > > >From:Julien HENRY [mailto:he...@ya...] >Sent: Monday, November 12, 2012 12:49 PM >To: Nestor, Cyril; Usageproblemsfor J Web Unit >Subject: Re: [JWebUnit-users] clickElementByXPath failing - Update > >Hi Cyril, > >I don't think the 3.1-SNAPSHOT you are using contains the release version of HtmlUnit 2.11. I have just updated JWebUnit to HtmlUnit 2.11 and I don't reproduce your issue. > >Could you please test with this new snapshot? > >Maven repo: http://oss.sonatype.org/content/repositories/snapshots/ >Bundle: https://dl.dropbox.com/u/20894864/jwebunit-3.1-SNAPSHOT-release.zip > >Please note that HtmlUnit 2.11 now require Java 1.6 or better. So JWebUnit now has the same requirement. > >Regards, > >Julien > >> >>________________________________ >> >>De :"Nestor, Cyril" <cn...@bi...> >>À : 'Julien HENRY' <he...@ya...> >>Envoyé le : Vendredi 9 novembre 2012 21h30 >>Objet : RE: [JWebUnit-users] clickElementByXPath failing - Update >> >>Hello Julien, >> >>I was going to open a new bug for jwebUnit but I am in the process of recovering my Sourceforge password. In the meantime, I am sending you this email to make sure it's really a bug. >> >>I have this error message while running the test enclosed below against the primeFaces demo site. >>ERROR [com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter] (main) runtimeError: message=[An invalid or illegal string was specified] sourceName=[http://www.primefaces.org/showcase/javax.faces.resource/jquery/jquery.js.jsf;jsessionid=1i1zwse0ey68579ixl1pmzv5v?ln=primefaces] line=[21] lineSource=[null] lineOffset=[0] >>The error occurs 3 times but the test completes successfully. When I run a similar test against our primefaces platform, I have the same error an infinite number of times and the test fails. >>ERROR [com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter] (main) runtimeError: message=[An invalid or illegal string was specified] sourceName=[http://bio213:8080/mat/primefaces_resource/2.0.1-SNAPSHOT/jquery/jquery.js] line=[91] lineSource=[null] lineOffset=[0] >> >> >>I tried jwebUnit 3.0 and 3.1 (Snapshot) you created for us a couple of months ago. I am running htmlUnit 2.11 >>I googled the error but no luck so far. >> >>Thanks for your input. >> >>Cyril >> >> >>------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- >>package com.biosignia.mat.functionalTests; >> >>import net.sourceforge.jwebunit.junit.WebTester; >>import org.junit.Before; >>import org.junit.Test; >> >>public class webunitTest extends WebTester { >> >> @Before >> public void setUp() throws Exception { >> setBaseUrl("http://www.primefaces.org/showcase/ui"); >> } >> >> @Test >> public void test1() { >> // PrimeFaces Demo site >> this.beginAt("/home.jsf"); >> clickLinkWithExactText("Button"); >> assertTextPresent("Bookmark"); >> clickElementByXPath("//span[contains(.,'Bookmark')]"); >> assertTextPresent("productDetail.xhtml"); >> } >>} >>------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- >> >>-----Original Message----- >>From: Julien HENRY [mailto:he...@ya...] >>Sent: Friday, September 07, 2012 10:16 AM >>To: Nestor, Cyril >>Cc: Parham, Clinton >>Subject: Re: [JWebUnit-users] clickElementByXPath failing - Update >> >>No problem Cyril. >> >> >>Last HtmlUnit release was not so distant so I think you will have to wait or tell them you need a release on their ML. Once HtmlUnit is released, just ask for a release on JWebUnit ML and it could be done usually in one day. >> >>Regards, >> >>Julien >> >>>________________________________ >>> De : "Nestor, Cyril" <cn...@bi...> À : 'Julien HENRY' >>><he...@ya...> Cc : "Parham, Clinton" <cp...@bi...> >>>Envoyé le : Vendredi 7 septembre 2012 15h46 Objet : RE: >>>[JWebUnit-users] clickElementByXPath failing - Update >>> >>> >>>My bad, I definitely missed it when I exploded the file in my temp directory. >>> >>>The getElementByXPath() method is now working properly. >>>Do you know what’s the timeframe for the next release that will include these changes (HtmlUnit and jWebUnit)? >>> >>>Thank you very much for your help Julien. >>> >>>Have a good weekend. >>> >>>Cyril >>> >>>From:Julien HENRY [mailto:he...@ya...] >>>Sent: Friday, September 07, 2012 3:11 AM >>>To: Nestor, Cyril >>>Cc: Parham, Clinton >>>Subject: Re: [JWebUnit-users] clickElementByXPath failing - Update >>> >>>Hi Cyril, >>> >>>Please use jwebunit-htmlunit-plugin-3.1-SNAPSHOT that is included in the zip (at the root but not in the lib folder) (see attached image). >>>Regards, >>> >>>Julien >>> >>>>________________________________ >>>> De : "Nestor, Cyril" <cn...@bi...> À : 'Julien HENRY' >>>><he...@ya...> Cc : "Parham, Clinton" <cp...@bi...> >>>>Envoyé le : Jeudi 6 septembre 2012 23h21 Objet : RE: [JWebUnit-users] >>>>clickElementByXPath failing - Update >>>> >>>> >>>>Hey Julien, >>>> >>>>I tested the new snapshot and got the same error: >>>>java.lang.NoSuchFieldError: FIREFOX_3 >>>> at >>>>net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.<init>(Htm >>>>lUnitTestingEngineImpl.java:175) >>>> at >>>>sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) >>>> >>>>The error occurs in the jwebunit-htmlunit-plugin-3.0.jar, however, the snapshot you included does not include this library. Who does maintain it? >>>> >>>>I enclosed a snapshot of my libraries in case it’s a setup issue. >>>> >>>>Thanks a lot >>>> >>>>Cyril >>>> >>>> >>>>-----Original Message----- >>>>From: Julien HENRY [mailto:he...@ya...] >>>>Sent: Thursday, September 06, 2012 4:33 PM >>>>To: Nestor, Cyril >>>>Cc: Parham, Clinton >>>>Subject: Re: [JWebUnit-users] clickElementByXPath failing - Update >>>> >>>>Please try this SNAPSHOT : >>>>http://dl.dropbox.com/u/20894864/jwebunit-3.1-SNAPSHOT-release.zip >>>> >>>>Regards, >>>> >>>>Julien >>>> >>>> >>>> >>>> >>>>----- Mail original ----- >>>>> De : "Nestor, Cyril" <cn...@bi...> À : 'Julien HENRY' >>>>> <he...@ya...> Cc : "Parham, Clinton" <cp...@bi...> >>>>> Envoyé le : Jeudi 6 septembre 2012 15h23 Objet : RE: >>>>> [JWebUnit-users] clickElementByXPath failing - Update >>>>> >>>>>T hanks Julien for looking into it! >>>>> >>>>> Cyril >>>>> >>>>> -----Original Message----- >>>>> From: Julien HENRY [mailto:he...@ya...] >>>>> Sent: Thursday, September 06, 2012 7:17 AM >>>>> To: Nestor, Cyril >>>>> Subject: Re: [JWebUnit-users] clickElementByXPath failing - Update >>>>> >>>>> Hi Cyril, >>>>> >>>>> >>>>> It seems there is an API change. I will try to publish a SNAPSHOT >>>>> version of JWebUnit but I have to wait to be at home this evening >>>>> (not able to build from work). >>>>> >>>>> Feel free to remind me tomorrow in case I forgot to do it. >>>>> >>>>> Regards, >>>>> >>>>> Julien >>>>> >>>>>> ________________________________ >>>>>> De : "Nestor, Cyril" <cn...@bi...> À : >>>>> "'he...@ya...'" >>>>>> <he...@ya...> Cc : "Parham, Clinton" >>>>> <cp...@bi...> >>>>>> Envoyé le : Mercredi 5 septembre 2012 23h11 Objet : RE: >>>>>> [JWebUnit-users] clickElementByXPath failing - Update >>>>>> >>>>>> Hello Julien, >>>>>> >>>>>> I am working with Clinton and tried the latest HtmlUnit build this >>>>> afternoon. I used the dependencies build as other jars are required. >>>>>> When I am testing I have the following error which seems to be >>>>>> related to >>>>> jWebUnit. >>>>>> We use jwebunit-htmlunit-plugin-3.0.jar, is there a newer version >>>>>> of >>>>> jWebUnit that we should use compatible with the latest HtmlUnit release? >>>>>> >>>>>> Thanks a lot. >>>>>> >>>>>> Cyril >>>>>> >>>>>> java.lang.NoSuchFieldError: FIREFOX_3 >>>>>> at >>>>>> net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.<init>( >>>>>> Ht >>>>>> ml >>>>>> UnitTestingEngineImpl.java:175) >>>>>> at >>>>>> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native >>>>>> Method) >>>>>> at >>>>>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstru >>>>>> ct >>>>>> or >>>>>> AccessorImpl.java:39) >>>>>> at >>>>>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Delegatin >>>>>> gC >>>>>> on >>>>>> structorAccessorImpl.java:27) >>>>>> at >>>>>> java.lang.reflect.Constructor.newInstance(Constructor.java:513) >>>>>> at java.lang.Class.newInstance0(Class.java:355) >>>>>> at java.lang.Class.newInstance(Class.java:308) >>>>>> at >>>>>> net.sourceforge.jwebunit.junit.WebTester.initializeDialog(WebTester >>>>>> .j >>>>>> av >>>>>> a:139) >>>>>> at >>>>>> net.sourceforge.jwebunit.junit.WebTester.getTestingEngine(WebTester >>>>>> .j >>>>>> av >>>>>> a:119) >>>>>> at >>>>>> net.sourceforge.jwebunit.junit.WebTester.beginAt(WebTester.java:226 >>>>>> ) >>>>>> at >>>>>> com.biosignia.saasPlatform.functionalTests.EmailsTabTestCase.goToMa >>>>>> il >>>>>> Bo >>>>>> x(EmailsTabTestCase.java:382) >>>>>> at >>>>>> com.biosignia.saasPlatform.functionalTests.EmailsTabTestCase.delete >>>>>> Al >>>>>> lO >>>>>> ldEmails(EmailsTabTestCase.java:295) >>>>>> at >>>>>> com.biosignia.saasPlatform.functionalTests.EmailsTabTestCase.testAu >>>>>> to >>>>>> ma >>>>>> tedEmails(EmailsTabTestCase.java:52) >>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native >>>>>> Method) >>>>>> at >>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. >>>>>> ja >>>>>> va:39) >>>>>> at >>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc >>>>>> es >>>>>> so >>>>>> rImpl.java:25) >>>>>> at java.lang.reflect.Method.invoke(Method.java:597) >>>>>> at >>>>>> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Framewo >>>>>> rk >>>>>> Me >>>>>> thod.java:44) >>>>>> at >>>>>> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveC >>>>>> al >>>>>> la >>>>>> ble.java:15) >>>>>> at >>>>>> org.junit.runners.model.FrameworkMethod.invokeExplosively(Framework >>>>>> Me >>>>>> th >>>>>> od.java:41) >>>>>> at >>>>>> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeM >>>>>> et >>>>>> ho >>>>>> d.java:20) >>>>>> at >>>>>> org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48) >>>>>> at >>>>>> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores. >>>>>> ja >>>>>> va:28) >>>>>> at >>>>>> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters. >>>>>> ja >>>>>> va >>>>>> :31) >>>>>> at >>>>>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassR >>>>>> un >>>>>> ne >>>>>> r.java:76) >>>>>> at >>>>>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassR >>>>>> un >>>>>> ne >>>>>> r.java:50) >>>>>> at >>>>>> org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) >>>>>> at >>>>>> org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) >>>>>> at >>>>>> org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) >>>>>> at >>>>>> org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) >>>>>> at >>>>>> org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) >>>>>> at >>>>>> org.junit.runners.ParentRunner.run(ParentRunner.java:236) >>>>>> at >>>>>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUni >>>>>> t4 >>>>>> Te >>>>>> stReference.java:49) >>>>>> at >>>>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecuti >>>>>> on >>>>>> .j >>>>>> ava:38) >>>>>> at >>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Rem >>>>>> ot >>>>>> eT >>>>>> estRunner.java:467) >>>>>> at >>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Rem >>>>>> ot >>>>>> eT >>>>>> estRunner.java:683) >>>>>> at >>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTe >>>>>> st >>>>>> Ru >>>>>> nner.java:390) >>>>>> at >>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteT >>>>>> es >>>>>> tR >>>>>> unner.java:197) >>>>>> >>>>>> java.lang.NoSuchFieldError: FIREFOX_3 >>>>>> at >>>>>> net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.<init>( >>>>>> Ht >>>>>> ml >>>>>> UnitTestingEngineImpl.java:175) >>>>>> at >>>>>> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native >>>>>> Method) >>>>>> at >>>>>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstru >>>>>> ct >>>>>> or >>>>>> AccessorImpl.java:39) >>>>>> at >>>>>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Delegatin >>>>>> gC >>>>>> on >>>>>> structorAccessorImpl.java:27) >>>>>> at >>>>>> java.lang.reflect.Constructor.newInstance(Constructor.java:513) >>>>>> at java.lang.Class.newInstance0(Class.java:355) >>>>>> at java.lang.Class.newInstance(Class.java:308) >>>>>> at >>>>>> net.sourceforge.jwebunit.junit.WebTester.initializeDialog(WebTester >>>>>> .j >>>>>> av >>>>>> a:139) >>>>>> at >>>>>> net.sourceforge.jwebunit.junit.WebTester.getTestingEngine(WebTester >>>>>> .j >>>>>> av >>>>>> a:119) >>>>>> at >>>>>> net.sourceforge.jwebunit.junit.WebTester.closeBrowser(WebTester.java: >>>>>> 15 >>>>>> 9) >>>>>> at >>>>>> com.biosignia.framework.functionalTests.FrameworkTestCase.tearDown( >>>>>> Fr >>>>>> am >>>>>> eworkTestCase.java:155) >>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native >>>>>> Method) >>>>>> at >>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. >>>>>> ja >>>>>> va:39) >>>>>> at >>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc >>>>>> es >>>>>> so >>>>>> rImpl.java:25) >>>>>> at java.lang.reflect.Method.invoke(Method.java:597) >>>>>> at >>>>>> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Framewo >>>>>> rk >>>>>> Me >>>>>> thod.java:44) >>>>>> at >>>>>> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveC >>>>>> al >>>>>> la >>>>>> ble.java:15) >>>>>> at >>>>>> org.junit.runners.model.FrameworkMethod.invokeExplosively(Framework >>>>>> Me >>>>>> th >>>>>> od.java:41) >>>>>> at >>>>>> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters. >>>>>> ja >>>>>> va >>>>>> :37) >>>>>> at >>>>>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassR >>>>>> un >>>>>> ne >>>>>> r.java:76) >>>>>> at >>>>>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassR >>>>>> un >>>>>> ne >>>>>> r.java:50) >>>>>> at >>>>>> org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) >>>>>> at >>>>>> org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) >>>>>> at >>>>>> org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) >>>>>> at >>>>>> org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) >>>>>> at >>>>>> org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) >>>>>> at >>>>>> org.junit.runners.ParentRunner.run(ParentRunner.java:236) >>>>>> at >>>>>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUni >>>>>> t4 >>>>>> Te >>>>>> stReference.java:49) >>>>>> at >>>>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecuti >>>>>> on >>>>>> .j >>>>>> ava:38) >>>>>> at >>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Rem >>>>>> ot >>>>>> eT >>>>>> estRunner.java:467) >>>>>> at >>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Rem >>>>>> ot >>>>>> eT >>>>>> estRunner.java:683) >>>>>> at >>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTe >>>>>> st >>>>>> Ru >>>>>> nner.java:390) >>>>>> at >>>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteT >>>>>> es >>>>>> tR >>>>>> unner.java:197) >>>>>> >>>>>> >>>>>> -----Original Message----- >>>>>> From: Parham, Clinton >>>>>> Sent: Tuesday, September 04, 2012 12:47 PM >>>>>> To: Nestor, Cyril >>>>>> Subject: FW: [JWebUnit-users] clickElementByXPath failing >>>>>> >>>>>> FYI... >>>>>> >>>>>> -----Original Message----- >>>>>> From: Julien HENRY [mailto:he...@ya...] >>>>>> Sent: Saturday, September 01, 2012 2:40 PM >>>>>> To: Parham, Clinton; Usage problems for JWebUnit >>>>>> Subject: Re: [JWebUnit-users] clickElementByXPath failing >>>>>> >>>>>> Hi Clint, >>>>>> >>>>>> >>>>>> Your issue is supposed to be fixed in HtmlUnit trunk. I don't have >>>>>> the >>>>> time to check but feel free to download [1] and keep us informed. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Julien >>>>>> >>>>>> [1] >>>>>> http://build.canoo.com/htmlunit/artifacts//htmlunit-2.11-SNAPSHOT.j >>>>>> ar >>>>>> >>>>>> >>>>>> ----- Mail original ----- >>>>>>> De : "Parham, Clinton" <cp...@bi...> À : >>>>> Julien HENRY >>>>>>> <he...@ya...>; Usage problems for JWebUnit >>>>>>><jwe...@li...> >>>>>>> Cc : >>>>>>> Envoyé le : Vendredi 24 août 2012 2h41 Objet : RE: >>>>>>>[JWebUnit-users] clickElementByXPath failing >>>>>>> >>>>>>> T hank you for investigating and identifying the problem. >>>>>>> >>>>>>> We will proceed with your suggestion and track the HTMLUnit bug >>>>> submission. >>>>>>> >>>>>>> -----Original Message----- >>>>>>> From: Julien HENRY [mailto:he...@ya...] >>>>>>> Sent: Wednesday, August 22, 2012 5:29 PM >>>>>>> To: Usage problems for JWebUnit >>>>>>> Subject: Re: [JWebUnit-users] clickElementByXPath failing >>>>>>> >>>>>>> Clint, >>>>>>> >>>>>>> I managed to found part of the problem. You are serving your >>>>>>>webpages with xhtml namespace. See >>>>> xmlns="http://www.w3.org/1999/xhtml";;; >>>>>>> >>>>>>> >>>>>>> As a result your xpath expressions seems to nned to be namespace aware. >>>>>>> //* means any element in any namespace but //tr means tr in no >>>>>>>namespace => not found >>>>>>> >>>>>>> >>>>>>> [1] was a good source of help even if it is a bit outdated. This >>>>>>>strange xpath expression is working: >>>>>>> //:tr[@id='genTabViewId:genTabFrm:availableGroups:source::0'] >>>>>>> so it seems the part of your UI updated by richfaces/ajax is in a >>>>>>>different namespace. >>>>>>> >>>>>>> >>>>>>> Now question is why the namespace prefix is required after an >>>>>>>AJAX partial refresh. I guess this is because richfaces send the >>>>>>>ajax response with content type = text/xml but not sure. I managed >>>>>>>to create a reproducible test case with HtmlUnit API and I have >>>>>>>submitted >>>>> a bug [2]. >>>>>>> >>>>>>> >>>>>>> Waiting for a potential fix in HtmlUnit I suggest you use >>>>>>>//*[@id='xxx'] expression in order to not break your tests in >>>>> the future if they provide a fix. >>>>>>> >>>>>>> >>>>>>> Hope this helps, >>>>>>> >>>>>>> Julien >>>>>>> >>>>>>> >>>>>>> [1] http://old.nabble.com/Re%3A-htmlunit-and-xpath-p22810034.html >>>>>>> [2] >>>>>>> >>>>> https://sourceforge.net/tracker/?func=detail&aid=3560821&group_id=47 >>>>> 0 >>>>>>> 3 >>>>>>> 8&atid=448266 >>>>>>> >>>>>>>> ________________________________ >>>>>>>> De : Julien HENRY <he...@ya...> À : Usage problems for >>>>>>>>JWebUnit <jwe...@li...> >>>>>>>> Envoyé le : Mercredi 22 août 2012 9h13 Objet : Re: >>>>>>>> [JWebUnit-users] clickElementByXPath failing >>>>>>>> >>>>>>>> Hi guys, >>>>>>>> >>>>>>>> Jevon, in the same file I see: >>>>>>>> >>>>>>>> <tr class="rich-picklist-source-row" >>>>>>> id="genTabViewId:genTabFrm:availableGroups:source::0"> >>>>>>>> <td class="rich-picklist-source-cell"> >>>>>>>> <img alt=" " >>>>>>> >>>>> src="/saas/spring/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/images/spacer.gif" >>>>>>> style="width:1px;height:1px;"/> >>>>>>>> CPARHAMsaasBill1Pri1 >>>>>>>> <input autocomplete="off" >>>>>>> >>>>> id="genTabViewId:genTabFrm:availableGroups:source::0StateInput" >>>>>>> name="genTabViewId:genTabFrm:availableGroups:source::0" >>>>>>> type="hidden" value="124685"/> >>>>>>>> </td> >>>>>>>> </tr> >>>>>>>> >>>>>>>> >>>>>>>> so for me there is actually a tr with >>>>>>> id=genTabViewId:genTabFrm:availableGroups:source::0 >>>>>>>> >>>>>>>> >>>>>>>> Clint, I have created a small test case (removing all relative >>>>>>>>js/css >>>>>>> imports from the html) and it is working fine: >>>>>>>> >>>>>>>> URL url = >>>>> this.getClass().getResource("/dump0b.html"); >>>>>>>> String urlStr = url.toString(); >>>>>>>> String baseUrl = urlStr.substring(0, >>>>>>> urlStr.lastIndexOf("/")); >>>>>>>> getTestContext().setBaseUrl(baseUrl); >>>>>>>> setScriptingEnabled(false); //Need to disable JS because >>>>>>>> of missing >>>>>>> external references >>>>>>>> beginAt("/dump0b.html"); >>>>>>>> >>>>>>> >>>>> assertNotNull(getElementById("genTabViewId:genTabFrm:availableGroups: >>>>>>> s >>>>>>> ource::0")); >>>>>>>> assertEquals(1, >>>>>>> >>>>> getElementsByXPath("//tr[@id='genTabViewId:genTabFrm:availableGroups: >>>>>>> s >>>>>>> ource::0']").size()); >>>>>>>> >>>>>>>> >>>>>>>> So the problem should come from JS, but unfortunately I can't >>>>> help >>>>>>> without a reproducible test case. I mean some standalone html + >>>>>>>java like the previous test. If you manage to extract all JS >>>>>>>references of your framework (I guess JSF + richfaces) and create >>>>>>>a test case it would be possible to investigate. >>>>>>>> Regards, >>>>>>>> >>>>>>>> Julien >>>>>>>> >>>>>>>> >>>>>>>>> ________________________________ >>>>>>>>> De : jevon <je...@je...> >>>>>>>>> À : Usage problems for JWebUnit >>>>>>> <jwe...@li...> >>>>>>>>> Envoyé le : Mercredi 22 août 2012 4h44 Objet : Re: >>>>> [JWebUnit-users] >>>>>>>>> clickElementByXPath failing >>>>>>>>> >>>>>>>>> Hi Clint, >>>>>>>>> >>>>>>>>> When I look at that source, it doesn't look like *any* >>>>> object has >>>>>>>>> an id of >>>>> 'genTabViewId:genTabFrm:availableGroups:source::0'. There >>>>>>> is an >>>>>>>>> object with a @name of >>>>>>>>> 'genTabViewId:genTabFrm:availableGroups:source::0', but >>>>> that is >>>>>>> an >>>>>>>>> <input>... >>>>>>>>> >>>>>>>>> Perhaps the id="" attribute is not escaped properly >>>>> (and the >>>>>>> engine >>>>>>>>> has to drop it). The valid characters for an ID attribute in >>>>> HTML >>>>>>>>> 4.01 are /[a-z][a-z0-9:-_\.]*/i, so it's not that the >>>>> id attribute >>>>>>>>> is incorrect - likewise, <tr>s are allowed in HTML 4.01 >>>>> to have id >>>>>>>>> attributes. >>>>>>>>> >>>>>>>>> In fact, *none* of the elements in that XML source have an id >>>>>>>>>attribute. Interesting. >>>>>>>>> >>>>>>>>> Jevon >>>>>>>>> >>>>>>>>> On Sat, Aug 18, 2012 at 1:19 AM, Parham, Clinton >>>>>>> <cp...@bi...> wrote: >>>>>>>>>> Hi Julien, >>>>>>>>>> >>>>>>>>>> Thank you for replying. >>>>>>>>>> >>>>>>>>>> I have attached the asXML dump of the page after >>>>>>> Thread.sleep(10000) to account for AJAX activity. >>>>>>>>>> >>>>>>>>>> When I open the dumped content in Chrome and enter the >>>>> following >>>>>>> into the JavaScript console, the "tr" I'm trying to click >>>>> is >>>>>>> found: >>>>>>>>>> >>>>>>> >>>>> $x("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']") >>>>>>>>>> >>>>>>>>>> Looking forward to your perspective. >>>>>>>>>> >>>>>>>>>> Clint >>>>>>>>>> >>>>>>>>>> -----Original Message----- >>>>>>>>>> From: Julien HENRY [mailto:he...@ya...] >>>>>>>>>> Sent: Friday, August 17, 2012 3:25 AM >>>>>>>>>> To: Usage problems for JWebUnit >>>>>>>>>> Subject: Re: [JWebUnit-users] clickElementByXPath failing >>>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I've just tested to locate a tr element by id using >>>>> the same >>>>>>> xpath expression and it is working fine. Are you not encountering >>>>> timing issue? >>>>>>> If you are using AJAX to update the page there could be different >>>>>>>results depending on execution speed. >>>>>>>>>> >>>>>>>>>> Concerning diference between getPageSource and asXml Jevon >>>>> is >>>>>>> right: getPageSource returns the original source returned by the >>>>>>>server while asXml is a dump of the current state of the DOM. >>>>>>>>>> >>>>>>>>>> Could you please send us the result of asXml() when your >>>>> test >>>>>>> failed? >>>>>>>>>> >>>>>>>>>> Regards, >>>>>>>>>> >>>>>>>>>> Julien >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> ----- Mail original ----- >>>>>>>>>>> De : "Parham, Clinton" >>>>> <cp...@bi...> À : Usage >>>>>>>>>>> problems for JWebUnit >>>>>>> <jwe...@li...> >>>>>>>>>>> Cc : >>>>>>>>>>> Envoyé le : Vendredi 17 août 2012 4h57 Objet : Re: >>>>>>>>>>> [JWebUnit-users] clickElementByXPath failing >>>>>>>>>>> >>>>>>>>>>> When executing getElementsByXPath("//tr") I >>>>> get back >>>>>>> 88 matches. >>>>>>>>>>> >>>>>>>>>>> But it gets more interesting: >>>>>>>>>>> >>>>>>>>>>> The following (from my original clickElementByXPath) >>>>> returns >>>>>>> zero matches: >>>>>>>>>>> >>>>>>> >>>>> getElementsByXPath("//tr[@id='genTabViewId:genTabFrm:availableGroups: >>>>>>> s >>>>>>> ource::0']"); >>>>>>>>>>> >>>>>>>>>>> But this returns what I'm looking for (only >>>>> changed >>>>>>> "tr" to >>>>>>>>>>> "*"): >>>>>>>>>>> >>>>>>> >>>>> getElementsByXPath("//*[@id='genTabViewId:genTabFrm:availableGroups: >>>>> s >>>>>>> o >>>>>>> urce::0']"); >>>>>>>>>>> >>>>>>>>>>> This is what the debugger returns when Inspecting the >>>>> return >>>>>>> value of the above >>>>>>>>>>> statement - you can see it is a "tr": >>>>>>>>>>> [IElement[name=tr wrapped=HtmlTableRow[<tr >>>>>>>>>>> class="rich-picklist-source-row" >>>>>>>>>>> >>>>>>> id="genTabViewId:genTabFrm:availableGroups:source::0">]]] >>>>>>>>>>> >>>>>>>>>>> I would expect consistent results when calling both of >>>>> these >>>>>>> getElementsByXPath >>>>>>>>>>> methods. What's going on? >>>>>>>>>>> >>>>>>>>>>> Thanks. >>>>>>>>>>> >>>>>>>>>>> -----Original Message----- >>>>>>>>>>> From: jevon [mailto:je...@je...] >>>>>>>>>>> Sent: Thursday, August 16, 2012 8:56 PM >>>>>>>>>>> To: Usage problems for JWebUnit >>>>>>>>>>> Subject: Re: [JWebUnit-users] clickElementByXPath >>>>> failing >>>>>>>>>>> >>>>>>>>>>> Hi, >>>>>>>>>>> >>>>>>>>>>> I can't look at the JWebUnit source right now, but >>>>> it >>>>>>> sounds like >>>>>>>>>>> getPageSource() just dumps out the original source of >>>>> the page, >>>>>>> i.e. >>>>>>>>>>> without Javascript DOM modifications, whereas >>>>> page.asXml() >>>>>>> dumps the >>>>>>>>>>> runtime content of the page itself, i.e. after >>>>> Javascript/AJAX >>>>>>> has >>>>>>>>>>> modified the page. Or perhaps the source page does not >>>>>>> validate, thus >>>>>>>>>>> some of the elements are lost. >>>>>>>>>>> >>>>>>>>>>> What happens if you execute >>>>>>> getElementsByXPath("//tr")? >>>>>>>>>>> >>>>>>>>>>> Cheers >>>>>>>>>>> Jevon >>>>>>>>>>> >>>>>>>>>>> On Fri, Aug 17, 2012 at 8:47 AM, Parham, Clinton >>>>>>> <cp...@bi...> >>>>>>>>>>> wrote: >>>>>>>>>>>> Hello, >>>>>>>>>>>> >>>>>>>>>>>> We're using JWebUnit 3 to test a JSF web >>>>> application >>>>>>> that uses JBoss >>>>>>>>>>> RichFaces AJAX enabled components. >>>>>>>>>>>> >>>>>>>>>>>> At one point in the test, a call to >>>>>>>>>>> >>>>>>> >>>>> clickElementByXPath("//tr[@id='genTabViewId:genTabFrm:availableGroups: >>>>>>> source::0']") >>>>>>>>>>> is made but it fails with this: >>>>>>>>>>>> >>>>>>>>>>>> java.lang.AssertionError: Unable to locate >>>>> element with >>>>>>> xpath >>>>>>>>>>> >>>>>>> >>>>> "//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']" >>>>>>>>>>>> at org.junit.Assert.fail(Assert.java:91) >>>>>>>>>>>> at >>>>> org.junit.Assert.assertTrue(Assert.java:43) >>>>>>>>>>>> at >>>>>>>>>>> >>>>>>> >>>>>>> >>>>>>>net.sourceforge.jwebunit.junit.WebTester.assertElementPresentByXPat >>>>>>>h >>>>>>> ( >>>>>>> W >>>>>>> ebTester.java:2109) >>>>>>>>>>>> at >>>>>>>>>>> >>>>>>> >>>>>>> >>>>>>>net.sourceforge.jwebunit.junit.WebTester.clickElementByXPath(WebTes >>>>>>>t >>>>>>> e >>>>>>> r >>>>>>> .java:2673) >>>>>>>>>>>> at >>>>>>>>>>> >>>>>>> >>>>>>> >>>>>>>com.xyz.util.EnrollmentUtil.setGeneralTabFields(EnrollmentUtiljava: >>>>>>>1 >>>>>>> 6 >>>>>>> 5 >>>>>>> ) >>>>>>>>>>>> ... >>>>>>>>>>>> >>>>>>>>>>>> Just before making the clickElementByXPath call, >>>>> we >>>>>>> execute >>>>>>>>>>> Thread.sleep(5000) to account for AJAX activity and >>>>> then we >>>>>>> dump the page >>>>>>>>>>> content two ways to see what's going on: >>>>>>>>>>>> [1] FileUtils.writeStringToFile(new >>>>> File(filename), >>>>>>> getPageSource()); >>>>>>>>>>>> and >>>>>>>>>>>> [2] HtmlUnitTestingEngineImpl engine = >>>>>>> (HtmlUnitTestingEngineImpl) >>>>>>>>>>> getTestingEngine(); >>>>>>>>>>>> HtmlPage page = ((HtmlPage) >>>>>>> engine.getCurrentWindow().getEnclosedPage()); >>>>>>>>>>>> FileUtils.writeStringToFile(new File(filename), >>>>>>> page.asXml()); >>>>>>>>>>>> >>>>>>>>>>>> The dumps are different which is quite >>>>> surprising. When >>>>>>> viewing the file >>>>>>>>>>> generated by method [1] in Chrome, the "tr" >>>>> element >>>>>>> is not present. >>>>>>>>>>> But it is present when viewing the file generated by >>>>> method >>>>>>> [2]. >>>>>>>>>>>> >>>>>>>>>>>> What is happening? >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> The contents contained herein may contain >>>>> confidential >>>>>>> information. If you >>>>>>>>>>> are not the intended recipient, you are hereby >>>>> notified that >>>>>>> any disclosure, >>>>>>>>>>> copying, distribution, printing or action taken on the >>>>> contents >>>>>>> is strictly >>>>>>>>>>> prohibited. If you have received this email in error, >>>>> please >>>>>>> notify the sender >>>>>>>>>>> immediately and delete this message. >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>> >>>>>>> >>>>>>>------------------------------------------------------------------- >>>>>>>- >>>>>>> - >>>>>>> - >>>>>>> -------- >>>>>>>>>>>> Live Security Virtual Conference >>>>>>>>>>>> Exclusive live event will cover all the ways >>>>> today's >>>>>>> security and >>>>>>>>>>>> threat landscape has changed and how IT managers >>>>> can >>>>>>> respond. Discussions >>>>>>>>>>>> will include endpoint security, mobile security >>>>> and the >>>>>>> latest in malware >>>>>>>>>>>> threats. >>>>>>> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>> JWebUnit-users mailing list >>>>>>>>>>>> JWe...@li... >>>>>>>>>>>> >>>>>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>>>>>>>>> >>>>>>>>>>> >>>>>>> >>>>>>> >>>>>>>------------------------------------------------------------------- >>>>>>>- >>>>>>> - >>>>>>> - >>>>>>> -------- >>>>>>>>>>> Live Security Virtual Conference >>>>>>>>>>> Exclusive live event will cover all the ways >>>>> today's >>>>>>> security and >>>>>>>>>>> threat landscape has changed and how IT managers can >>>>> respond. >>>>>>> Discussions >>>>>>>>>>> will include endpoint security, mobile security and >>>>> the latest >>>>>>> in malware >>>>>>>>>>> threats. >>>>>>> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> JWebUnit-users mailing list >>>>>>>>>>> JWe...@li... >>>>>>>>>>> >>>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>>>>>>>>> >>>>>>>>>>> >>>>>>> >>>>>>> >>>>>>>------------------------------------------------------------------- >>>>>>>- >>>>>>> - >>>>>>> - >>>>>>> -------- >>>>>>>>>>> Live Security Virtual Conference >>>>>>>>>>> Exclusive live event will cover all the ways >>>>> today's >>>>>>> security and >>>>>>>>>>> threat landscape has changed and how IT managers can >>>>> respond. >>>>>>> Discussions >>>>>>>>>>> will include endpoint security, mobile security and >>>>> the latest >>>>>>> in malware >>>>>>>>>>> threats. >>>>>>> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> JWebUnit-users mailing list >>>>>>>>>>> JWe...@li... >>>>>>>>>>> >>>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>> >>>>>>> >>>>>>>------------------------------------------------------------------- >>>>>>>- >>>>>>> - >>>>>>> - >>>>>>> -------- >>>>>>>>>> Live Security Virtual Conference >>>>>>>>>> Exclusive live event will cover all the ways today's >>>>> security >>>>>>> and >>>>>>>>>> threat landscape has changed and how IT managers can >>>>> respond. >>>>>>> Discussions >>>>>>>>>> will include endpoint security, mobile security and the >>>>> latest in >>>>>>> malware >>>>>>>>>> threats. >>>>>>>>>> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>>>>>>>> _______________________________________________ >>>>>>>>>> JWebUnit-users mailing list >>>>>>>>>> JWe...@li... >>>>>>>>>> >>>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>>>>>>>> >>>>>>>>>> >>>>>>> >>>>>>> >>>>>>>------------------------------------------------------------------- >>>>>>>- >>>>>>> - >>>>>>> - >>>>>>> -------- >>>>>>>>>> Live Security Virtual Conference >>>>>>>>>> Exclusive live event will cover all the ways today's >>>>> security >>>>>>> and >>>>>>>>>> threat landscape has changed and how IT managers can >>>>> respond. >>>>>>> Discussions >>>>>>>>>> will include endpoint security, mobile security and the >>>>> latest in >>>>>>> malware >>>>>>>>>> threats. >>>>>>>>>> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>>>>>>>> _______________________________________________ >>>>>>>>>> JWebUnit-users mailing list >>>>>>>>>> JWe...@li... >>>>>>>>>> >>>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>> ------------------------------------------------------------------- >>>>>>>>> - >>>>>>>>> ---------- >>>>>>>>> Live Security Virtual Conference >>>>>>>>> Exclusive live event will cover all the ways today's >>>>> security and >>>>>>>>> threat landscape has changed and how IT managers can respond. >>>>>>> Discussions >>>>>>>>> will include endpoint security, mobile security and the latest >>>>> in >>>>>>> malware >>>>>>>>> threats. >>>>> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>>>>>>> _______________________________________________ >>>>>>>>> JWebUnit-users mailing list >>>>>>>>> JWe...@li... >>>>>>>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>> -------------------------------------------------------------------- >>>>>>>> - >>>>>>>> --------- >>>>>>>> Live Security Virtual Conference >>>>>>>> Exclusive live event will cover all the ways today's security >>>>> and >>>>>>>> threat landscape has changed and how IT managers can respond. >>>>>>>> Discussions will include endpoint security, mobile security and >>>>>>>>the latest in malware threats. >>>>>>>> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>>>>>> _______________________________________________ >>>>>>>> JWebUnit-users mailing list >>>>>>>> JWe...@li... >>>>>>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>>------------------------------------------------------------------- >>>>>>>- >>>>>>> - >>>>>>> - >>>>>>> -------- >>>>>>> Live Security Virtual Conference >>>>>>> Exclusive live event will cover all the ways today's security and >>>>>>>threat landscape has changed and how IT managers can respond. >>>>>>> Discussions will include endpoint security, mobile security and >>>>>>>the latest in malware threats. >>>>>>> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>>>>> _______________________________________________ >>>>>>> JWebUnit-users mailing list >>>>>>> JWe...@li... >>>>>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>>>>> >>>>>> >>>>>> The contents contained herein may contain confidential information. >>>>>> If you >>>>> are not the intended recipient, you are hereby notified that any >>>>> disclosure, copying, distribution, printing or action taken on the >>>>> contents is strictly prohibited. If you have received this email in >>>>> error, please notify the sender immediately and delete this message. >>>>>> >>>>>> >>>>>> >>>>> >>>> >>>> >>> >>> >> > > |
From: Vikram K. <cda...@gm...> - 2012-10-25 05:22:42
|
Hi Jevon, Thanks for the reply. Actually I am new in Web World and not getting which proxy or which firewall is blocking. Can you please guide me on this. thanks, Vikram On Fri, Oct 5, 2012 at 5:25 AM, jevon <je...@je...> wrote: > Hi Vikram, > > Are you behind any form of proxy or firewall? If so, you may need to > set authentication credentials. > > Otherwise you might need to pull out Wireshark and see what's actually > going on. > > Jevon > > On Thu, Oct 4, 2012 at 11:03 PM, Vikram Kumar <cda...@gm...> > wrote: > > Hi All, > > > > I am using jWebUnit to test our application where we have used the > > javascript http://www.google-analytics.com/ga.js . > > > > But while running our test case the jWebUnit is taking too much time to > > execute a single script (around 60 mins for a single method having 50 > lines > > of code.) > > And in the console it keeps on trying to access the google analytics > > javascript (Based upon the analytics log, we can see the request is timed > > out and re-tried). > > > > 14:09:28.073 [main] DEBUG o.a.h.i.c.DefaultClientConnectionOperator - > > Connect to _www.google-analytics.com:80 timed out. Connection will be > > retried using another IP address > > > > 14:09:28.073 [main] DEBUG o.a.h.i.c.DefaultClientConnectionOperator - > > Connecting to _www.google-analytics.com:80 > > > > 14:09:49.145 [main] DEBUG o.a.h.i.c.DefaultClientConnectionOperator - > > Connect to _www.google-analytics.com:80 timed out. Connection will be > > retried using another IP address > > > > 14:09:49.145 [main] DEBUG o.a.h.i.c.DefaultClientConnectionOperator - > > Connecting to _www.google-analytics.com:80 > > > > > > > > Please suggest me what to do. > > > > > > Thanks, > > > > Vikram > > > > > > > ------------------------------------------------------------------------------ > > Don't let slow site performance ruin your business. Deploy New Relic APM > > Deploy New Relic app performance management and know exactly > > what is happening inside your Ruby, Python, PHP, Java, and .NET app > > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > > http://p.sf.net/sfu/newrelic-dev2dev > > _______________________________________________ > > JWebUnit-users mailing list > > JWe...@li... > > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > > > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > |
From: jevon <je...@je...> - 2012-10-05 00:26:37
|
Hi Vikram, Are you behind any form of proxy or firewall? If so, you may need to set authentication credentials. Otherwise you might need to pull out Wireshark and see what's actually going on. Jevon On Thu, Oct 4, 2012 at 11:03 PM, Vikram Kumar <cda...@gm...> wrote: > Hi All, > > I am using jWebUnit to test our application where we have used the > javascript http://www.google-analytics.com/ga.js . > > But while running our test case the jWebUnit is taking too much time to > execute a single script (around 60 mins for a single method having 50 lines > of code.) > And in the console it keeps on trying to access the google analytics > javascript (Based upon the analytics log, we can see the request is timed > out and re-tried). > > 14:09:28.073 [main] DEBUG o.a.h.i.c.DefaultClientConnectionOperator - > Connect to _www.google-analytics.com:80 timed out. Connection will be > retried using another IP address > > 14:09:28.073 [main] DEBUG o.a.h.i.c.DefaultClientConnectionOperator - > Connecting to _www.google-analytics.com:80 > > 14:09:49.145 [main] DEBUG o.a.h.i.c.DefaultClientConnectionOperator - > Connect to _www.google-analytics.com:80 timed out. Connection will be > retried using another IP address > > 14:09:49.145 [main] DEBUG o.a.h.i.c.DefaultClientConnectionOperator - > Connecting to _www.google-analytics.com:80 > > > > Please suggest me what to do. > > > Thanks, > > Vikram > > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > |
From: Vikram K. <cda...@gm...> - 2012-10-04 10:03:29
|
Hi All, I am using jWebUnit to test our application where we have used the javascript *http://www.google-analytics.com/ga.js* . But while running our test case the jWebUnit is taking too much time to execute a single script (around 60 mins for a single method having 50 lines of code.) . And in the console it keeps on trying to access the google analytics javascript (Based upon the analytics log, we can see the request is timed out and re-tried). *14:09:28.073 [main] DEBUG o.a.h.i.c.DefaultClientConnectionOperator - Connect to _www.google-analytics.com:80 timed out. Connection will be retried using another IP address* *14:09:28.073 [main] DEBUG o.a.h.i.c.DefaultClientConnectionOperator - Connecting to _www.google-analytics.com:80* *14:09:49.145 [main] DEBUG o.a.h.i.c.DefaultClientConnectionOperator - Connect to _www.google-analytics.com:80 timed out. Connection will be retried using another IP address* *14:09:49.145 [main] DEBUG o.a.h.i.c.DefaultClientConnectionOperator - Connecting to _www.google-analytics.com:80* Please suggest me what to do. Thanks, Vikram |
From: Julien H. <he...@ya...> - 2012-09-26 11:19:08
|
Sorry for my misunderstanding. Could you please open an issue in Sourceforge project tracker [1]. I feel we could use "type" when appropriate in order that setTextField() triggers onkeyxx events. This way you would not be forced to expose JWebUnit internal implementation. Regards, Julien [1] http://sourceforge.net/tracker/?limit=25&func=&group_id=61302&atid=497982&assignee=&status=&category=&artgroup=&keyword=&submitter=&artifact_id=&assignee=&status=1&category=&artgroup=&submitter=&keyword=&artifact_id=&submit=Filter >________________________________ > De : S.R.G. Manoj <ma...@ho...> >À : "jwe...@li..." <jwe...@li...> >Envoyé le : Mercredi 26 septembre 2012 12h29 >Objet : Re: [JWebUnit-users] [HCSPAM] - Triggering javascript events -Email found in subject > > > >@Julien - The problem was not with onchange event, onchange event was getting triggered perfectly. The problem was with events like onkeyup, onmousedown, onkeypress. The solution given by Rajinder worked fine for my issue. > >@Rajjnder - Thanks for the solution, it worked perfectly fine . > >Regards, >Manoj > > >> Date: Wed, 26 Sep 2012 15:32:42 +0530 >> From: rs...@se... >> To: he...@ya...; jwe...@li... >> Subject: Re: [JWebUnit-users] [HCSPAM] - Triggering javascript events -Email found in subject >> >> Dear Julien, >> >> I had similar case in which the Button was enabled when I type something in the textbox, I tried various combination but casting to htmlunit and typing in the text box worked for me. >> >> In my case t was keyupevent and keypress events. >> >> Regards >> Rajinder >> >> -----Original Message----- >> From: Julien HENRY [mailto:he...@ya...] >> Sent: Wednesday, September 26, 2012 3:33 PM >> To: Usage problems for JWebUnit >> Subject: Re: [JWebUnit-users] [HCSPAM] - Triggering javascript events -Email found in subject >> >> @Rajinder Do you really need to cast to HtmlUnit specific implementation? >> >> @Manoj Can you try to click on another element (for example a div) after setting text in order to trigger the onchange event? >> >> >> Regards, >> >> Julien >> >> >> >________________________________ >> > De : Rajinder Singh <rs...@se...> >> >À : Usage problems for JWebUnit <jwe...@li...> >> >Envoyé le : Mercredi 26 septembre 2012 9h33 >> >Objet : Re: [JWebUnit-users] [HCSPAM] - Triggering javascript events - Email found in subject >> > >> > >> > >> >You can use this: >> > >> > >> HtmlUnitElementImpl htmlUnit = (HtmlUnitElementImpl) getElementById("xxx"); >> > try{ >> > setTextField("otpTokenPin", ""); >> > >> htmlUnit.getHtmlElement().type(“gfhghf”); >> > >> } catch(Exception e) { >> > >> e.printStackTrace(); >> > >> } >> > >> htmlUnit = (HtmlUnitElementImpl) getElementById("ddd"); >> > try{ >> > >> htmlUnit.getHtmlElement().click(); >> > >> } catch(IOException >> e1) { >> > >> e1.printStackTrace(); >> > >> } >> > >> > >> >From:S.R.G. Manoj >> [mailto:ma...@ho...] >> >Sent: Wednesday, September 26, 2012 11:22 AM >> >To: jwe...@li... >> >Subject: [HCSPAM] - [JWebUnit-users] Triggering javascript events - >> Email found in subject >> > >> >Hi, >> > >> >Can we trigger a javascript event using jWebUnit? >> >In my case i have a onkeyup event for a text box and when i this event is >> triggered a button needs to be enabled, >> >but when i set the value for the text box using >> 'setTextField("textfieldName","value") the event is not >> getting triggered. >> > >> > >> >Thank you! >> > >> >Regards, >> >Manoj >> >DISCLAIMER AND PRIVILEGE NOTICE: This e-mail and any files transmitted with it contain confidential, copyright, proprietary and legally privileged information. It should not be used by anyone who is not the original intended recipient. Any use, distribution, copying or disclosure by any other person is strictly prohibited. If you receive this transmission in error, please notify the sender by reply email and then destroy the message. Opinions, conclusions and other information in this message that do not relate to official business of Seasia Consulting and its subsidiaries, Internet communications cannot be guaranteed to be timely, Secure, error or virus-free. The sender does not accept liability for any errors or omissions." >> >Use GROTAL.COM - Make Life Easy ....... ( Like us on Facebook, See us on Youtube ) >> >------------------------------------------------------------------------------ >> >Live Security Virtual Conference >> >Exclusive live event will cover all the ways today's security and >> >threat landscape has changed and how IT managers can respond. Discussions >> >will include endpoint security, mobile security and the latest in malware >> >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> >_______________________________________________ >> >JWebUnit-users mailing list >> >JWe...@li... >> >https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> > >> > >> > >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> JWebUnit-users mailing list >> JWe...@li... >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> DISCLAIMER AND PRIVILEGE NOTICE: This e-mail and any files transmitted with it contain confidential, copyright, proprietary and legally privileged information. It should not be used by anyone who is not the original intended recipient. Any use, distribution, copying or disclosure by any other person is strictly prohibited. If you receive this transmission in error, please notify the sender by reply email and then destroy the message. Opinions, conclusions and other information in this message that do not relate to official business of Seasia Consulting and its subsidiaries, Internet communications cannot be guaranteed to be timely, Secure, error or virus-free. The sender does not accept liability for any errors or omissions." >> >> Use GROTAL.COM- Make Life Easy !!! >> >> >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> JWebUnit-users mailing list >> JWe...@li... >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users > >------------------------------------------------------------------------------ >Live Security Virtual Conference >Exclusive live event will cover all the ways today's security and >threat landscape has changed and how IT managers can respond. Discussions >will include endpoint security, mobile security and the latest in malware >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >_______________________________________________ >JWebUnit-users mailing list >JWe...@li... >https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > > |
From: S.R.G. M. <ma...@ho...> - 2012-09-26 10:29:44
|
@Julien - The problem was not with onchange event, onchange event was getting triggered perfectly. The problem was with events like onkeyup, onmousedown, onkeypress. The solution given by Rajinder worked fine for my issue. @Rajjnder - Thanks for the solution, it worked perfectly fine . Regards, Manoj > Date: Wed, 26 Sep 2012 15:32:42 +0530 > From: rs...@se... > To: he...@ya...; jwe...@li... > Subject: Re: [JWebUnit-users] [HCSPAM] - Triggering javascript events -Email found in subject > > Dear Julien, > > I had similar case in which the Button was enabled when I type something in the textbox, I tried various combination but casting to htmlunit and typing in the text box worked for me. > > In my case t was keyupevent and keypress events. > > Regards > Rajinder > > -----Original Message----- > From: Julien HENRY [mailto:he...@ya...] > Sent: Wednesday, September 26, 2012 3:33 PM > To: Usage problems for JWebUnit > Subject: Re: [JWebUnit-users] [HCSPAM] - Triggering javascript events -Email found in subject > > @Rajinder Do you really need to cast to HtmlUnit specific implementation? > > @Manoj Can you try to click on another element (for example a div) after setting text in order to trigger the onchange event? > > > Regards, > > Julien > > > >________________________________ > > De : Rajinder Singh <rs...@se...> > >À : Usage problems for JWebUnit <jwe...@li...> > >Envoyé le : Mercredi 26 septembre 2012 9h33 > >Objet : Re: [JWebUnit-users] [HCSPAM] - Triggering javascript events - Email found in subject > > > > > > > >You can use this: > > > > > HtmlUnitElementImpl htmlUnit = (HtmlUnitElementImpl) getElementById("xxx"); > > try{ > > setTextField("otpTokenPin", ""); > > > htmlUnit.getHtmlElement().type(“gfhghf”); > > > } catch(Exception e) { > > > e.printStackTrace(); > > > } > > > htmlUnit = (HtmlUnitElementImpl) getElementById("ddd"); > > try{ > > > htmlUnit.getHtmlElement().click(); > > > } catch(IOException > e1) { > > > e1.printStackTrace(); > > > } > > > > > >From:S.R.G. Manoj > [mailto:ma...@ho...] > >Sent: Wednesday, September 26, 2012 11:22 AM > >To: jwe...@li... > >Subject: [HCSPAM] - [JWebUnit-users] Triggering javascript events - > Email found in subject > > > >Hi, > > > >Can we trigger a javascript event using jWebUnit? > >In my case i have a onkeyup event for a text box and when i this event is > triggered a button needs to be enabled, > >but when i set the value for the text box using > 'setTextField("textfieldName","value") the event is not > getting triggered. > > > > > >Thank you! > > > >Regards, > >Manoj > >DISCLAIMER AND PRIVILEGE NOTICE: This e-mail and any files transmitted with it contain confidential, copyright, proprietary and legally privileged information. It should not be used by anyone who is not the original intended recipient. Any use, distribution, copying or disclosure by any other person is strictly prohibited. If you receive this transmission in error, please notify the sender by reply email and then destroy the message. Opinions, conclusions and other information in this message that do not relate to official business of Seasia Consulting and its subsidiaries, Internet communications cannot be guaranteed to be timely, Secure, error or virus-free. The sender does not accept liability for any errors or omissions." > >Use GROTAL.COM - Make Life Easy ....... ( Like us on Facebook, See us on Youtube ) > >------------------------------------------------------------------------------ > >Live Security Virtual Conference > >Exclusive live event will cover all the ways today's security and > >threat landscape has changed and how IT managers can respond. Discussions > >will include endpoint security, mobile security and the latest in malware > >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > >_______________________________________________ > >JWebUnit-users mailing list > >JWe...@li... > >https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > > > > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > DISCLAIMER AND PRIVILEGE NOTICE: This e-mail and any files transmitted with it contain confidential, copyright, proprietary and legally privileged information. It should not be used by anyone who is not the original intended recipient. Any use, distribution, copying or disclosure by any other person is strictly prohibited. If you receive this transmission in error, please notify the sender by reply email and then destroy the message. Opinions, conclusions and other information in this message that do not relate to official business of Seasia Consulting and its subsidiaries, Internet communications cannot be guaranteed to be timely, Secure, error or virus-free. The sender does not accept liability for any errors or omissions." > > Use GROTAL.COM- Make Life Easy !!! > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users |
From: Rajinder S. <rs...@se...> - 2012-09-26 10:09:22
|
Dear Julien, I had similar case in which the Button was enabled when I type something in the textbox, I tried various combination but casting to htmlunit and typing in the text box worked for me. In my case t was keyupevent and keypress events. Regards Rajinder -----Original Message----- From: Julien HENRY [mailto:he...@ya...] Sent: Wednesday, September 26, 2012 3:33 PM To: Usage problems for JWebUnit Subject: Re: [JWebUnit-users] [HCSPAM] - Triggering javascript events -Email found in subject @Rajinder Do you really need to cast to HtmlUnit specific implementation? @Manoj Can you try to click on another element (for example a div) after setting text in order to trigger the onchange event? Regards, Julien >________________________________ > De : Rajinder Singh <rs...@se...> >À : Usage problems for JWebUnit <jwe...@li...> >Envoyé le : Mercredi 26 septembre 2012 9h33 >Objet : Re: [JWebUnit-users] [HCSPAM] - Triggering javascript events - Email found in subject > > > >You can use this: > > HtmlUnitElementImpl htmlUnit = (HtmlUnitElementImpl) getElementById("xxx"); > try{ > setTextField("otpTokenPin", ""); > htmlUnit.getHtmlElement().type(“gfhghf”); > } catch(Exception e) { > e.printStackTrace(); > } > htmlUnit = (HtmlUnitElementImpl) getElementById("ddd"); > try{ > htmlUnit.getHtmlElement().click(); > } catch(IOException e1) { > e1.printStackTrace(); > } > > >From:S.R.G. Manoj [mailto:ma...@ho...] >Sent: Wednesday, September 26, 2012 11:22 AM >To: jwe...@li... >Subject: [HCSPAM] - [JWebUnit-users] Triggering javascript events - Email found in subject > >Hi, > >Can we trigger a javascript event using jWebUnit? >In my case i have a onkeyup event for a text box and when i this event is triggered a button needs to be enabled, >but when i set the value for the text box using 'setTextField("textfieldName","value") the event is not getting triggered. > > >Thank you! > >Regards, >Manoj >DISCLAIMER AND PRIVILEGE NOTICE: This e-mail and any files transmitted with it contain confidential, copyright, proprietary and legally privileged information. It should not be used by anyone who is not the original intended recipient. Any use, distribution, copying or disclosure by any other person is strictly prohibited. If you receive this transmission in error, please notify the sender by reply email and then destroy the message. Opinions, conclusions and other information in this message that do not relate to official business of Seasia Consulting and its subsidiaries, Internet communications cannot be guaranteed to be timely, Secure, error or virus-free. The sender does not accept liability for any errors or omissions." >Use GROTAL.COM - Make Life Easy ....... ( Like us on Facebook, See us on Youtube ) >------------------------------------------------------------------------------ >Live Security Virtual Conference >Exclusive live event will cover all the ways today's security and >threat landscape has changed and how IT managers can respond. Discussions >will include endpoint security, mobile security and the latest in malware >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >_______________________________________________ >JWebUnit-users mailing list >JWe...@li... >https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > > ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ JWebUnit-users mailing list JWe...@li... https://lists.sourceforge.net/lists/listinfo/jwebunit-users DISCLAIMER AND PRIVILEGE NOTICE: This e-mail and any files transmitted with it contain confidential, copyright, proprietary and legally privileged information. It should not be used by anyone who is not the original intended recipient. Any use, distribution, copying or disclosure by any other person is strictly prohibited. If you receive this transmission in error, please notify the sender by reply email and then destroy the message. Opinions, conclusions and other information in this message that do not relate to official business of Seasia Consulting and its subsidiaries, Internet communications cannot be guaranteed to be timely, Secure, error or virus-free. The sender does not accept liability for any errors or omissions." Use GROTAL.COM- Make Life Easy !!! |
From: Julien H. <he...@ya...> - 2012-09-26 10:03:22
|
@Rajinder Do you really need to cast to HtmlUnit specific implementation? @Manoj Can you try to click on another element (for example a div) after setting text in order to trigger the onchange event? Regards, Julien >________________________________ > De : Rajinder Singh <rs...@se...> >À : Usage problems for JWebUnit <jwe...@li...> >Envoyé le : Mercredi 26 septembre 2012 9h33 >Objet : Re: [JWebUnit-users] [HCSPAM] - Triggering javascript events - Email found in subject > > > >You can use this: > > HtmlUnitElementImpl htmlUnit = (HtmlUnitElementImpl) getElementById("xxx"); > try{ > setTextField("otpTokenPin", ""); > htmlUnit.getHtmlElement().type(“gfhghf”); > } catch(Exception e) { > e.printStackTrace(); > } > htmlUnit = (HtmlUnitElementImpl) getElementById("ddd"); > try{ > htmlUnit.getHtmlElement().click(); > } catch(IOException e1) { > e1.printStackTrace(); > } > > >From:S.R.G. Manoj [mailto:ma...@ho...] >Sent: Wednesday, September 26, 2012 11:22 AM >To: jwe...@li... >Subject: [HCSPAM] - [JWebUnit-users] Triggering javascript events - Email found in subject > >Hi, > >Can we trigger a javascript event using jWebUnit? >In my case i have a onkeyup event for a text box and when i this event is triggered a button needs to be enabled, >but when i set the value for the text box using 'setTextField("textfieldName","value") the event is not getting triggered. > > >Thank you! > >Regards, >Manoj >DISCLAIMER AND PRIVILEGE NOTICE: This e-mail and any files transmitted with it contain confidential, copyright, proprietary and legally privileged information. It should not be used by anyone who is not the original intended recipient. Any use, distribution, copying or disclosure by any other person is strictly prohibited. If you receive this transmission in error, please notify the sender by reply email and then destroy the message. Opinions, conclusions and other information in this message that do not relate to official business of Seasia Consulting and its subsidiaries, Internet communications cannot be guaranteed to be timely, Secure, error or virus-free. The sender does not accept liability for any errors or omissions." >Use GROTAL.COM - Make Life Easy ....... ( Like us on Facebook, See us on Youtube ) >------------------------------------------------------------------------------ >Live Security Virtual Conference >Exclusive live event will cover all the ways today's security and >threat landscape has changed and how IT managers can respond. Discussions >will include endpoint security, mobile security and the latest in malware >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >_______________________________________________ >JWebUnit-users mailing list >JWe...@li... >https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > > |
From: Rajinder S. <rs...@se...> - 2012-09-26 07:39:59
|
You can use this: HtmlUnitElementImpl htmlUnit = (HtmlUnitElementImpl) getElementById("xxx"); try { setTextField("otpTokenPin", ""); htmlUnit.getHtmlElement().type("gfhghf"); } catch (Exception e) { e.printStackTrace(); } htmlUnit = (HtmlUnitElementImpl) getElementById("ddd"); try { htmlUnit.getHtmlElement().click(); } catch (IOException e1) { e1.printStackTrace(); } From: S.R.G. Manoj [mailto:ma...@ho...] Sent: Wednesday, September 26, 2012 11:22 AM To: jwe...@li... Subject: [HCSPAM] - [JWebUnit-users] Triggering javascript events - Email found in subject Hi, Can we trigger a javascript event using jWebUnit? In my case i have a onkeyup event for a text box and when i this event is triggered a button needs to be enabled, but when i set the value for the text box using 'setTextField("textfieldName","value") the event is not getting triggered. Thank you! Regards, Manoj DISCLAIMER AND PRIVILEGE NOTICE: This e-mail and any files transmitted with it contain confidential, copyright, proprietary and legally privileged information. It should not be used by anyone who is not the original intended recipient. Any use, distribution, copying or disclosure by any other person is strictly prohibited. If you receive this transmission in error, please notify the sender by reply email and then destroy the message. Opinions, conclusions and other information in this message that do not relate to official business of Seasia Consulting and its subsidiaries, Internet communications cannot be guaranteed to be timely, Secure, error or virus-free. The sender does not accept liability for any errors or omissions." Use GROTAL.COM- Make Life Easy !!! |
From: S.R.G. M. <ma...@ho...> - 2012-09-26 05:51:54
|
Hi, Can we trigger a javascript event using jWebUnit? In my case i have a onkeyup event for a text box and when i this event is triggered a button needs to be enabled, but when i set the value for the text box using 'setTextField("textfieldName","value") the event is not getting triggered. Thank you! Regards, Manoj |
From: Julien H. <he...@ya...> - 2012-09-24 13:48:26
|
Hi, >Is it possible to test the button state i.e., if a button is enabled or disabled in the page using jWebUnit? Have you tried something like: IElement e = getElementByXPath("your_xpath_selector"); e.getAttribute("disabled"); Regards, Julien |
From: Rajinder S. <rs...@se...> - 2012-09-24 12:26:21
|
You can always Do getpageSource().indexOf("$What Even is in veiwsource$") For e.g. getpageSource().indexOf("<input type = button values = \"test\" disabled=true>") This will Not work in case of AJAX call. From: man...@ac... [mailto:man...@ac...] Sent: Monday, September 24, 2012 5:37 PM To: jwe...@li... Subject: [HCSPAM] - [JWebUnit-users] Testing the button state - Email found in subject Hi, Is it possible to test the button state i.e., if a button is enabled or disabled in the page using jWebUnit? Thank you! Regards, Manoj ________________________________ Subject to local law, communications with Accenture and its affiliates including telephone calls and emails (including content), may be monitored by our systems for the purposes of security and the assessment of internal compliance with Accenture policy. ________________________________________________________________________ ______________ www.accenture.com |
From: <man...@ac...> - 2012-09-24 12:06:51
|
Hi, Is it possible to test the button state i.e., if a button is enabled or disabled in the page using jWebUnit? Thank you! Regards, Manoj ________________________________ Subject to local law, communications with Accenture and its affiliates including telephone calls and emails (including content), may be monitored by our systems for the purposes of security and the assessment of internal compliance with Accenture policy. ______________________________________________________________________________________ www.accenture.com |
From: Julien H. <he...@ya...> - 2012-09-09 16:09:10
|
Hi JWebUnit users, JWebUnit was nominated for ATI Automation Honors. I you want to show your support you can vote online on [1] (category Best Open Source FUNCTIONAL Automated Test Tool - Web). Regards, Julien [1] http://www.atihonors.automatedtestinginstitute.com |
From: Julien H. <he...@ya...> - 2012-09-01 18:39:55
|
Hi Clint, Your issue is supposed to be fixed in HtmlUnit trunk. I don't have the time to check but feel free to download [1] and keep us informed. Regards, Julien [1] http://build.canoo.com/htmlunit/artifacts//htmlunit-2.11-SNAPSHOT.jar ----- Mail original ----- > De : "Parham, Clinton" <cp...@bi...> > À : Julien HENRY <he...@ya...>; Usage problems for JWebUnit <jwe...@li...> > Cc : > Envoyé le : Vendredi 24 août 2012 2h41 > Objet : RE: [JWebUnit-users] clickElementByXPath failing > >T hank you for investigating and identifying the problem. > > We will proceed with your suggestion and track the HTMLUnit bug submission. > > -----Original Message----- > From: Julien HENRY [mailto:he...@ya...] > Sent: Wednesday, August 22, 2012 5:29 PM > To: Usage problems for JWebUnit > Subject: Re: [JWebUnit-users] clickElementByXPath failing > > Clint, > > I managed to found part of the problem. You are serving your webpages with xhtml > namespace. See > xmlns="http://www.w3.org/1999/xhtml" > > > As a result your xpath expressions seems to nned to be namespace aware. > //* means any element in any namespace > but > //tr means tr in no namespace => not found > > > [1] was a good source of help even if it is a bit outdated. This strange xpath > expression is working: > //:tr[@id='genTabViewId:genTabFrm:availableGroups:source::0'] > so it seems the part of your UI updated by richfaces/ajax is in a different > namespace. > > > Now question is why the namespace prefix is required after an AJAX partial > refresh. I guess this is because richfaces send the ajax response with > content type = text/xml but not sure. I managed to create a reproducible test > case with HtmlUnit API and I have submitted a bug [2]. > > > Waiting for a potential fix in HtmlUnit I suggest you use //*[@id='xxx'] > expression in order to not break your tests in the future if they provide a fix. > > > Hope this helps, > > Julien > > > [1] http://old.nabble.com/Re%3A-htmlunit-and-xpath-p22810034.html > [2] > https://sourceforge.net/tracker/?func=detail&aid=3560821&group_id=47038&atid=448266 > >> ________________________________ >> De : Julien HENRY <he...@ya...> >> À : Usage problems for JWebUnit <jwe...@li...> >> Envoyé le : Mercredi 22 août 2012 9h13 >> Objet : Re: [JWebUnit-users] clickElementByXPath failing >> >> Hi guys, >> >> Jevon, in the same file I see: >> >> <tr class="rich-picklist-source-row" > id="genTabViewId:genTabFrm:availableGroups:source::0"> >> <td class="rich-picklist-source-cell"> >> <img alt=" " > src="/saas/spring/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/images/spacer.gif" > style="width:1px;height:1px;"/> >> CPARHAMsaasBill1Pri1 >> <input autocomplete="off" > id="genTabViewId:genTabFrm:availableGroups:source::0StateInput" > name="genTabViewId:genTabFrm:availableGroups:source::0" > type="hidden" value="124685"/> >> </td> >> </tr> >> >> >> so for me there is actually a tr with > id=genTabViewId:genTabFrm:availableGroups:source::0 >> >> >> Clint, I have created a small test case (removing all relative js/css > imports from the html) and it is working fine: >> >> URL url = this.getClass().getResource("/dump0b.html"); >> String urlStr = url.toString(); >> String baseUrl = urlStr.substring(0, > urlStr.lastIndexOf("/")); >> getTestContext().setBaseUrl(baseUrl); >> setScriptingEnabled(false); //Need to disable JS because of missing > external references >> beginAt("/dump0b.html"); >> > assertNotNull(getElementById("genTabViewId:genTabFrm:availableGroups:source::0")); >> assertEquals(1, > getElementsByXPath("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']").size()); >> >> >> So the problem should come from JS, but unfortunately I can't help > without a reproducible test case. I mean some standalone html + java like the > previous test. If you manage to extract all JS references of your framework (I > guess JSF + richfaces) and create a test case it would be possible to > investigate. >> Regards, >> >> Julien >> >> >>> ________________________________ >>> De : jevon <je...@je...> >>> À : Usage problems for JWebUnit > <jwe...@li...> >>> Envoyé le : Mercredi 22 août 2012 4h44 >>> Objet : Re: [JWebUnit-users] clickElementByXPath failing >>> >>> Hi Clint, >>> >>> When I look at that source, it doesn't look like *any* object has an >>> id of 'genTabViewId:genTabFrm:availableGroups:source::0'. There > is an >>> object with a @name of >>> 'genTabViewId:genTabFrm:availableGroups:source::0', but that is > an >>> <input>... >>> >>> Perhaps the id="" attribute is not escaped properly (and the > engine >>> has to drop it). The valid characters for an ID attribute in HTML 4.01 >>> are /[a-z][a-z0-9:-_\.]*/i, so it's not that the id attribute is >>> incorrect - likewise, <tr>s are allowed in HTML 4.01 to have id >>> attributes. >>> >>> In fact, *none* of the elements in that XML source have an id >>> attribute. Interesting. >>> >>> Jevon >>> >>> On Sat, Aug 18, 2012 at 1:19 AM, Parham, Clinton > <cp...@bi...> wrote: >>>> Hi Julien, >>>> >>>> Thank you for replying. >>>> >>>> I have attached the asXML dump of the page after > Thread.sleep(10000) to account for AJAX activity. >>>> >>>> When I open the dumped content in Chrome and enter the following > into the JavaScript console, the "tr" I'm trying to click is > found: >>>> > $x("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']") >>>> >>>> Looking forward to your perspective. >>>> >>>> Clint >>>> >>>> -----Original Message----- >>>> From: Julien HENRY [mailto:he...@ya...] >>>> Sent: Friday, August 17, 2012 3:25 AM >>>> To: Usage problems for JWebUnit >>>> Subject: Re: [JWebUnit-users] clickElementByXPath failing >>>> >>>> Hi, >>>> >>>> I've just tested to locate a tr element by id using the same > xpath expression and it is working fine. Are you not encountering timing issue? > If you are using AJAX to update the page there could be different results > depending on execution speed. >>>> >>>> Concerning diference between getPageSource and asXml Jevon is > right: getPageSource returns the original source returned by the server while > asXml is a dump of the current state of the DOM. >>>> >>>> Could you please send us the result of asXml() when your test > failed? >>>> >>>> Regards, >>>> >>>> Julien >>>> >>>> >>>> ----- Mail original ----- >>>>> De : "Parham, Clinton" <cp...@bi...> >>>>> À : Usage problems for JWebUnit > <jwe...@li...> >>>>> Cc : >>>>> Envoyé le : Vendredi 17 août 2012 4h57 >>>>> Objet : Re: [JWebUnit-users] clickElementByXPath failing >>>>> >>>>> When executing getElementsByXPath("//tr") I get back > 88 matches. >>>>> >>>>> But it gets more interesting: >>>>> >>>>> The following (from my original clickElementByXPath) returns > zero matches: >>>>> > getElementsByXPath("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']"); >>>>> >>>>> But this returns what I'm looking for (only changed > "tr" to >>>>> "*"): >>>>> > getElementsByXPath("//*[@id='genTabViewId:genTabFrm:availableGroups:source::0']"); >>>>> >>>>> This is what the debugger returns when Inspecting the return > value of the above >>>>> statement - you can see it is a "tr": >>>>> [IElement[name=tr wrapped=HtmlTableRow[<tr >>>>> class="rich-picklist-source-row" >>>>> > id="genTabViewId:genTabFrm:availableGroups:source::0">]]] >>>>> >>>>> I would expect consistent results when calling both of these > getElementsByXPath >>>>> methods. What's going on? >>>>> >>>>> Thanks. >>>>> >>>>> -----Original Message----- >>>>> From: jevon [mailto:je...@je...] >>>>> Sent: Thursday, August 16, 2012 8:56 PM >>>>> To: Usage problems for JWebUnit >>>>> Subject: Re: [JWebUnit-users] clickElementByXPath failing >>>>> >>>>> Hi, >>>>> >>>>> I can't look at the JWebUnit source right now, but it > sounds like >>>>> getPageSource() just dumps out the original source of the page, > i.e. >>>>> without Javascript DOM modifications, whereas page.asXml() > dumps the >>>>> runtime content of the page itself, i.e. after Javascript/AJAX > has >>>>> modified the page. Or perhaps the source page does not > validate, thus >>>>> some of the elements are lost. >>>>> >>>>> What happens if you execute > getElementsByXPath("//tr")? >>>>> >>>>> Cheers >>>>> Jevon >>>>> >>>>> On Fri, Aug 17, 2012 at 8:47 AM, Parham, Clinton > <cp...@bi...> >>>>> wrote: >>>>>> Hello, >>>>>> >>>>>> We're using JWebUnit 3 to test a JSF web application > that uses JBoss >>>>> RichFaces AJAX enabled components. >>>>>> >>>>>> At one point in the test, a call to >>>>> > clickElementByXPath("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']") >>>>> is made but it fails with this: >>>>>> >>>>>> java.lang.AssertionError: Unable to locate element with > xpath >>>>> > "//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']" >>>>>> at org.junit.Assert.fail(Assert.java:91) >>>>>> at org.junit.Assert.assertTrue(Assert.java:43) >>>>>> at >>>>> > net.sourceforge.jwebunit.junit.WebTester.assertElementPresentByXPath(WebTester.java:2109) >>>>>> at >>>>> > net.sourceforge.jwebunit.junit.WebTester.clickElementByXPath(WebTester.java:2673) >>>>>> at >>>>> > com.xyz.util.EnrollmentUtil.setGeneralTabFields(EnrollmentUtiljava:165) >>>>>> ... >>>>>> >>>>>> Just before making the clickElementByXPath call, we > execute >>>>> Thread.sleep(5000) to account for AJAX activity and then we > dump the page >>>>> content two ways to see what's going on: >>>>>> [1] FileUtils.writeStringToFile(new File(filename), > getPageSource()); >>>>>> and >>>>>> [2] HtmlUnitTestingEngineImpl engine = > (HtmlUnitTestingEngineImpl) >>>>> getTestingEngine(); >>>>>> HtmlPage page = ((HtmlPage) > engine.getCurrentWindow().getEnclosedPage()); >>>>>> FileUtils.writeStringToFile(new File(filename), > page.asXml()); >>>>>> >>>>>> The dumps are different which is quite surprising. When > viewing the file >>>>> generated by method [1] in Chrome, the "tr" element > is not present. >>>>> But it is present when viewing the file generated by method > [2]. >>>>>> >>>>>> What is happening? >>>>>> >>>>>> >>>>>> The contents contained herein may contain confidential > information. If you >>>>> are not the intended recipient, you are hereby notified that > any disclosure, >>>>> copying, distribution, printing or action taken on the contents > is strictly >>>>> prohibited. If you have received this email in error, please > notify the sender >>>>> immediately and delete this message. >>>>>> >>>>>> >>>>> > ------------------------------------------------------------------------------ >>>>>> Live Security Virtual Conference >>>>>> Exclusive live event will cover all the ways today's > security and >>>>>> threat landscape has changed and how IT managers can > respond. Discussions >>>>>> will include endpoint security, mobile security and the > latest in malware >>>>>> threats. > http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>>>> _______________________________________________ >>>>>> JWebUnit-users mailing list >>>>>> JWe...@li... >>>>>> > https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>>> >>>>> > ------------------------------------------------------------------------------ >>>>> Live Security Virtual Conference >>>>> Exclusive live event will cover all the ways today's > security and >>>>> threat landscape has changed and how IT managers can respond. > Discussions >>>>> will include endpoint security, mobile security and the latest > in malware >>>>> threats. > http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>>> _______________________________________________ >>>>> JWebUnit-users mailing list >>>>> JWe...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>>> >>>>> > ------------------------------------------------------------------------------ >>>>> Live Security Virtual Conference >>>>> Exclusive live event will cover all the ways today's > security and >>>>> threat landscape has changed and how IT managers can respond. > Discussions >>>>> will include endpoint security, mobile security and the latest > in malware >>>>> threats. > http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>>> _______________________________________________ >>>>> JWebUnit-users mailing list >>>>> JWe...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>>> >>>> >>>> > ------------------------------------------------------------------------------ >>>> Live Security Virtual Conference >>>> Exclusive live event will cover all the ways today's security > and >>>> threat landscape has changed and how IT managers can respond. > Discussions >>>> will include endpoint security, mobile security and the latest in > malware >>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>> _______________________________________________ >>>> JWebUnit-users mailing list >>>> JWe...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>> >>>> > ------------------------------------------------------------------------------ >>>> Live Security Virtual Conference >>>> Exclusive live event will cover all the ways today's security > and >>>> threat landscape has changed and how IT managers can respond. > Discussions >>>> will include endpoint security, mobile security and the latest in > malware >>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>> _______________________________________________ >>>> JWebUnit-users mailing list >>>> JWe...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>> >>> >>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. > Discussions >>> will include endpoint security, mobile security and the latest in > malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> _______________________________________________ >>> JWebUnit-users mailing list >>> JWe...@li... >>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>> >>> >>> >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> JWebUnit-users mailing list >> JWe...@li... >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> >> > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > |
From: Parham, C. <cp...@bi...> - 2012-08-24 00:41:40
|
Thank you for investigating and identifying the problem. We will proceed with your suggestion and track the HTMLUnit bug submission. -----Original Message----- From: Julien HENRY [mailto:he...@ya...] Sent: Wednesday, August 22, 2012 5:29 PM To: Usage problems for JWebUnit Subject: Re: [JWebUnit-users] clickElementByXPath failing Clint, I managed to found part of the problem. You are serving your webpages with xhtml namespace. See xmlns="http://www.w3.org/1999/xhtml" As a result your xpath expressions seems to nned to be namespace aware. //* means any element in any namespace but //tr means tr in no namespace => not found [1] was a good source of help even if it is a bit outdated. This strange xpath expression is working: //:tr[@id='genTabViewId:genTabFrm:availableGroups:source::0'] so it seems the part of your UI updated by richfaces/ajax is in a different namespace. Now question is why the namespace prefix is required after an AJAX partial refresh. I guess this is because richfaces send the ajax response with content type = text/xml but not sure. I managed to create a reproducible test case with HtmlUnit API and I have submitted a bug [2]. Waiting for a potential fix in HtmlUnit I suggest you use //*[@id='xxx'] expression in order to not break your tests in the future if they provide a fix. Hope this helps, Julien [1] http://old.nabble.com/Re%3A-htmlunit-and-xpath-p22810034.html [2] https://sourceforge.net/tracker/?func=detail&aid=3560821&group_id=47038&atid=448266 >________________________________ > De : Julien HENRY <he...@ya...> >À : Usage problems for JWebUnit <jwe...@li...> >Envoyé le : Mercredi 22 août 2012 9h13 >Objet : Re: [JWebUnit-users] clickElementByXPath failing > >Hi guys, > >Jevon, in the same file I see: > ><tr class="rich-picklist-source-row" id="genTabViewId:genTabFrm:availableGroups:source::0"> > <td class="rich-picklist-source-cell"> > <img alt=" " src="/saas/spring/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/images/spacer.gif" style="width:1px;height:1px;"/> > CPARHAMsaasBill1Pri1 > <input autocomplete="off" id="genTabViewId:genTabFrm:availableGroups:source::0StateInput" name="genTabViewId:genTabFrm:availableGroups:source::0" type="hidden" value="124685"/> > </td> ></tr> > > >so for me there is actually a tr with id=genTabViewId:genTabFrm:availableGroups:source::0 > > >Clint, I have created a small test case (removing all relative js/css imports from the html) and it is working fine: > > URL url = this.getClass().getResource("/dump0b.html"); > String urlStr = url.toString(); > String baseUrl = urlStr.substring(0, urlStr.lastIndexOf("/")); > getTestContext().setBaseUrl(baseUrl); > setScriptingEnabled(false); //Need to disable JS because of missing external references > beginAt("/dump0b.html"); > assertNotNull(getElementById("genTabViewId:genTabFrm:availableGroups:source::0")); > assertEquals(1, getElementsByXPath("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']").size()); > > >So the problem should come from JS, but unfortunately I can't help without a reproducible test case. I mean some standalone html + java like the previous test. If you manage to extract all JS references of your framework (I guess JSF + richfaces) and create a test case it would be possible to investigate. >Regards, > >Julien > > >>________________________________ >> De : jevon <je...@je...> >>À : Usage problems for JWebUnit <jwe...@li...> >>Envoyé le : Mercredi 22 août 2012 4h44 >>Objet : Re: [JWebUnit-users] clickElementByXPath failing >> >>Hi Clint, >> >>When I look at that source, it doesn't look like *any* object has an >>id of 'genTabViewId:genTabFrm:availableGroups:source::0'. There is an >>object with a @name of >>'genTabViewId:genTabFrm:availableGroups:source::0', but that is an >><input>... >> >>Perhaps the id="" attribute is not escaped properly (and the engine >>has to drop it). The valid characters for an ID attribute in HTML 4.01 >>are /[a-z][a-z0-9:-_\.]*/i, so it's not that the id attribute is >>incorrect - likewise, <tr>s are allowed in HTML 4.01 to have id >>attributes. >> >>In fact, *none* of the elements in that XML source have an id >>attribute. Interesting. >> >>Jevon >> >>On Sat, Aug 18, 2012 at 1:19 AM, Parham, Clinton <cp...@bi...> wrote: >>> Hi Julien, >>> >>> Thank you for replying. >>> >>> I have attached the asXML dump of the page after Thread.sleep(10000) to account for AJAX activity. >>> >>> When I open the dumped content in Chrome and enter the following into the JavaScript console, the "tr" I'm trying to click is found: >>> $x("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']") >>> >>> Looking forward to your perspective. >>> >>> Clint >>> >>> -----Original Message----- >>> From: Julien HENRY [mailto:he...@ya...] >>> Sent: Friday, August 17, 2012 3:25 AM >>> To: Usage problems for JWebUnit >>> Subject: Re: [JWebUnit-users] clickElementByXPath failing >>> >>> Hi, >>> >>> I've just tested to locate a tr element by id using the same xpath expression and it is working fine. Are you not encountering timing issue? If you are using AJAX to update the page there could be different results depending on execution speed. >>> >>> Concerning diference between getPageSource and asXml Jevon is right: getPageSource returns the original source returned by the server while asXml is a dump of the current state of the DOM. >>> >>> Could you please send us the result of asXml() when your test failed? >>> >>> Regards, >>> >>> Julien >>> >>> >>> ----- Mail original ----- >>>> De : "Parham, Clinton" <cp...@bi...> >>>> À : Usage problems for JWebUnit <jwe...@li...> >>>> Cc : >>>> Envoyé le : Vendredi 17 août 2012 4h57 >>>> Objet : Re: [JWebUnit-users] clickElementByXPath failing >>>> >>>> When executing getElementsByXPath("//tr") I get back 88 matches. >>>> >>>> But it gets more interesting: >>>> >>>> The following (from my original clickElementByXPath) returns zero matches: >>>> getElementsByXPath("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']"); >>>> >>>> But this returns what I'm looking for (only changed "tr" to >>>> "*"): >>>> getElementsByXPath("//*[@id='genTabViewId:genTabFrm:availableGroups:source::0']"); >>>> >>>> This is what the debugger returns when Inspecting the return value of the above >>>> statement - you can see it is a "tr": >>>> [IElement[name=tr wrapped=HtmlTableRow[<tr >>>> class="rich-picklist-source-row" >>>> id="genTabViewId:genTabFrm:availableGroups:source::0">]]] >>>> >>>> I would expect consistent results when calling both of these getElementsByXPath >>>> methods. What's going on? >>>> >>>> Thanks. >>>> >>>> -----Original Message----- >>>> From: jevon [mailto:je...@je...] >>>> Sent: Thursday, August 16, 2012 8:56 PM >>>> To: Usage problems for JWebUnit >>>> Subject: Re: [JWebUnit-users] clickElementByXPath failing >>>> >>>> Hi, >>>> >>>> I can't look at the JWebUnit source right now, but it sounds like >>>> getPageSource() just dumps out the original source of the page, i.e. >>>> without Javascript DOM modifications, whereas page.asXml() dumps the >>>> runtime content of the page itself, i.e. after Javascript/AJAX has >>>> modified the page. Or perhaps the source page does not validate, thus >>>> some of the elements are lost. >>>> >>>> What happens if you execute getElementsByXPath("//tr")? >>>> >>>> Cheers >>>> Jevon >>>> >>>> On Fri, Aug 17, 2012 at 8:47 AM, Parham, Clinton <cp...@bi...> >>>> wrote: >>>>> Hello, >>>>> >>>>> We're using JWebUnit 3 to test a JSF web application that uses JBoss >>>> RichFaces AJAX enabled components. >>>>> >>>>> At one point in the test, a call to >>>> clickElementByXPath("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']") >>>> is made but it fails with this: >>>>> >>>>> java.lang.AssertionError: Unable to locate element with xpath >>>> "//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']" >>>>> at org.junit.Assert.fail(Assert.java:91) >>>>> at org.junit.Assert.assertTrue(Assert.java:43) >>>>> at >>>> net.sourceforge.jwebunit.junit.WebTester.assertElementPresentByXPath(WebTester.java:2109) >>>>> at >>>> net.sourceforge.jwebunit.junit.WebTester.clickElementByXPath(WebTester.java:2673) >>>>> at >>>> com.xyz.util.EnrollmentUtil.setGeneralTabFields(EnrollmentUtiljava:165) >>>>> ... >>>>> >>>>> Just before making the clickElementByXPath call, we execute >>>> Thread.sleep(5000) to account for AJAX activity and then we dump the page >>>> content two ways to see what's going on: >>>>> [1] FileUtils.writeStringToFile(new File(filename), getPageSource()); >>>>> and >>>>> [2] HtmlUnitTestingEngineImpl engine = (HtmlUnitTestingEngineImpl) >>>> getTestingEngine(); >>>>> HtmlPage page = ((HtmlPage) engine.getCurrentWindow().getEnclosedPage()); >>>>> FileUtils.writeStringToFile(new File(filename), page.asXml()); >>>>> >>>>> The dumps are different which is quite surprising. When viewing the file >>>> generated by method [1] in Chrome, the "tr" element is not present. >>>> But it is present when viewing the file generated by method [2]. >>>>> >>>>> What is happening? >>>>> >>>>> >>>>> The contents contained herein may contain confidential information. If you >>>> are not the intended recipient, you are hereby notified that any disclosure, >>>> copying, distribution, printing or action taken on the contents is strictly >>>> prohibited. If you have received this email in error, please notify the sender >>>> immediately and delete this message. >>>>> >>>>> >>>> ------------------------------------------------------------------------------ >>>>> Live Security Virtual Conference >>>>> Exclusive live event will cover all the ways today's security and >>>>> threat landscape has changed and how IT managers can respond. Discussions >>>>> will include endpoint security, mobile security and the latest in malware >>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>>> _______________________________________________ >>>>> JWebUnit-users mailing list >>>>> JWe...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>> >>>> ------------------------------------------------------------------------------ >>>> Live Security Virtual Conference >>>> Exclusive live event will cover all the ways today's security and >>>> threat landscape has changed and how IT managers can respond. Discussions >>>> will include endpoint security, mobile security and the latest in malware >>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>> _______________________________________________ >>>> JWebUnit-users mailing list >>>> JWe...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>> >>>> ------------------------------------------------------------------------------ >>>> Live Security Virtual Conference >>>> Exclusive live event will cover all the ways today's security and >>>> threat landscape has changed and how IT managers can respond. Discussions >>>> will include endpoint security, mobile security and the latest in malware >>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>> _______________________________________________ >>>> JWebUnit-users mailing list >>>> JWe...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>> >>> >>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. Discussions >>> will include endpoint security, mobile security and the latest in malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> _______________________________________________ >>> JWebUnit-users mailing list >>> JWe...@li... >>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>> >>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. Discussions >>> will include endpoint security, mobile security and the latest in malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> _______________________________________________ >>> JWebUnit-users mailing list >>> JWe...@li... >>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>> >> >>------------------------------------------------------------------------------ >>Live Security Virtual Conference >>Exclusive live event will cover all the ways today's security and >>threat landscape has changed and how IT managers can respond. Discussions >>will include endpoint security, mobile security and the latest in malware >>threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>_______________________________________________ >>JWebUnit-users mailing list >>JWe...@li... >>https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> >> > >------------------------------------------------------------------------------ >Live Security Virtual Conference >Exclusive live event will cover all the ways today's security and >threat landscape has changed and how IT managers can respond. Discussions >will include endpoint security, mobile security and the latest in malware >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >_______________________________________________ >JWebUnit-users mailing list >JWe...@li... >https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > > ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ JWebUnit-users mailing list JWe...@li... https://lists.sourceforge.net/lists/listinfo/jwebunit-users |
From: jevon <je...@je...> - 2012-08-23 05:56:54
|
Wow, good find! Jevon On Thu, Aug 23, 2012 at 9:28 AM, Julien HENRY <he...@ya...> wrote: > Clint, > > I managed to found part of the problem. You are serving your webpages with xhtml namespace. See > xmlns="http://www.w3.org/1999/xhtml" > > > As a result your xpath expressions seems to nned to be namespace aware. > //* means any element in any namespace > but > //tr means tr in no namespace => not found > > > [1] was a good source of help even if it is a bit outdated. This strange xpath expression is working: > //:tr[@id='genTabViewId:genTabFrm:availableGroups:source::0'] > so it seems the part of your UI updated by richfaces/ajax is in a different namespace. > > > Now question is why the namespace prefix is required after an AJAX partial refresh. I guess this is because richfaces send the ajax response with > content type = text/xml but not sure. I managed to create a reproducible test case with HtmlUnit API and I have submitted a bug [2]. > > > Waiting for a potential fix in HtmlUnit I suggest you use //*[@id='xxx'] expression in order to not break your tests in the future if they provide a fix. > > > Hope this helps, > > Julien > > > [1] http://old.nabble.com/Re%3A-htmlunit-and-xpath-p22810034.html > [2] https://sourceforge.net/tracker/?func=detail&aid=3560821&group_id=47038&atid=448266 > >>________________________________ >> De : Julien HENRY <he...@ya...> >>À : Usage problems for JWebUnit <jwe...@li...> >>Envoyé le : Mercredi 22 août 2012 9h13 >>Objet : Re: [JWebUnit-users] clickElementByXPath failing >> >>Hi guys, >> >>Jevon, in the same file I see: >> >><tr class="rich-picklist-source-row" id="genTabViewId:genTabFrm:availableGroups:source::0"> >> <td class="rich-picklist-source-cell"> >> <img alt=" " src="/saas/spring/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/images/spacer.gif" style="width:1px;height:1px;"/> >> CPARHAMsaasBill1Pri1 >> <input autocomplete="off" id="genTabViewId:genTabFrm:availableGroups:source::0StateInput" name="genTabViewId:genTabFrm:availableGroups:source::0" type="hidden" value="124685"/> >> </td> >></tr> >> >> >>so for me there is actually a tr with id=genTabViewId:genTabFrm:availableGroups:source::0 >> >> >>Clint, I have created a small test case (removing all relative js/css imports from the html) and it is working fine: >> >> URL url = this.getClass().getResource("/dump0b.html"); >> String urlStr = url.toString(); >> String baseUrl = urlStr.substring(0, urlStr.lastIndexOf("/")); >> getTestContext().setBaseUrl(baseUrl); >> setScriptingEnabled(false); //Need to disable JS because of missing external references >> beginAt("/dump0b.html"); >> assertNotNull(getElementById("genTabViewId:genTabFrm:availableGroups:source::0")); >> assertEquals(1, getElementsByXPath("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']").size()); >> >> >>So the problem should come from JS, but unfortunately I can't help without a reproducible test case. I mean some standalone html + java like the previous test. If you manage to extract all JS references of your framework (I guess JSF + richfaces) and create a test case it would be possible to investigate. >>Regards, >> >>Julien >> >> >>>________________________________ >>> De : jevon <je...@je...> >>>À : Usage problems for JWebUnit <jwe...@li...> >>>Envoyé le : Mercredi 22 août 2012 4h44 >>>Objet : Re: [JWebUnit-users] clickElementByXPath failing >>> >>>Hi Clint, >>> >>>When I look at that source, it doesn't look like *any* object has an >>>id of 'genTabViewId:genTabFrm:availableGroups:source::0'. There is an >>>object with a @name of >>>'genTabViewId:genTabFrm:availableGroups:source::0', but that is an >>><input>... >>> >>>Perhaps the id="" attribute is not escaped properly (and the engine >>>has to drop it). The valid characters for an ID attribute in HTML 4.01 >>>are /[a-z][a-z0-9:-_\.]*/i, so it's not that the id attribute is >>>incorrect - likewise, <tr>s are allowed in HTML 4.01 to have id >>>attributes. >>> >>>In fact, *none* of the elements in that XML source have an id >>>attribute. Interesting. >>> >>>Jevon >>> >>>On Sat, Aug 18, 2012 at 1:19 AM, Parham, Clinton <cp...@bi...> wrote: >>>> Hi Julien, >>>> >>>> Thank you for replying. >>>> >>>> I have attached the asXML dump of the page after Thread.sleep(10000) to account for AJAX activity. >>>> >>>> When I open the dumped content in Chrome and enter the following into the JavaScript console, the "tr" I'm trying to click is found: >>>> $x("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']") >>>> >>>> Looking forward to your perspective. >>>> >>>> Clint >>>> >>>> -----Original Message----- >>>> From: Julien HENRY [mailto:he...@ya...] >>>> Sent: Friday, August 17, 2012 3:25 AM >>>> To: Usage problems for JWebUnit >>>> Subject: Re: [JWebUnit-users] clickElementByXPath failing >>>> >>>> Hi, >>>> >>>> I've just tested to locate a tr element by id using the same xpath expression and it is working fine. Are you not encountering timing issue? If you are using AJAX to update the page there could be different results depending on execution speed. >>>> >>>> Concerning diference between getPageSource and asXml Jevon is right: getPageSource returns the original source returned by the server while asXml is a dump of the current state of the DOM. >>>> >>>> Could you please send us the result of asXml() when your test failed? >>>> >>>> Regards, >>>> >>>> Julien >>>> >>>> >>>> ----- Mail original ----- >>>>> De : "Parham, Clinton" <cp...@bi...> >>>>> À : Usage problems for JWebUnit <jwe...@li...> >>>>> Cc : >>>>> Envoyé le : Vendredi 17 août 2012 4h57 >>>>> Objet : Re: [JWebUnit-users] clickElementByXPath failing >>>>> >>>>> When executing getElementsByXPath("//tr") I get back 88 matches. >>>>> >>>>> But it gets more interesting: >>>>> >>>>> The following (from my original clickElementByXPath) returns zero matches: >>>>> getElementsByXPath("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']"); >>>>> >>>>> But this returns what I'm looking for (only changed "tr" to >>>>> "*"): >>>>> getElementsByXPath("//*[@id='genTabViewId:genTabFrm:availableGroups:source::0']"); >>>>> >>>>> This is what the debugger returns when Inspecting the return value of the above >>>>> statement - you can see it is a "tr": >>>>> [IElement[name=tr wrapped=HtmlTableRow[<tr >>>>> class="rich-picklist-source-row" >>>>> id="genTabViewId:genTabFrm:availableGroups:source::0">]]] >>>>> >>>>> I would expect consistent results when calling both of these getElementsByXPath >>>>> methods. What's going on? >>>>> >>>>> Thanks. >>>>> >>>>> -----Original Message----- >>>>> From: jevon [mailto:je...@je...] >>>>> Sent: Thursday, August 16, 2012 8:56 PM >>>>> To: Usage problems for JWebUnit >>>>> Subject: Re: [JWebUnit-users] clickElementByXPath failing >>>>> >>>>> Hi, >>>>> >>>>> I can't look at the JWebUnit source right now, but it sounds like >>>>> getPageSource() just dumps out the original source of the page, i.e. >>>>> without Javascript DOM modifications, whereas page.asXml() dumps the >>>>> runtime content of the page itself, i.e. after Javascript/AJAX has >>>>> modified the page. Or perhaps the source page does not validate, thus >>>>> some of the elements are lost. >>>>> >>>>> What happens if you execute getElementsByXPath("//tr")? >>>>> >>>>> Cheers >>>>> Jevon >>>>> >>>>> On Fri, Aug 17, 2012 at 8:47 AM, Parham, Clinton <cp...@bi...> >>>>> wrote: >>>>>> Hello, >>>>>> >>>>>> We're using JWebUnit 3 to test a JSF web application that uses JBoss >>>>> RichFaces AJAX enabled components. >>>>>> >>>>>> At one point in the test, a call to >>>>> clickElementByXPath("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']") >>>>> is made but it fails with this: >>>>>> >>>>>> java.lang.AssertionError: Unable to locate element with xpath >>>>> "//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']" >>>>>> at org.junit.Assert.fail(Assert.java:91) >>>>>> at org.junit.Assert.assertTrue(Assert.java:43) >>>>>> at >>>>> net.sourceforge.jwebunit.junit.WebTester.assertElementPresentByXPath(WebTester.java:2109) >>>>>> at >>>>> net.sourceforge.jwebunit.junit.WebTester.clickElementByXPath(WebTesterjava:2673) >>>>>> at >>>>> com.xyz.util.EnrollmentUtil.setGeneralTabFields(EnrollmentUtiljava:165) >>>>>> ... >>>>>> >>>>>> Just before making the clickElementByXPath call, we execute >>>>> Thread.sleep(5000) to account for AJAX activity and then we dump the page >>>>> content two ways to see what's going on: >>>>>> [1] FileUtils.writeStringToFile(new File(filename), getPageSource()); >>>>>> and >>>>>> [2] HtmlUnitTestingEngineImpl engine = (HtmlUnitTestingEngineImpl) >>>>> getTestingEngine(); >>>>>> HtmlPage page = ((HtmlPage) engine.getCurrentWindow().getEnclosedPage()); >>>>>> FileUtils.writeStringToFile(new File(filename), page.asXml()); >>>>>> >>>>>> The dumps are different which is quite surprising. When viewing the file >>>>> generated by method [1] in Chrome, the "tr" element is not present. >>>>> But it is present when viewing the file generated by method [2]. >>>>>> >>>>>> What is happening? >>>>>> >>>>>> >>>>>> The contents contained herein may contain confidential information If you >>>>> are not the intended recipient, you are hereby notified that any disclosure, >>>>> copying, distribution, printing or action taken on the contents is strictly >>>>> prohibited. If you have received this email in error, please notify the sender >>>>> immediately and delete this message. >>>>>> >>>>>> >>>>> ------------------------------------------------------------------------------ >>>>>> Live Security Virtual Conference >>>>>> Exclusive live event will cover all the ways today's security and >>>>>> threat landscape has changed and how IT managers can respond. Discussions >>>>>> will include endpoint security, mobile security and the latest in malware >>>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>>>> _______________________________________________ >>>>>> JWebUnit-users mailing list >>>>>> JWe...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Live Security Virtual Conference >>>>> Exclusive live event will cover all the ways today's security and >>>>> threat landscape has changed and how IT managers can respond. Discussions >>>>> will include endpoint security, mobile security and the latest in malware >>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>>> _______________________________________________ >>>>> JWebUnit-users mailing list >>>>> JWe...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Live Security Virtual Conference >>>>> Exclusive live event will cover all the ways today's security and >>>>> threat landscape has changed and how IT managers can respond. Discussions >>>>> will include endpoint security, mobile security and the latest in malware >>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>>> _______________________________________________ >>>>> JWebUnit-users mailing list >>>>> JWe...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Live Security Virtual Conference >>>> Exclusive live event will cover all the ways today's security and >>>> threat landscape has changed and how IT managers can respond. Discussions >>>> will include endpoint security, mobile security and the latest in malware >>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>> _______________________________________________ >>>> JWebUnit-users mailing list >>>> JWe...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>> >>>> ------------------------------------------------------------------------------ >>>> Live Security Virtual Conference >>>> Exclusive live event will cover all the ways today's security and >>>> threat landscape has changed and how IT managers can respond. Discussions >>>> will include endpoint security, mobile security and the latest in malware >>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>> _______________________________________________ >>>> JWebUnit-users mailing list >>>> JWe...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>> >>> >>>------------------------------------------------------------------------------ >>>Live Security Virtual Conference >>>Exclusive live event will cover all the ways today's security and >>>threat landscape has changed and how IT managers can respond. Discussions >>>will include endpoint security, mobile security and the latest in malware >>>threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>_______________________________________________ >>>JWebUnit-users mailing list >>>JWe...@li... >>>https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>> >>> >>> >> >>------------------------------------------------------------------------------ >>Live Security Virtual Conference >>Exclusive live event will cover all the ways today's security and >>threat landscape has changed and how IT managers can respond. Discussions >>will include endpoint security, mobile security and the latest in malware >>threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>_______________________________________________ >>JWebUnit-users mailing list >>JWe...@li... >>https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> >> > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users |
From: Julien H. <he...@ya...> - 2012-08-22 21:28:59
|
Clint, I managed to found part of the problem. You are serving your webpages with xhtml namespace. See xmlns="http://www.w3.org/1999/xhtml" As a result your xpath expressions seems to nned to be namespace aware. //* means any element in any namespace but //tr means tr in no namespace => not found [1] was a good source of help even if it is a bit outdated. This strange xpath expression is working: //:tr[@id='genTabViewId:genTabFrm:availableGroups:source::0'] so it seems the part of your UI updated by richfaces/ajax is in a different namespace. Now question is why the namespace prefix is required after an AJAX partial refresh. I guess this is because richfaces send the ajax response with content type = text/xml but not sure. I managed to create a reproducible test case with HtmlUnit API and I have submitted a bug [2]. Waiting for a potential fix in HtmlUnit I suggest you use //*[@id='xxx'] expression in order to not break your tests in the future if they provide a fix. Hope this helps, Julien [1] http://old.nabble.com/Re%3A-htmlunit-and-xpath-p22810034.html [2] https://sourceforge.net/tracker/?func=detail&aid=3560821&group_id=47038&atid=448266 >________________________________ > De : Julien HENRY <he...@ya...> >À : Usage problems for JWebUnit <jwe...@li...> >Envoyé le : Mercredi 22 août 2012 9h13 >Objet : Re: [JWebUnit-users] clickElementByXPath failing > >Hi guys, > >Jevon, in the same file I see: > ><tr class="rich-picklist-source-row" id="genTabViewId:genTabFrm:availableGroups:source::0"> > <td class="rich-picklist-source-cell"> > <img alt=" " src="/saas/spring/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/images/spacer.gif" style="width:1px;height:1px;"/> > CPARHAMsaasBill1Pri1 > <input autocomplete="off" id="genTabViewId:genTabFrm:availableGroups:source::0StateInput" name="genTabViewId:genTabFrm:availableGroups:source::0" type="hidden" value="124685"/> > </td> ></tr> > > >so for me there is actually a tr with id=genTabViewId:genTabFrm:availableGroups:source::0 > > >Clint, I have created a small test case (removing all relative js/css imports from the html) and it is working fine: > > URL url = this.getClass().getResource("/dump0b.html"); > String urlStr = url.toString(); > String baseUrl = urlStr.substring(0, urlStr.lastIndexOf("/")); > getTestContext().setBaseUrl(baseUrl); > setScriptingEnabled(false); //Need to disable JS because of missing external references > beginAt("/dump0b.html"); > assertNotNull(getElementById("genTabViewId:genTabFrm:availableGroups:source::0")); > assertEquals(1, getElementsByXPath("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']").size()); > > >So the problem should come from JS, but unfortunately I can't help without a reproducible test case. I mean some standalone html + java like the previous test. If you manage to extract all JS references of your framework (I guess JSF + richfaces) and create a test case it would be possible to investigate. >Regards, > >Julien > > >>________________________________ >> De : jevon <je...@je...> >>À : Usage problems for JWebUnit <jwe...@li...> >>Envoyé le : Mercredi 22 août 2012 4h44 >>Objet : Re: [JWebUnit-users] clickElementByXPath failing >> >>Hi Clint, >> >>When I look at that source, it doesn't look like *any* object has an >>id of 'genTabViewId:genTabFrm:availableGroups:source::0'. There is an >>object with a @name of >>'genTabViewId:genTabFrm:availableGroups:source::0', but that is an >><input>... >> >>Perhaps the id="" attribute is not escaped properly (and the engine >>has to drop it). The valid characters for an ID attribute in HTML 4.01 >>are /[a-z][a-z0-9:-_\.]*/i, so it's not that the id attribute is >>incorrect - likewise, <tr>s are allowed in HTML 4.01 to have id >>attributes. >> >>In fact, *none* of the elements in that XML source have an id >>attribute. Interesting. >> >>Jevon >> >>On Sat, Aug 18, 2012 at 1:19 AM, Parham, Clinton <cp...@bi...> wrote: >>> Hi Julien, >>> >>> Thank you for replying. >>> >>> I have attached the asXML dump of the page after Thread.sleep(10000) to account for AJAX activity. >>> >>> When I open the dumped content in Chrome and enter the following into the JavaScript console, the "tr" I'm trying to click is found: >>> $x("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']") >>> >>> Looking forward to your perspective. >>> >>> Clint >>> >>> -----Original Message----- >>> From: Julien HENRY [mailto:he...@ya...] >>> Sent: Friday, August 17, 2012 3:25 AM >>> To: Usage problems for JWebUnit >>> Subject: Re: [JWebUnit-users] clickElementByXPath failing >>> >>> Hi, >>> >>> I've just tested to locate a tr element by id using the same xpath expression and it is working fine. Are you not encountering timing issue? If you are using AJAX to update the page there could be different results depending on execution speed. >>> >>> Concerning diference between getPageSource and asXml Jevon is right: getPageSource returns the original source returned by the server while asXml is a dump of the current state of the DOM. >>> >>> Could you please send us the result of asXml() when your test failed? >>> >>> Regards, >>> >>> Julien >>> >>> >>> ----- Mail original ----- >>>> De : "Parham, Clinton" <cp...@bi...> >>>> À : Usage problems for JWebUnit <jwe...@li...> >>>> Cc : >>>> Envoyé le : Vendredi 17 août 2012 4h57 >>>> Objet : Re: [JWebUnit-users] clickElementByXPath failing >>>> >>>> When executing getElementsByXPath("//tr") I get back 88 matches. >>>> >>>> But it gets more interesting: >>>> >>>> The following (from my original clickElementByXPath) returns zero matches: >>>> getElementsByXPath("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']"); >>>> >>>> But this returns what I'm looking for (only changed "tr" to >>>> "*"): >>>> getElementsByXPath("//*[@id='genTabViewId:genTabFrm:availableGroups:source::0']"); >>>> >>>> This is what the debugger returns when Inspecting the return value of the above >>>> statement - you can see it is a "tr": >>>> [IElement[name=tr wrapped=HtmlTableRow[<tr >>>> class="rich-picklist-source-row" >>>> id="genTabViewId:genTabFrm:availableGroups:source::0">]]] >>>> >>>> I would expect consistent results when calling both of these getElementsByXPath >>>> methods. What's going on? >>>> >>>> Thanks. >>>> >>>> -----Original Message----- >>>> From: jevon [mailto:je...@je...] >>>> Sent: Thursday, August 16, 2012 8:56 PM >>>> To: Usage problems for JWebUnit >>>> Subject: Re: [JWebUnit-users] clickElementByXPath failing >>>> >>>> Hi, >>>> >>>> I can't look at the JWebUnit source right now, but it sounds like >>>> getPageSource() just dumps out the original source of the page, i.e. >>>> without Javascript DOM modifications, whereas page.asXml() dumps the >>>> runtime content of the page itself, i.e. after Javascript/AJAX has >>>> modified the page. Or perhaps the source page does not validate, thus >>>> some of the elements are lost. >>>> >>>> What happens if you execute getElementsByXPath("//tr")? >>>> >>>> Cheers >>>> Jevon >>>> >>>> On Fri, Aug 17, 2012 at 8:47 AM, Parham, Clinton <cp...@bi...> >>>> wrote: >>>>> Hello, >>>>> >>>>> We're using JWebUnit 3 to test a JSF web application that uses JBoss >>>> RichFaces AJAX enabled components. >>>>> >>>>> At one point in the test, a call to >>>> clickElementByXPath("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']") >>>> is made but it fails with this: >>>>> >>>>> java.lang.AssertionError: Unable to locate element with xpath >>>> "//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']" >>>>> at org.junit.Assert.fail(Assert.java:91) >>>>> at org.junit.Assert.assertTrue(Assert.java:43) >>>>> at >>>> net.sourceforge.jwebunit.junit.WebTester.assertElementPresentByXPath(WebTester.java:2109) >>>>> at >>>> net.sourceforge.jwebunit.junit.WebTester.clickElementByXPath(WebTester.java:2673) >>>>> at >>>> com.xyz.util.EnrollmentUtil.setGeneralTabFields(EnrollmentUtiljava:165) >>>>> ... >>>>> >>>>> Just before making the clickElementByXPath call, we execute >>>> Thread.sleep(5000) to account for AJAX activity and then we dump the page >>>> content two ways to see what's going on: >>>>> [1] FileUtils.writeStringToFile(new File(filename), getPageSource()); >>>>> and >>>>> [2] HtmlUnitTestingEngineImpl engine = (HtmlUnitTestingEngineImpl) >>>> getTestingEngine(); >>>>> HtmlPage page = ((HtmlPage) engine.getCurrentWindow().getEnclosedPage()); >>>>> FileUtils.writeStringToFile(new File(filename), page.asXml()); >>>>> >>>>> The dumps are different which is quite surprising. When viewing the file >>>> generated by method [1] in Chrome, the "tr" element is not present. >>>> But it is present when viewing the file generated by method [2]. >>>>> >>>>> What is happening? >>>>> >>>>> >>>>> The contents contained herein may contain confidential information. If you >>>> are not the intended recipient, you are hereby notified that any disclosure, >>>> copying, distribution, printing or action taken on the contents is strictly >>>> prohibited. If you have received this email in error, please notify the sender >>>> immediately and delete this message. >>>>> >>>>> >>>> ------------------------------------------------------------------------------ >>>>> Live Security Virtual Conference >>>>> Exclusive live event will cover all the ways today's security and >>>>> threat landscape has changed and how IT managers can respond. Discussions >>>>> will include endpoint security, mobile security and the latest in malware >>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>>> _______________________________________________ >>>>> JWebUnit-users mailing list >>>>> JWe...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>> >>>> ------------------------------------------------------------------------------ >>>> Live Security Virtual Conference >>>> Exclusive live event will cover all the ways today's security and >>>> threat landscape has changed and how IT managers can respond. Discussions >>>> will include endpoint security, mobile security and the latest in malware >>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>> _______________________________________________ >>>> JWebUnit-users mailing list >>>> JWe...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>> >>>> ------------------------------------------------------------------------------ >>>> Live Security Virtual Conference >>>> Exclusive live event will cover all the ways today's security and >>>> threat landscape has changed and how IT managers can respond. Discussions >>>> will include endpoint security, mobile security and the latest in malware >>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>> _______________________________________________ >>>> JWebUnit-users mailing list >>>> JWe...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>>> >>> >>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. Discussions >>> will include endpoint security, mobile security and the latest in malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> _______________________________________________ >>> JWebUnit-users mailing list >>> JWe...@li... >>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>> >>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. Discussions >>> will include endpoint security, mobile security and the latest in malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> _______________________________________________ >>> JWebUnit-users mailing list >>> JWe...@li... >>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>> >> >>------------------------------------------------------------------------------ >>Live Security Virtual Conference >>Exclusive live event will cover all the ways today's security and >>threat landscape has changed and how IT managers can respond. Discussions >>will include endpoint security, mobile security and the latest in malware >>threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>_______________________________________________ >>JWebUnit-users mailing list >>JWe...@li... >>https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> >> > >------------------------------------------------------------------------------ >Live Security Virtual Conference >Exclusive live event will cover all the ways today's security and >threat landscape has changed and how IT managers can respond. Discussions >will include endpoint security, mobile security and the latest in malware >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >_______________________________________________ >JWebUnit-users mailing list >JWe...@li... >https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > > |
From: Julien H. <he...@ya...> - 2012-08-22 07:14:09
|
Hi guys, Jevon, in the same file I see: <tr class="rich-picklist-source-row" id="genTabViewId:genTabFrm:availableGroups:source::0"> <td class="rich-picklist-source-cell"> <img alt=" " src="/saas/spring/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/images/spacer.gif" style="width:1px;height:1px;"/> CPARHAMsaasBill1Pri1 <input autocomplete="off" id="genTabViewId:genTabFrm:availableGroups:source::0StateInput" name="genTabViewId:genTabFrm:availableGroups:source::0" type="hidden" value="124685"/> </td> </tr> so for me there is actually a tr with id=genTabViewId:genTabFrm:availableGroups:source::0 Clint, I have created a small test case (removing all relative js/css imports from the html) and it is working fine: URL url = this.getClass().getResource("/dump0b.html"); String urlStr = url.toString(); String baseUrl = urlStr.substring(0, urlStr.lastIndexOf("/")); getTestContext().setBaseUrl(baseUrl); setScriptingEnabled(false); //Need to disable JS because of missing external references beginAt("/dump0b.html"); assertNotNull(getElementById("genTabViewId:genTabFrm:availableGroups:source::0")); assertEquals(1, getElementsByXPath("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']").size()); So the problem should come from JS, but unfortunately I can't help without a reproducible test case. I mean some standalone html + java like the previous test. If you manage to extract all JS references of your framework (I guess JSF + richfaces) and create a test case it would be possible to investigate. Regards, Julien >________________________________ > De : jevon <je...@je...> >À : Usage problems for JWebUnit <jwe...@li...> >Envoyé le : Mercredi 22 août 2012 4h44 >Objet : Re: [JWebUnit-users] clickElementByXPath failing > >Hi Clint, > >When I look at that source, it doesn't look like *any* object has an >id of 'genTabViewId:genTabFrm:availableGroups:source::0'. There is an >object with a @name of >'genTabViewId:genTabFrm:availableGroups:source::0', but that is an ><input>... > >Perhaps the id="" attribute is not escaped properly (and the engine >has to drop it). The valid characters for an ID attribute in HTML 4.01 >are /[a-z][a-z0-9:-_\.]*/i, so it's not that the id attribute is >incorrect - likewise, <tr>s are allowed in HTML 4.01 to have id >attributes. > >In fact, *none* of the elements in that XML source have an id >attribute. Interesting. > >Jevon > >On Sat, Aug 18, 2012 at 1:19 AM, Parham, Clinton <cp...@bi...> wrote: >> Hi Julien, >> >> Thank you for replying. >> >> I have attached the asXML dump of the page after Thread.sleep(10000) to account for AJAX activity. >> >> When I open the dumped content in Chrome and enter the following into the JavaScript console, the "tr" I'm trying to click is found: >> $x("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']") >> >> Looking forward to your perspective. >> >> Clint >> >> -----Original Message----- >> From: Julien HENRY [mailto:he...@ya...] >> Sent: Friday, August 17, 2012 3:25 AM >> To: Usage problems for JWebUnit >> Subject: Re: [JWebUnit-users] clickElementByXPath failing >> >> Hi, >> >> I've just tested to locate a tr element by id using the same xpath expression and it is working fine. Are you not encountering timing issue? If you are using AJAX to update the page there could be different results depending on execution speed. >> >> Concerning diference between getPageSource and asXml Jevon is right: getPageSource returns the original source returned by the server while asXml is a dump of the current state of the DOM. >> >> Could you please send us the result of asXml() when your test failed? >> >> Regards, >> >> Julien >> >> >> ----- Mail original ----- >>> De : "Parham, Clinton" <cp...@bi...> >>> À : Usage problems for JWebUnit <jwe...@li...> >>> Cc : >>> Envoyé le : Vendredi 17 août 2012 4h57 >>> Objet : Re: [JWebUnit-users] clickElementByXPath failing >>> >>> When executing getElementsByXPath("//tr") I get back 88 matches. >>> >>> But it gets more interesting: >>> >>> The following (from my original clickElementByXPath) returns zero matches: >>> getElementsByXPath("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']"); >>> >>> But this returns what I'm looking for (only changed "tr" to >>> "*"): >>> getElementsByXPath("//*[@id='genTabViewId:genTabFrm:availableGroups:source::0']"); >>> >>> This is what the debugger returns when Inspecting the return value of the above >>> statement - you can see it is a "tr": >>> [IElement[name=tr wrapped=HtmlTableRow[<tr >>> class="rich-picklist-source-row" >>> id="genTabViewId:genTabFrm:availableGroups:source::0">]]] >>> >>> I would expect consistent results when calling both of these getElementsByXPath >>> methods. What's going on? >>> >>> Thanks. >>> >>> -----Original Message----- >>> From: jevon [mailto:je...@je...] >>> Sent: Thursday, August 16, 2012 8:56 PM >>> To: Usage problems for JWebUnit >>> Subject: Re: [JWebUnit-users] clickElementByXPath failing >>> >>> Hi, >>> >>> I can't look at the JWebUnit source right now, but it sounds like >>> getPageSource() just dumps out the original source of the page, i.e. >>> without Javascript DOM modifications, whereas page.asXml() dumps the >>> runtime content of the page itself, i.e. after Javascript/AJAX has >>> modified the page. Or perhaps the source page does not validate, thus >>> some of the elements are lost. >>> >>> What happens if you execute getElementsByXPath("//tr")? >>> >>> Cheers >>> Jevon >>> >>> On Fri, Aug 17, 2012 at 8:47 AM, Parham, Clinton <cp...@bi...> >>> wrote: >>>> Hello, >>>> >>>> We're using JWebUnit 3 to test a JSF web application that uses JBoss >>> RichFaces AJAX enabled components. >>>> >>>> At one point in the test, a call to >>> clickElementByXPath("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']") >>> is made but it fails with this: >>>> >>>> java.lang.AssertionError: Unable to locate element with xpath >>> "//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']" >>>> at org.junit.Assert.fail(Assert.java:91) >>>> at org.junit.Assert.assertTrue(Assert.java:43) >>>> at >>> net.sourceforge.jwebunit.junit.WebTester.assertElementPresentByXPath(WebTester.java:2109) >>>> at >>> net.sourceforge.jwebunit.junit.WebTester.clickElementByXPath(WebTester.java:2673) >>>> at >>> com.xyz.util.EnrollmentUtil.setGeneralTabFields(EnrollmentUtiljava:165) >>>> ... >>>> >>>> Just before making the clickElementByXPath call, we execute >>> Thread.sleep(5000) to account for AJAX activity and then we dump the page >>> content two ways to see what's going on: >>>> [1] FileUtils.writeStringToFile(new File(filename), getPageSource()); >>>> and >>>> [2] HtmlUnitTestingEngineImpl engine = (HtmlUnitTestingEngineImpl) >>> getTestingEngine(); >>>> HtmlPage page = ((HtmlPage) engine.getCurrentWindow().getEnclosedPage()); >>>> FileUtils.writeStringToFile(new File(filename), page.asXml()); >>>> >>>> The dumps are different which is quite surprising. When viewing the file >>> generated by method [1] in Chrome, the "tr" element is not present. >>> But it is present when viewing the file generated by method [2]. >>>> >>>> What is happening? >>>> >>>> >>>> The contents contained herein may contain confidential information. If you >>> are not the intended recipient, you are hereby notified that any disclosure, >>> copying, distribution, printing or action taken on the contents is strictly >>> prohibited. If you have received this email in error, please notify the sender >>> immediately and delete this message. >>>> >>>> >>> ------------------------------------------------------------------------------ >>>> Live Security Virtual Conference >>>> Exclusive live event will cover all the ways today's security and >>>> threat landscape has changed and how IT managers can respond. Discussions >>>> will include endpoint security, mobile security and the latest in malware >>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>>> _______________________________________________ >>>> JWebUnit-users mailing list >>>> JWe...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>> >>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. Discussions >>> will include endpoint security, mobile security and the latest in malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> _______________________________________________ >>> JWebUnit-users mailing list >>> JWe...@li... >>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>> >>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. Discussions >>> will include endpoint security, mobile security and the latest in malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> _______________________________________________ >>> JWebUnit-users mailing list >>> JWe...@li... >>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >>> >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> JWebUnit-users mailing list >> JWe...@li... >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> JWebUnit-users mailing list >> JWe...@li... >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> > >------------------------------------------------------------------------------ >Live Security Virtual Conference >Exclusive live event will cover all the ways today's security and >threat landscape has changed and how IT managers can respond. Discussions >will include endpoint security, mobile security and the latest in malware >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >_______________________________________________ >JWebUnit-users mailing list >JWe...@li... >https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > > |
From: jevon <je...@je...> - 2012-08-22 02:45:05
|
Hi Clint, When I look at that source, it doesn't look like *any* object has an id of 'genTabViewId:genTabFrm:availableGroups:source::0'. There is an object with a @name of 'genTabViewId:genTabFrm:availableGroups:source::0', but that is an <input>... Perhaps the id="" attribute is not escaped properly (and the engine has to drop it). The valid characters for an ID attribute in HTML 4.01 are /[a-z][a-z0-9:-_\.]*/i, so it's not that the id attribute is incorrect - likewise, <tr>s are allowed in HTML 4.01 to have id attributes. In fact, *none* of the elements in that XML source have an id attribute. Interesting. Jevon On Sat, Aug 18, 2012 at 1:19 AM, Parham, Clinton <cp...@bi...> wrote: > Hi Julien, > > Thank you for replying. > > I have attached the asXML dump of the page after Thread.sleep(10000) to account for AJAX activity. > > When I open the dumped content in Chrome and enter the following into the JavaScript console, the "tr" I'm trying to click is found: > $x("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']") > > Looking forward to your perspective. > > Clint > > -----Original Message----- > From: Julien HENRY [mailto:he...@ya...] > Sent: Friday, August 17, 2012 3:25 AM > To: Usage problems for JWebUnit > Subject: Re: [JWebUnit-users] clickElementByXPath failing > > Hi, > > I've just tested to locate a tr element by id using the same xpath expression and it is working fine. Are you not encountering timing issue? If you are using AJAX to update the page there could be different results depending on execution speed. > > Concerning diference between getPageSource and asXml Jevon is right: getPageSource returns the original source returned by the server while asXml is a dump of the current state of the DOM. > > Could you please send us the result of asXml() when your test failed? > > Regards, > > Julien > > > ----- Mail original ----- >> De : "Parham, Clinton" <cp...@bi...> >> À : Usage problems for JWebUnit <jwe...@li...> >> Cc : >> Envoyé le : Vendredi 17 août 2012 4h57 >> Objet : Re: [JWebUnit-users] clickElementByXPath failing >> >> When executing getElementsByXPath("//tr") I get back 88 matches. >> >> But it gets more interesting: >> >> The following (from my original clickElementByXPath) returns zero matches: >> getElementsByXPath("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']"); >> >> But this returns what I'm looking for (only changed "tr" to >> "*"): >> getElementsByXPath("//*[@id='genTabViewId:genTabFrm:availableGroups:source::0']"); >> >> This is what the debugger returns when Inspecting the return value of the above >> statement - you can see it is a "tr": >> [IElement[name=tr wrapped=HtmlTableRow[<tr >> class="rich-picklist-source-row" >> id="genTabViewId:genTabFrm:availableGroups:source::0">]]] >> >> I would expect consistent results when calling both of these getElementsByXPath >> methods. What's going on? >> >> Thanks. >> >> -----Original Message----- >> From: jevon [mailto:je...@je...] >> Sent: Thursday, August 16, 2012 8:56 PM >> To: Usage problems for JWebUnit >> Subject: Re: [JWebUnit-users] clickElementByXPath failing >> >> Hi, >> >> I can't look at the JWebUnit source right now, but it sounds like >> getPageSource() just dumps out the original source of the page, i.e. >> without Javascript DOM modifications, whereas page.asXml() dumps the >> runtime content of the page itself, i.e. after Javascript/AJAX has >> modified the page. Or perhaps the source page does not validate, thus >> some of the elements are lost. >> >> What happens if you execute getElementsByXPath("//tr")? >> >> Cheers >> Jevon >> >> On Fri, Aug 17, 2012 at 8:47 AM, Parham, Clinton <cp...@bi...> >> wrote: >>> Hello, >>> >>> We're using JWebUnit 3 to test a JSF web application that uses JBoss >> RichFaces AJAX enabled components. >>> >>> At one point in the test, a call to >> clickElementByXPath("//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']") >> is made but it fails with this: >>> >>> java.lang.AssertionError: Unable to locate element with xpath >> "//tr[@id='genTabViewId:genTabFrm:availableGroups:source::0']" >>> at org.junit.Assert.fail(Assert.java:91) >>> at org.junit.Assert.assertTrue(Assert.java:43) >>> at >> net.sourceforge.jwebunit.junit.WebTester.assertElementPresentByXPath(WebTester.java:2109) >>> at >> net.sourceforge.jwebunit.junit.WebTester.clickElementByXPath(WebTester.java:2673) >>> at >> com.xyz.util.EnrollmentUtil.setGeneralTabFields(EnrollmentUtiljava:165) >>> ... >>> >>> Just before making the clickElementByXPath call, we execute >> Thread.sleep(5000) to account for AJAX activity and then we dump the page >> content two ways to see what's going on: >>> [1] FileUtils.writeStringToFile(new File(filename), getPageSource()); >>> and >>> [2] HtmlUnitTestingEngineImpl engine = (HtmlUnitTestingEngineImpl) >> getTestingEngine(); >>> HtmlPage page = ((HtmlPage) engine.getCurrentWindow().getEnclosedPage()); >>> FileUtils.writeStringToFile(new File(filename), page.asXml()); >>> >>> The dumps are different which is quite surprising. When viewing the file >> generated by method [1] in Chrome, the "tr" element is not present. >> But it is present when viewing the file generated by method [2]. >>> >>> What is happening? >>> >>> >>> The contents contained herein may contain confidential information. If you >> are not the intended recipient, you are hereby notified that any disclosure, >> copying, distribution, printing or action taken on the contents is strictly >> prohibited. If you have received this email in error, please notify the sender >> immediately and delete this message. >>> >>> >> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. Discussions >>> will include endpoint security, mobile security and the latest in malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> _______________________________________________ >>> JWebUnit-users mailing list >>> JWe...@li... >>> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> JWebUnit-users mailing list >> JWe...@li... >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> JWebUnit-users mailing list >> JWe...@li... >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > JWebUnit-users mailing list > JWe...@li... > https://lists.sourceforge.net/lists/listinfo/jwebunit-users > |