From: Ryan L. <Rya...@Su...> - 2003-09-05 18:07:50
|
Hello, I'm using HtmlUnit v, 1.2.3. I have a page that renders an image map with multiple 'live' areas. Here is an example of the AREA element: <area alt="NAmerica" coords=<SOME COORDS>" shape="poly" onmouseout="document.forms[0].mapImage.src='/images/world.gif'" onmouseover="document.forms[0].mapImage.src='/images/world_namer.gif'" onclick="document.forms[0].worldMap_current.value='NAmerica'; document.forms[0].submit()"> I'm trying to validate the worldMap_current hidden field is appropriately updated when the onClick handler is invoked, however when I call executeJavascriptIfPossible on the HtmlArea element, I receive the following: ---------------------------------------------------------- EcmaError: lineNumber=[1] column=[0] lineSource=[document.forms[0].elements['worldMap_current'].value='NAmerica'; document.forms[0].submit()] name=[ConversionError] sourceName=[)] message=[The undefined value has no properties.] errorObject=[ConversionError: The undefined value has no properties.] --------------------------------------------------------- Anyone have any thoughts on this before I start digging deeper? |
From: Mike B. <mb...@Ga...> - 2003-09-05 18:37:19
|
Ryan Lubke wrote: > ---------------------------------------------------------- > EcmaError: lineNumber=[1] column=[0] > lineSource=[document.forms[0].elements['worldMap_current'].value='NAmerica'; document.forms[0].submit()] name=[ConversionError] sourceName=[)] message=[The undefined value has no properties.] errorObject=[ConversionError: The undefined value has no properties.] > --------------------------------------------------------- > > Anyone have any thoughts on this before I start digging deeper? I don't see anything obviously wrong with what you've posted. Can you verify that elements['worldMap_current'] is returning a hidden field? -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: Ryan L. <Rya...@Su...> - 2003-09-05 19:46:53
|
On Fri, 2003-09-05 at 14:40, Mike Bowler wrote: > Ryan Lubke wrote: > > ---------------------------------------------------------- > > EcmaError: lineNumber=[1] column=[0] > > lineSource=[document.forms[0].elements['worldMap_current'].value='NAmerica'; document.forms[0].submit()] name=[ConversionError] sourceName=[)] message=[The undefined value has no properties.] errorObject=[ConversionError: The undefined value has no properties.] > > --------------------------------------------------------- > > > > Anyone have any thoughts on this before I start digging deeper? > > I don't see anything obviously wrong with what you've posted. Can you > verify that elements['worldMap_current'] is returning a hidden field? If you mean executing document.forms[0].elements['worldMap_current'] then yes...this by itself fails. The element is available when calling HtmlPage.getAllHtmlElements(); -- Ryan Lubke <Rya...@Su...> Sun Microsystems, Inc. |
From: Ryan L. <Rya...@Su...> - 2003-09-05 20:47:27
|
On Fri, 2003-09-05 at 14:40, Mike Bowler wrote: > Ryan Lubke wrote: > > ---------------------------------------------------------- > > EcmaError: lineNumber=[1] column=[0] > > lineSource=[document.forms[0].elements['worldMap_current'].value='NAmerica'; document.forms[0].submit()] name=[ConversionError] sourceName=[)] message=[The undefined value has no properties.] errorObject=[ConversionError: The undefined value has no properties.] > > --------------------------------------------------------- > > > > Anyone have any thoughts on this before I start digging deeper? > > I don't see anything obviously wrong with what you've posted. Can you > verify that elements['worldMap_current'] is returning a hidden field? Ok...I've got it narrowed down. It seems that if I issue page.executeJavaScriptIfPossible() with 'document.forms.length' the result is 0. So I changed the page to add a name attribute to the form and changed the javascript to: document.form1.worldMap_current.value='test' And it worked. Anyone there any known issues with document.forms[index]? -- Ryan Lubke <Rya...@Su...> Sun Microsystems, Inc. |
From: Mike B. <mb...@Ga...> - 2003-09-06 23:55:12
|
Ryan Lubke wrote: > Anyone there any known issues with document.forms[index]? Not that I recall. Please open a bug report for this - bugs just reported via email are too easily lost. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |