[JWebUnit-users] Calling Javascript from JWebUnit

2009-02-03 Thread Jevon Wright
Hi, I was curious, is there any way to call a Javascript function from JWebUnit and get the results? e.g. something like: String result = (String) callJavascript("myFunction", arg0); assertEquals("expected result", result); Cheers Jevon ---

Re: [JWebUnit-users] Ielement to HtmlElement?

2009-03-09 Thread Jevon Wright
Hi, No there is currently no way to convert IElement to HtmlElement, but this functionality would be important. I've opened up feature request 2677075 to implement this in the next version. https://sourceforge.net/tracker2/?func=detail&aid=2677075&group_id=61302&atid=497985 Cheers! Jevon On Sat,

Re: [JWebUnit-users] Ielement to HtmlElement?

2009-03-09 Thread Jevon Wright
at 2:24 PM, Jevon Wright wrote: > Hi, > > No there is currently no way to convert IElement to HtmlElement, but this > functionality would be important. I've opened up feature request 2677075 to > implement this in the next version. > > https://sourceforge.net/tracker2/?fu

Re: [JWebUnit-users] Re : HtmlUnit configuration ...

2009-04-14 Thread Jevon Wright
Hi, I agree that we should provide an interface to get the testing engine, though it shouldn't really be used. Perhaps adding a method getPageDom(), which returns the XML DOM of the current page (if applicable)? At least in this way, it is testing engine independent. I'll add this to the SF track

Re: [JWebUnit-users] Any open source projects using JWebUnit?

2009-04-29 Thread Jevon Wright
One of my projects (IAML) uses JWebUnit for web testing, but it tests either PHP or Java code that is generated at testing time (its a code generation framework). Jevon On Thu, Apr 30, 2009 at 1:56 AM, Matt Raible wrote: > AppFuse Light uses JWebUnit to test some of its modules. It's still unde

Re: [JWebUnit-users] Re : Ajax feature

2009-06-01 Thread Jevon Wright
Hi, This has (sort of) been requested in the tracker already: https://sourceforge.net/tracker/?func=detail&aid=2697234&group_id=61302&atid=497985 I plan on resolving this in the next week. Cheers Jevon On Tue, Jun 2, 2009 at 2:25 AM, Julien HENRY wrote: > Hi François, > > Unfortunately JWebUni

Re: [JWebUnit-users] Problem while running JwebUnit tests

2009-07-23 Thread Jevon Wright
Hi Pranay, That test code looks fine - what is the source code of the page you are trying to test? It looks like HtmlUnit is falling on a tag, but I'm not very familiar with how HtmlUnit works. Jevon On Thu, Jul 23, 2009 at 11:47 PM, Pranay Prabhat wrote: > Hi, > > Day before yesterday i was b

Re: [JWebUnit-users] Find Element on page

2009-07-24 Thread Jevon Wright
Hi, Generally it's better to not have these sorts of if/else blocks in test cases. If you are testing a whole lot of generated pages, then I think it's better to write test cases for the generation code. In JUnit all test case methods assertXXX() should throw an AssertionFailedError if the test f

Re: [JWebUnit-users] Re : Problem while running JwebUnit tests

2009-07-24 Thread Jevon Wright
Hi Pranay, You shouldn't need to specify which testing engine to use, as it should default to HtmlUnit (unless I'm mistaken). Can you post the rest of the stack trace up to ExampleWebTestCase.testSearch()? Jevon On Sat, Jul 25, 2009 at 1:30 AM, Pranay Prabhat wrote: > Many Thanks for answers b

Re: [JWebUnit-users] Find Element on page

2009-07-25 Thread Jevon Wright
;s closest to > what I need. I would've preferred to have a method that didn't throw an > error, so instead I just wrote one in my unit test that wrapped around that > logic and returns a boolean to do what I want. > > thx > > timo > > > On Fri, Jul 24, 2009 at

Re: [JWebUnit-users] Re : how to click "ok" button that appears in a popup window

2009-08-04 Thread Jevon Wright
Isn't that message box just a standard Javascript confirm() call, rather than a different browser window? In that case, you should be able to use setExpectedJavaScriptConfirm(String message, boolean action). Jevon On Tue, Aug 4, 2009 at 7:21 PM, Julien HENRY wrote: > Hi Pradeep, > > The first st

[JWebUnit-users] Get current request URL

2009-08-05 Thread Jevon Wright
Hi, Is there any way to access the current page URL within a JWebUnit test? I know if I can use getTestContext().getBaseUrl() I can get the base URL for the request, but I can't find a way to retrieve the current URL. Cheers Jevon

[JWebUnit-users] Obsolete content type encountered: 'text/javascript'

2009-08-12 Thread Jevon Wright
Hi, I recently upgraded to the latest JWebUnit 2.2 (containing HtmlUnit 2.5) and started getting the following warnings: 17:51:23 WARN html.HtmlPage: Obsolete content type encountered: 'text/javascript'. The solution is to change

Re: [JWebUnit-users] tests fail with session_regenerate_id

2009-08-27 Thread Jevon Wright
Hi, I couldn't reproduce your problem, could you post your scripts? I tried it with the following JWebUnit test: public void test1() { getTestContext().setBaseUrl("http://localhost:8080//";); beginAt("index.php"); IElement element = getElementByXPath("//b"); String initial = e

Re: [JWebUnit-users] JWebUnit And Ajax Support

2009-09-29 Thread Jevon Wright
Hi, I haven't yet played around with the NicelyResynchronizingAjaxController implementation. However, WebTester directly calls HtmlUnit, so the only constraints around AJAX in JWebUnit are those in HtmlUnit (not many). Can you confirm that an AJAX call works at all? e.g. calling AJAX functionalit

Re: [JWebUnit-users] http 407 - proxy error

2009-10-18 Thread Jevon Wright
Hi Nuno, I don't have access to an NTLM environment, but you could try installing a packet sniffer and see what the traffic between JWebUnit/HtmlUnit and your NTLM proxy actually is. Where is the 407 being thrown in the code? Jevon On Sat, Oct 17, 2009 at 4:54 AM, Nuno Feliciano wrote: > Hi, >

Re: [JWebUnit-users] Re : getCookie Error External Javascript

2009-10-23 Thread Jevon Wright
Hi, alert() messages are only checked once the page is redirected or reloaded, so if there is an exception before the page is closed, you will not see the alert message. Can you paste the NullPointerException stack trace? Jevon On Fri, Oct 23, 2009 at 3:42 PM, Nelson Biasura < nelson.bias...@aur

Re: [JWebUnit-users] Documentation and procedure jWebUnit

2009-10-23 Thread Jevon Wright
Hi, Assuming you already know how to run JUnit test cases, you should be able to get JWebUnit to work by following the quickstart instructions on http://jwebunit.sourceforge.net/quickstart.html and then run these test cases exactly like normal JUnit test cases with Ant. Make sure that the required

Re: [JWebUnit-users] javascript execution failed

2009-11-25 Thread Jevon Wright
Hi, It looks like this is a problem with HtmlUnit. Are you using the latest version of HtmlUnit? I might suggest asking the HtmlUnit mailing list. PS: You should post these messages to the users list (CC'd), not directly to the developers. Cheers Jevon On Wed, Nov 18, 2009 at 12:53 AM, jia yu

Re: [JWebUnit-users] Javascript onmouseover

2009-11-26 Thread Jevon Wright
There is an open feature request for this feature (making HtmlUnit objects accessible): http://sourceforge.net/tracker/?func=detail&aid=2697234&group_id=61302&atid=497985 It's a very good idea though, it should be possible to test mouse activity. Jevon On Thu, Nov 26, 2009 at 6:23 PM, Eric Murph

Re: [JWebUnit-users] Issues running JWebUnit test (tinyMce and javascript Confirm box)

2009-12-22 Thread Jevon Wright
Hi Emerson, For your first exception, it looks like it is being thrown when the page is accessed. It looks like the "tinyMCE" variable is not defined. Can you debug your script to make sure that it is defined before it is loaded? We use HtmlUnit natively and it appears this supports TinyMCE withou

Re: [JWebUnit-users] Issues running JWebUnit test (tinyMce and javascript Confirm box)

2010-01-11 Thread Jevon Wright
gt; consecutive confirm boxes? I tried the method that requires a string array > and a boolean array (setExpectedJavaScriptConfirm(String[], boolean[])) but > it didnt work. I got the same exception as before with this. Can you help me > out a little further? > > Thanks a lot in ad

Re: [JWebUnit-users] Issues with submit buttons in JWebUnit

2010-02-16 Thread Jevon Wright
Hi Lakshmi, Can you post the HTML source code of the generated buttons, and the code you were trying to use with clickElementByXPath()? The two libraries you have mentioned are server-side libraries. JWebUnit actually navigates the web application from the point of view of a browser, using HtmlUn

Re: [JWebUnit-users] Issues with submit buttons in JWebUnit

2010-02-17 Thread Jevon Wright
rg.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) > &g

Re: [JWebUnit-users] Issues with submit buttons in JWebUnit

2010-02-18 Thread Jevon Wright
.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) > > >

Re: [JWebUnit-users] Hi and thanks

2010-02-23 Thread Jevon Wright
Hi Tim, 1- The list is managed by Sourceforge so it is public. The archives are online at http://sourceforge.net/mailarchive/forum.php?forum_name=jwebunit-users. 2- If I recall correctly, we moved from 2.x to 3.0 in anticipation of some major contributions by another contributor. I don't think th

Re: [JWebUnit-users] How to use JWebUnit Table API's for HTML Tables without names or id

2010-02-24 Thread Jevon Wright
Hi Lakshmi, You could try getElementsByXPath("//table/tr[0]/th[contains(text(), 'Attempts'])") or something similar. There's no straightforward way to do what you're asking, but using a series of XPath expressions I think you should be able to manage that. Perhaps something like 1. Get the index

Re: [JWebUnit-users] JWebUnit 2.3 released !

2010-03-03 Thread Jevon Wright
Thanks for sorting out the 2.3 release Julien :) Cheers Jevon On Thu, Mar 4, 2010 at 10:49 AM, Julien HENRY wrote: > Hi all, > > I'm please to announce the release of JWebUnit 2.3. This release includes > update of backend libraries: HtmlUnit, Selenium and JUnit. > > Release notes are available

Re: [JWebUnit-users] assertElementByXpath

2010-03-09 Thread Jevon Wright
Hi, Sounds like the XPath is not correct. You could check with getElementByXPath() which will throw additional exception information if necessary. Special characters such as & may need to be escaped. Since you are checking for a URL, the URL may often change so this may not be the best approach.

Re: [JWebUnit-users] JWebUnit AJAX followup.

2010-03-22 Thread Jevon Wright
Hi Dave, One-line support for the NicelyResynchronizingAjaxController() is in progress, but in the meantime you can use the code at: http://sourceforge.net/tracker/?func=detail&aid=2697234&group_id=61302&atid=497985 However, if you are having problems with Javascript on the page executing before

Re: [JWebUnit-users] Browser problems

2010-04-12 Thread Jevon Wright
Hi, For some of my tests I need to use the Google Maps API which throws syntax errors, so I need to disable throwing exceptions on syntax errors: HtmlUnitTestingEngineImpl engine = (HtmlUnitTestingEngineImpl) getTestingEngine(); engine.setThrowExceptionOnScriptError(false); You should only

Re: [JWebUnit-users] How to get all links in current page

2010-04-20 Thread Jevon Wright
Hi Benoit, Interesting question - I am sure you could do something like that with JWebUnit (through xpath, etc), but I imagine using a piece of software developed specifically for dumping a site would be better, unless you want to verify some unit tests across an entire site? Software like wget c

Re: [JWebUnit-users] How to get all links in current page

2010-04-21 Thread Jevon Wright
ef.startsWith("http://";)) && !identifiedLinks.contains(linkForDup)) { > boolean shouldInclude = true; > > for (final String toAvoid : avoid) { >if (href.contains(toAvoid)) { >shouldInclude = false; >break; >} >

Re: [JWebUnit-users] How to get all links in current page

2010-04-21 Thread Jevon Wright
hings like this: > > 2010-04-20 14:40:14,591 DEBUG [wire.header#?] (main:) >> "GET > /escape/indexData.html?id=.dMIBE0PEU HTTP/1.1[\r][\n]" > ... > 2010-04-20 14:40:14,607 DEBUG [wire.content#?] (main:) << " version="1.0" encoding="UTF-8" ?>

Re: [JWebUnit-users] entering username and password

2010-04-21 Thread Jevon Wright
Hi Chinna, That looks like a "basic authentication" dialog box - search for this and you should be able to find some documentation to help :) Cheers Jevon On Thu, Apr 22, 2010 at 8:07 AM, nithin aa wrote: > Hi, > > I am trying to write a jwebunit test for one of my intranet application.It >

Re: [JWebUnit-users] Testing for Valid XHTML

2010-04-22 Thread Jevon Wright
Hi Benoit, I don't know of an easy way to do this - however I agree it would be extremely valuable. I think right now the only approach is to download a validating parser from W3.org (or something). I don't know of any validating parsers in Java, but I haven't done an exhaustive search. However if

Re: [JWebUnit-users] entering username and password

2010-04-22 Thread Jevon Wright
on On Fri, Apr 23, 2010 at 9:53 AM, nithin aa wrote: > Hi Jevon, > > Thanks for getting back.I did not get ur email clearly.Can you please tell > me what to searchI appreciate you taking time > > > Thanks > Nithin > > On Wed, Apr 21, 2010 at 7:12

[JWebUnit-users] IElement type()

2010-05-17 Thread Jevon Wright
Hi all, I needed a method to access HtmlUnit's type() method, so that I could enter in text directly to an input (i.e. calling onKeyPress without calling onChange). In the latest SVN there is a new method to access the HtmlElement directly, so I could implement the type() method as follows: IElem

Re: [JWebUnit-users] GPL Exception?

2010-06-01 Thread Jevon Wright
Hi Glyn, We recently switched the project licence from GPL to LGPL, which can be linked to, and extended by, by EPL software (I'm using JWebUnit in my EPL project too). I think the next release will have the appropriate license file, etc. As far as I know, as long as you don't modify the JWebUnit

Re: [JWebUnit-users] TextPresent after call ajax with JWebUnit

2010-06-14 Thread Jevon Wright
Hi Ale, Try following the example on http://jwebunit.sourceforge.net/, in particular you should be extending WebTestCase. You can then use assertTextPresent() directly. Cheers Jevon On Tue, Jun 15, 2010 at 2:22 AM, Alessandra Grande < alessandra_gra...@yahoo.it> wrote: > Hi, i am develop my tes

Re: [JWebUnit-users] how to assert that some row in a table contains the actual values

2010-08-22 Thread Jevon Wright
Hi, If the row, cell or containing label or span has a particular ID, you could use IElement getElementByID(); otherwise you could use an XPath expression like //tab...@id=xxx]/tr[2]/td[2], etc. Jevon On Fri, Aug 20, 2010 at 8:38 PM, Rajiv Abraham wrote: > Hi, My web page displays the following

Re: [JWebUnit-users] Re : Res: Re : jwebunit with JSF: Dynamic page takes a long time!

2010-09-01 Thread Jevon Wright
Hi Alexandre, I would recommend running the test in a debug environment, and breaking execution intermittently to try and work out why it is taking so long to execute. This is fairly straightforward to do in Eclipse, you may need to install some Java sources as well. Normally HtmlUnit/JWebUnit is

Re: [JWebUnit-users] Accessing dynamic images created in Javascript

2010-09-30 Thread Jevon Wright
Hi Jeff, Firstly yes, JWebUnit/HtmlUnit handles most types of Javascript, so it should be fine as long as your Javascript is compliant. Yes, using an XPath approach sounds fine. Have you tried searching through all //img, and making sure your image is first present there? Perhaps the @src attribu

Re: [JWebUnit-users] Test suites?

2010-09-30 Thread Jevon Wright
Hi Jeff, JWebUnit extends JUnit, so you can create test suites in the same way you would create a test suite for JUnit tests. The test suite can then be run directly. For example: http://code.google.com/p/iaml/source/browse/trunk/org.openiaml.model.tests/src/org/openiaml/model/tests/codegen/model

Re: [JWebUnit-users] javascript/JQuery problem: RESOLVED

2010-10-19 Thread Jevon Wright
Hi Jeff, It looks like you may have been creating the image dynamically using AJAX? By default, JWebUnit returns as soon as a page has loaded (and executes onLoad and inline scripts), and not when all AJAX or timed scripts return - which can cause this sort of problem. Have you looked at using the

Re: [JWebUnit-users] Re : a question regarding assertTitleNotSame

2010-11-23 Thread Jevon Wright
I suggest renaming assertTitleNotSame() to assertTitleNotEquals(), and deprecating the assertTitleNotSame() method (which calls assertTitleNotEquals()). There are no other xxxNotSame() methods in the API. Jevon On Wed, Nov 24, 2010 at 3:40 AM, Julien HENRY wrote: > Hi Tony, > > As I can't say i

Re: [JWebUnit-users] Full Page DOM

2011-01-22 Thread Jevon Wright
Hi Eric, a few ideas: - What browser are you using to view source? - Do you use client-side Javascript or server-side code to populate "controlPanelMenu"? - Can you access the source code of the application to try and pinpoint the problem? As far as I know, in Firefox the "view source" only displ

Re: [JWebUnit-users] Full Page DOM

2011-01-31 Thread Jevon Wright
ij 10 and I > hit my break point, dumpout getPageSource to a text file and browse through > it to find elements, xpaths, etc. > > I'll take a closer look at the js code to see which steps are firing. > > Thanks for your help > > Eric > > -Original Message- &g

Re: [JWebUnit-users] Full Page DOM

2011-02-03 Thread Jevon Wright
; doing its thing, should I be able to dump out the new DOM? If so I haven't > been able to accomplish that is there a way? > > Thanks for your help > Eric > > -Original Message- > From: Jevon Wright [mailto:je...@jevon.org] > Sent: Monday, January 31, 2011 9:

Re: [JWebUnit-users] JWebUnit connection error

2011-05-22 Thread Jevon Wright
Hi Yabing, You need to subscribe to the mailing list in order to post. As the stacktrace says, the connection timed out, and it looks like you have been trying to set proxy details. Did you have issues with setting these? Personally I only use JWebUnit with local development copies of my applicat

Re: [JWebUnit-users] Issue between Debug and RUn mode in Jweb

2011-06-15 Thread Jevon Wright
Hi Devishri, If you cannot post to the JWebUnit users list, make sure that you are subscribed to the mailing list. JWebUnit cannot distinguish between run and debug modes. I assume you are running your code via Eclipse debug mode? Is there AJAX on your tested page? If so, debug mode might be givi

Re: [JWebUnit-users] Issue between Debug and RUn mode in Jweb

2011-06-15 Thread Jevon Wright
recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 550 550 unknown user (state 14). Jevon On Thu, Jun 16, 2011 at 1:03 PM, Jevon Wright wrote: > Hi Devishri, > > If you cannot post to the JWebUnit u

Re: [JWebUnit-users] Issues upgrading from version 2.2 to version 3

2011-08-22 Thread Jevon Wright
Hi Julien, > I would like to hear other voices here: keep or remove deprecated flag on > JUnit 3 stuff? I'd like to keep JUnit 3 support, my project still uses the JUnit 3 API extensively, but I haven't yet updated to the latest release of JWebUnit. What work would be necessary to keep both APIs

Re: [JWebUnit-users] Need help for LoginFailureTestCase scenario.

2012-03-15 Thread Jevon Wright
> > > Thanks and Regards, > > > > Harsha Puttaswamy > > From: soundasl...@gmail.com [mailto:soundasl...@gmail.com] On Behalf Of > Jevon Wright > Sent: Thursday, March 15, 2012 1:39 AM > To: Harsha Puttaswamy > Cc: jwebunit-development-ow...@lists.sourceforge.n

Re: [JWebUnit-users] jWebUnit and HTTPS with self-signed certificate

2013-07-03 Thread Jevon Wright
Hi Senthil, Self-signed SSL certificates are not very fun in Java at all. I haven't done any SSL testing in JWebUnit myself. Do you need to check the SSL certificate at all, or could you just force Java to accept all SSL certificates? Normally I'd suggest importing your self-signed certificate a

Re: [JWebUnit-users] Testing site with self-signed certificate

2013-10-01 Thread Jevon Wright
Hi Gunnar, There was a post a few months ago about this very issue - check out http://sourceforge.net/mailarchive/forum.php?thread_name=CAENZhnUEH2DUUVXvwKr5CS1FofMWdO3ZN3HGxUG2LXse4fd3EA%40mail.gmail.com&forum_name=jwebunit-users and see if this helps. Cheers Jevon On Wed, Oct 2, 2013 at 12:22

Re: [JWebUnit-users] looking for examples and clarifications

2014-05-14 Thread Jevon Wright
Hi, It looks like this could be a bug with HtmlUnit. All clickButtonWithText() does is send a click event through to HtmlUnit. Could you follow it up with them? Is the URL of the page you are testing publicly available? Alternatively maybe you can disable your CSS styles and see if there is a sty

Re: [JWebUnit-users] looking for examples and clarifications

2014-05-15 Thread Jevon Wright
t > working for me : the content of the file is the page source which makes me > wonder what the click event is actually calling ... where can I find some > examples/documentation of JWebUnit ? > > > p.s. : I will try to follow up with the HtmlUnit people about the > exception

Re: [JWebUnit-users] java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal

2014-08-31 Thread Jevon Wright
We can't help with usage problems unrelated to JWebUnit, but it looks like you are missing the DOM JAR from your classpath - perhaps a missing dependency in your pom.xml (I am not very familiar with Maven). Cheers Jevon On Sun, Aug 31, 2014 at 8:43 AM, Rusty Wright wrote: > I forgot to includ

Re: [JWebUnit-users] Testing a page created from string

2014-09-07 Thread Jevon Wright
I don't think there's any way to do this with JWebUnit/HtmlUnit (most web pages load additional resources - JS, CSS etc) - perhaps you could look at using a web server component like Jetty (which we use for our tests ourselves) to host the generated HTML, which you can then connect to to test. Che