Bugs item #1745433, was opened at 2007-06-29 10:36
Message generated for change (Settings changed) made by skywalkin
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=1745433&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 2.1
>Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Peter Blanchard (skywalkin)
Assigned to: Jevon Wright (jevonwright)
Summary: Can't configure Javascript navigator object
Initial Comment:
Hello,
This problem is related to "[JWebUnit-development] [ jwebunit-Bugs-1724695 ]
Javascript and its navigator is null", but not quite the same.
Doing some testing of an existing web application that uses Javascript to
detect what browser is using it. Currently, it uses navigator.appName (for
detecting Netscape) and navigator.appVersion to detect the browser version (for
IE version info).
The problem is that, while I set my User-Agent properly, the javascript on the
client-side that gets run does not have access to it (or, when I set it using
setUserAgent on the TestContext, it does not force an update on the default
"navigator" object in the javascript engine).
I need a way to configure it.
Thanks in advance.
-- DEBUG START --
[DEBUG] Navigator - -Property "appName" of [EMAIL PROTECTED] not defined as
pure js property
[DEBUG] Navigator - -Property "appVersion" of [EMAIL PROTECTED] not defined as
pure js property
-- DEBUG END --
----------------------------------------------------------------------
>Comment By: Peter Blanchard (skywalkin)
Date: 2008-11-17 21:20
Message:
I'll download the new version and give it a try, I have not been using this
since I first ran into this problem since there was no workaround (and no
response until now).
----------------------------------------------------------------------
Comment By: Jevon Wright (jevonwright)
Date: 2008-11-17 17:59
Message:
Hi, in r760 a fix was applied to allow test cases to properly configure the
user agent, including access to the user agent with Javascript. (See issue
1724695.) Can you confirm that this bug still exists?
With an HtmlUnitTestingEngineImpl you may configure the user agent like
so:
((HtmlUnitTestingEngineImpl)
getTester().getTestingEngine()).setDefaultBrowserVersion(
BrowserVersion.INTERNET_EXPLORER_7_0 );
beginAt("/url");
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=1745433&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