Jevon, Thanks for your thoughts. I realized that I did in fact need a simpler page to test to make sure that I am correctly using NicelyResynchronizingAjaxController. Using a very simple page, and setting the html of an element, shows that Ajax is in fact working from within JWebUnit/HtmlUnit (using NicelyResynchronizingAjaxController). Thank you for helping me simplify and verify.
NOTE: getPageSource() returns the original page source, before the html element has been modified (as does the browser), so this is not a trustworthy test. However, a call to assertTextPresent() will pass for the new text, and fail for the old text, which is what I would expect. In my test, a slight change of code for registering the function call seemed to make the test fail, so I need to look deeper into this. We are using jQuery, and I am not sure exactly where things are going wrong such that newer text is not able to be found in my more complicated pages. I will need to do some more testing, cutting out most things, and see where it is going wrong. Thanks again. Robert > ------------------------------ > > Date: Wed, 30 Sep 2009 11:18:43 +1300 > From: Jevon Wright <je...@jevon.org> > Subject: Re: [JWebUnit-users] JWebUnit And Ajax Support > To: Usage problems for JWebUnit <jwebunit-users@lists.sourceforge.net> > Message-ID: > <2f3e58960909291518r28f3d71dt4904f03e90ca9...@mail.gmail.com> > Content-Type: text/plain; charset="windows-1252" > > 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 > functionality, telling Thread.sleep to wait for a period of time (which > should allow the call to return), and then checking to see if the call was > successful in some way (setting the value of an input element to something > different, for example). > > getPageSource() might also help in debugging. > > Cheers > Jevon > > On Wed, Sep 30, 2009 at 7:48 AM, Robert R <robert.jb...@gmail.com> wrote: > >> I?m a little unclear about the expected behavior of JWebUnit when >> working with Ajax. I followed the instructions for adding >> NicelyResynchronizingAjaxController to my own build of JWebUnit (found >> here): >> >> http://sourceforge.net/mailarchive/forum.php?thread_name=329488.76625.qm%40web28510.mail.ukl.yahoo.com&forum_name=jwebunit-users >> >> Unfortunately, after making these changes, my Ajax calls still are not >> testable. I am not sure if I configured something incorrectly, or if >> I am simply trying the impossible, and I don?t understand what should >> be possible using JWebUnit. >> >> NOTE: I am making use of the WebTester class, which may have its own >> set of constraints that I am not aware of when it comes to Ajax, >> separate from JWebUnit in general. If that is the case, please >> advise. >> >> When I load a page that has Ajax calls to get additional data and >> manipulate the page ? that data is not appearing in the source. I am >> wondering about the following: >> 1. Are there certain cases where the Ajax calls will be completed and >> others where they will not, depending on how the Ajax calls are >> initiated? >> 2. Can jWebUnit be made to wait until the Ajax calls are complete, >> before returning the page source? >> 3. If I make a call to click on an element which in turn initiates >> some Ajax calls and page manipulation, is there any way in JWebUnit to >> begin working with the newly manipulated version of the page? >> >> Thank you. >> >> Robert ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ JWebUnit-users mailing list JWebUnit-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jwebunit-users