Feature Requests item #1744631, was opened at 2007-06-28 09:16
Message generated for change (Settings changed) made by henryju
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=497985&aid=1744631&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: HtmlUnit plugin
Group: Release 1.5
Status: Open
Priority: 5
Private: No
Submitted By: Matthew Jensen (mmj123)
>Assigned to: Nobody/Anonymous (nobody)
Summary: Configure HtmlUnit more

Initial Comment:
Would like to be able to configure the HtmlUnit more.

The initWebClient method sets up the HtmlUnit using hard coded variables.  
These options should be exposed some how.  Options such as browser version, and 
throwExceptionOnScriptError would be great to be able to set.

We couldn't extend the HtmlUnitDialog class because all the fields and useful 
methods were private.

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

Comment By: Rob (robdesbois)
Date: 2007-09-17 16:39

Message:
Logged In: YES 
user_id=1369423
Originator: NO

I agree strongly with this one - I had a problem with a couple of DOM
functions not being available in JavaScript even though they are
implemented.

Following discussions on the jWebUnit and htmlUnit mailing lists, the
reason this was so is that the BrowserVersion is hardcoded to IE5. A quick
recompile of HtmlUnitDialog.java replacing:
   BrowserVersion bv = new
BrowserVersion(BrowserVersion.INTERNET_EXPLORER,
      "4.0", testContext.getUserAgent(), "1.2", 6);
with
   BrowserVersion bv = BrowserVersion.FIREFOX_2;
fixed my problem, but is a bit of a nasty hack.

The ability to manually configure this would be a magnificent addition!

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

Comment By: Matthew Jensen (mmj123)
Date: 2007-06-29 01:41

Message:
Logged In: YES 
user_id=615288
Originator: YES

We actually copied the HtmlUnitDialog class and extended it to use a
properties file to set defaults like the browser version etc.  This is
great but it would be useful to be able to easily set them programatically
on a per test case basis as well.

The first change in this regard would be to remove the
TestingEngineRegistry class and allow the test methods to set the
TestingEngine directly by setting an object (or factory).  That way we can
set a default in our normal setup method, or overwrite in any test method
as needed.

This allow exposes the TestEngine instance so we can configure if needed. 
There is a minor concern here that the test cases don't get tied to a
particular testing engine, but by setting a specific key you are already
dependent on a specific TestEngine.  If a client wants TestingEngine
independence then that can be achieved through a smart
TestingEngineFactory.

If you want me to be more specific I can provide code examples and/or
patches.


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

Comment By: Julien HENRY (henryju)
Date: 2007-06-28 15:27

Message:
Logged In: YES 
user_id=1235926
Originator: NO

I know it's a serious concern. TestContext is not a good solution to
configure all this parameters, because of specificities of each
TestingEngine.

I was thinking about properties file to configure this kind of parameters.
What do you think about this idea?

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

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

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
JWebUnit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development

Reply via email to