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
---
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,
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
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
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
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
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
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
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
;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
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
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
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
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
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
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,
>
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
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
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
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
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
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
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
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
.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)
>
>
>
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
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
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
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.
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
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
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
ef.startsWith("http://";)) && !identifiedLinks.contains(linkForDup)) {
> boolean shouldInclude = true;
>
> for (final String toAvoid : avoid) {
>if (href.contains(toAvoid)) {
>shouldInclude = false;
>break;
>}
>
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" ?>
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
>
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
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
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
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
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
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
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
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
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
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
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
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
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
; 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:
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
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
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
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
>
>
> 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
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
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
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
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
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
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
60 matches
Mail list logo