Feature Requests item #2697234, was opened at 2009-03-21 00:49
Message generated for change (Comment added) made by jevonwright
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=497985&aid=2697234&group_id=61302

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core API
Group: Release 2.2
>Status: Pending
Priority: 8
Private: No
Submitted By: James Tse (jtse)
Assigned to: Jevon Wright (jevonwright)
Summary: Make HtmlUnit objects accessible

Initial Comment:
I've been trying to figure out a way to synchronize ajax calls instead of using 
Thread.sleep. I know it's possible to do it via HtmlUnit. However, the HtmlUnit 
API is not directly accessible via JWebUnit. I was wondering if it would be 
possible to give users of JWebUnit API direct access to HtmlUnit APIs.

----------------------------------------------------------------------

>Comment By: Jevon Wright (jevonwright)
Date: 2009-11-30 19:35

Message:
You can now (in SVN r815) gain access to the current WebWindow and
WebClient in the HtmlUnitTestingEngineImpl. That is, something like:

WebTester wt;
((HtmlUnitTestingEngineImpl) wt.getTestingEngine()).getWebClient();

For the example above with a new WebClient, you would need to do something
like this (I think, not tested):

1. Create your own subclass of WebTester
2. Override initializeDialog() to create a new ITestingEngine
3. In this method, return a new HtmlUnitTestingEngineImpl(WebClient)

----------------------------------------------------------------------

Comment By: James Tse (jtse)
Date: 2009-03-24 00:59

Message:
There is the NicelyResynchronizingAjaxController (which may be an outdated
approach):

WebClient webClient = new WebClient();
webClient.setAjaxController(new NicelyResynchronizingAjaxController());


And there's also HtmlUnit's ThreadManager.joinAll(long maxWaitMillis)
(which is an experimental API):

http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/ThreadManager.html#joinAll(long)


It would be nice if there was a JWebUnit API call to do this but I think
the API calls to do AJAX synch-ing in HtmlUnit is unstable (as in likely to
change in the future). This is why I suggest exposing the HtmlUnit objects
to give users of JWebUnit the option to use these bleeding edge features.

Thanks :)

----------------------------------------------------------------------

Comment By: Jevon Wright (jevonwright)
Date: 2009-03-23 12:48

Message:
That is a good idea, how does HtmlUnit support synchronising with Ajax
calls? Cheers :)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=497985&aid=2697234&group_id=61302

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
JWebUnit-development mailing list
JWebUnit-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jwebunit-development

Reply via email to