[Webtest] Cannot read property "type" from undefined

Frank Langanke webtest@lists.canoo.com
Wed, 05 Apr 2006 13:56:55 +0200


Hi,

I'm somewhat lost with this exception:

...
Exception raised: com.canoo.webtest.engine.StepExecutionException: 
Unexpected exception caught: 
C:\workspace\myapp\WebTest\macro-definitions.xml:329: The following 
error occurred while executing this line:
C:\workspace\myapp\WebTest\macro-definitions.xml:183: 
com.canoo.webtest.engine.StepFailedException: Step[clickLink "Link 
Partner klicken." (3/3)]: Script error loading page executing webtest 
at: clickLink TypeError: Cannot read property "type" from undefined 
(Embedded script in 
http://localhost:8080/myapp/main/partnerEdit.do?mandantID=4444#4)
Source code:

   var focusControl = 
document.forms["partnerMandantActionForm"].elements["nachname"];

   if (focusControl.type != "hidden" && !focusControl.disabled) {
      focusControl.focus();
...

I was able to bring it down to the struts logic:notEmpty tag. If I 
comment this tag out via <%-- --> the page and the test are loaded fine. 
Also setting <enablejavascript> to false will load the page, however js 
is needed.

partnerEdit.jsp:
...
	<forms:form
			type="edit"
			formid="frmMainEdit"
			caption="partner.caption@FORM_RESOURCE_KEY">

		<logic:notEmpty name="partnerMandantActionForm" property="partnerID" 
scope="request">
...

Any hints ?

Greetings,

Frank.