From: Mike B. <mb...@Ga...> - 2003-10-14 12:56:31
|
BARAHONA,JESUS (HP-Spain,ex2) wrote: > I've begun with htmlUnit two weeks ago and i'm having problems when i > try to load a page with JavaScript. > I've been debugging and i think the problem is when trying to access > to the parent of a frame with Javascript "parent.nav.document". > I get the same error if i try to load that frame separately from the > other, that is understandable because in that case there is no parent > frame. For this, it seems as htmlUnit just load the frames separately. > Am i right? Will htmlUnit support frames early? HtmlUnit should be loading the frames in the same order that the browser would. What error are you seeing? > I still have another question about Javascript in htmlUnit. In my > webPage i use some "if" Javascript sentences for know in which browser > i'm working on, for example "navigator.appName == 'Netscape'". > Is there any way with htmlUnit to simulate that this JavaScript is > being interpreted by Netscape Navigator or by Internet Explorer? > Has the file JavaScriptConfiguration.xml any relation with that? > What is the use of that file? Yes, JavaScriptConfiguration.xml is where the browser specific (javascript) behaviour is defined. Very little of the browser specific pieces are currently implemented at present but that configuration file is where everything is set up. To simulate a specific browser, you pass an instance of BrowserVersion into the constructor of the WebClient. This will set things like the browser type and will be used by JavaScriptConfiguration to determine which behaviour to provide. Hope this helps. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |