[Webtest] WebTest clicklink fail

Francisco Javier Martin Gutierrez francisco-javier.martin@thalesgroup.com
Thu, 10 May 2007 17:34:48 +0200


Hello:

Since I have been testing with webtest it had never failed like now. I =
begin
to believe that webtest do all it can do. But something is going wrong =
since
two days ago.

Webtest (version 2.1 =3D R_1515 and version =3D 2.5 R_1538) can't fail =
following
a clickButton image or a clikLink. The page works well on iexplore but
webtest can't do it. I think it may be that there's some unsupported
javascript on the page. But how can I be sure of this?

The page code is:=20
href=3D"javascript:eliminar('10101A', 'prueba marcos');"

And the javascript function is:
function eliminar(codValoracion, nomValoracion) {
  document.forms[0].codValoracion.value=3DcodValoracion;
  document.forms[0].nomValoracion.value=3DnomValoracion;
  document.forms[0].modo.value=3D"listado";
  document.forms[0].accion.value=3D"eliminar";
  if(confirm("=BFEst=E1 seguro de que desea eliminar la Valoraci=F3n  '" =
+
codValoracion + " : " + nomValoracion + "' de la lista de favoritas?")){
  	document.forms[0].submit();
  }
     =20
}

I can't execute a scriptStep because it doesn't provide the mechanism to
call JavaScript functions in my HTML pages under test as it is told in =
the
manual. If you execute a scriptStep at the next form:

<scriptStep description=3D"boton eliminar" language=3D"javascript">
				=09
	codValoracion=3D'10101A';
	nomValoracion=3D'prueba marcos';
=09
document.forms[0].codValoracion.value=3DcodValoracion;
=09
document.forms[0].nomValoracion.value=3DnomValoracion;
	document.forms[0].modo.value=3D"listado";
	document.forms[0].accion.value=3D"eliminar";
	if(confirm("=BFEst=E1 seguro de que desea eliminar la Valoraci=F3n  '" =
+
codValoracion + " : " + nomValoracion + "' de la lista de
favoritas?")){
  		document.forms[0].submit();
	 }
</scriptStep>

The error message obtained is:

[scriptStep]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
scriptStep "boton eliminar" (31/32)
[scriptStep] ERROR (org.apache.bsf.BSFManager) - Exception :
[scriptStep] java.security.PrivilegedActionException:
org.apache.bsf.BSFException: JavaScript Error: Internal Error: org
.mozilla.javascript.EcmaError: TypeError: Cannot read property "0.0" =
from
undefined
...
[scriptStep]  INFO (com.canoo.webtest.steps.Step) - Exception thrown =
from
this class: com.canoo.webtest.engine.StepExecu
tionException
[scriptStep]  INFO (com.canoo.webtest.steps.Step) - Message was: Error
invoking script: org.mozilla.javascript.EcmaError
: TypeError: Cannot read property "0.0" from undefined
 INFO (com.canoo.webtest.steps.Step) - Running with: Canoo Webtest: =
R_1515.


What can I do?

Francisco Javier Mart=EDn=20
Desarrollo de Proyectos - Valladolid
Security Solutions & Services Division =09
	=20
Edif. Solar, Of. 13, 14, 15
Parque Tecnol=F3gico Boecillo. 47151 Valladolid. Espa=F1a
Tel.: 983 54 65 55   Fax: 983 54 66 09	=20


AVISO LEGAL: La informacion contenida en este mensaje y cualquier documen=
to adjunto en el mismo es confidencial, puede estar legalmente protegida =
y esta dirigida solamente al destinatario. La publicacion, uso, distribuc=
ion, impresion o copia no autorizada del contenido de este mensaje, esta =
estrictamente prohibida y puede ser ilegal. Si Vd. ha recibido este mensa=
je por error, le rogamos destruya el mensaje y lo notifique al remitente =
o llame al telefono (+34) 91 556 92 62.

DISCLAIMER: The information contained in this message and any attached do=
cument is confidential, covered by law and intended solely for the recipi=
ent. The distribution, print, publication, unauthorised copy and / or use=
 of the message content is strictly forbidden and could be deemed illegal=
. If you are not the intended recipient of this message, we request that =
you destroy it and notify the sender either in writing or by calling ++34=
 91 556 92 62.