[Webtest] RE: WebTest digest, Vol 1 #1840 - 2 msgs

Francisco Javier Martin Gutierrez francisco-javier.martin@thalesgroup.com
Fri, 18 May 2007 09:36:41 +0200


Thanks for all. Proxy is working well now. I have problems about =
unsupported
javascript but I reach the page. Well done.

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
	=20
-----Mensaje original-----
De: webtest-admin@lists.canoo.com [mailto:webtest-admin@lists.canoo.com] =
En
nombre de webtest-request@lists.canoo.com
Enviado el: jueves, 17 de mayo de 2007 12:01
Para: webtest@lists.canoo.com
Asunto: WebTest digest, Vol 1 #1840 - 2 msgs

Send WebTest mailing list submissions to
	webtest@lists.canoo.com

To subscribe or unsubscribe via the World Wide Web, visit
	http://lists.canoo.com/mailman/listinfo/webtest
or, via email, send a message with subject or body 'help' to
	webtest-request@lists.canoo.com

You can reach the person managing the list at
	webtest-admin@lists.canoo.com

When replying, please edit your Subject line so it is more specific
than "Re: Contents of WebTest digest..."


Today's Topics:

   1. Problemas con java y setproxy (Francisco Javier Martin Gutierrez)
   2. Re: Problemas con java y setproxy (Paul King)

--__--__--

Message: 1
From: "Francisco Javier Martin Gutierrez"
<francisco-javier.martin@thalesgroup.com>
To: <webtest@lists.canoo.com>
Date: Wed, 16 May 2007 18:00:01 +0200
Organization: THALES
Subject: [Webtest] Problemas con java y setproxy
Reply-To: webtest@lists.canoo.com
Reply-To: <francisco-javier.martin@thalesgroup.com>

Hello:
You didn't answer the last question but there is one more.=3D20

I need to test an internet page. I've read how to configure a proxy but =
=3D
all
I do fail. I need to configure not only proxyhost or proxyport, but I =
=3D
need
also proxyuser and proxypassword.=3D20

I've tried just:
<setproxy proxyhost=3D3D"192.168.43.1" proxyport=3D3D"3128" =3D
user=3D3D"sistemas"
password=3D3D"contrase=3DF1a" description=3D3D"Configure proxy through =
normal =3D
ant
task"/>
But webtest says that proxyuser is not allowed for setproxy command. =3D
What is
the properly command to use? Is better use an ant step? Which is the =3D
best
solution?=3D20

Thanks.
............................................
Hello all,

Perhaps my question was wrong formulated. Webtest click the link or =3D
press
the button properly but the obtained response is not the expected =3D
response.
Webtest says that it can find the target and it does the action.

Two days before I pressed a button for reaching the next page and I =3D
reached
it. But now the application has changed and the next page obtained is an
error page. I am analyzing server response for further details but the
unique difference is that I haven't configured in header the parameters
REFERER and Request Method is GET instead of HTTP. So it can't be the
problem because REFERER parameter is not set in server (the application =
=3D
runs
in Oracle).

There are not expected dialogs so I think that I don't need to configure =
=3D
it
(I did it in other situations).

I only need to pass the next steps:

<clickButton	description=3D3D"Click the submit button: Efectuar cambios =
de
estado"
	name=3D3D"efectuarCambiosEstado"  label=3D3D"Efectuar cambios de =
estado"
x=3D3D"45" y=3D3D"13" />
		<verifyText		description=3D3D"Texto presente: En
caso
afirmativo, indique el motivo de cierre. "
			text=3D3D"En caso afirmativo, indique el motivo de
cierre." />

But when I click the button the page loaded is not the expected page =3D
because
server sends an error page and it doesn't happens when I do it with
iexplore. It is an strange success.=3D20

The webtest response is:=3D20

[clickButton]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
clickButton "Click the submit button: Efectuar cam bios de estado" =3D
(111/211)
[clickButton]  INFO =3D
(com.canoo.webtest.steps.request.AbstractTargetAction) -
-> gotoTarget by clickButton with name: efe ctuarCambiosEstado =3D
[clickButton]
INFO (com.canoo.webtest.steps.request.ClickButton) - -> findTarget(by
input): name=3D3DefectuarCambiosEstado value=3D3DEfectuar cambios de =
estado
[clickButton]  INFO (com.canoo.webtest.steps.request.ClickButton) - ->
findTarget(by input): name=3D3DefectuarCambiosEstado value=3D3DEfectuar =
=3D
cambios de
estado [clickButton]  WARN (com.gargoylesoftware.htmlunit.html.HtmlPage) =
=3D
-
Expected content type of text/javascript or applicat ion/x-javascript =
=3D
for
remotely loaded javascript element =3D
http://espinete:7783/sauss/js/sauss.js
but got [application/octe t-stream] [clickButton]  INFO
(com.canoo.webtest.engine.WebClientContext) - Content of window changed =
=3D
to
http://espinete:7783/saus s/HistoriaSocialValorPrestHS.do (text/html)
[clickButton]  INFO (com.canoo.webtest.engine.WebClientContext) - =3D
Content of
current window changed, it will become curr ent response [clickButton]  =
=3D
INFO
(com.canoo.webtest.engine.WebClientContext) - Current form set to none
[clickButton]  INFO (com.canoo.webtest.engine.WebClientContext) - =3D
Current
response now: http://espinete:7783/sauss/Histo riaSocialValorPrestHS.do
[clickButton]  INFO (com.canoo.webtest.engine.WebClientContext) - =3D
Content of
window changed to http://espinete:7783/saus =3D
s/HistoriaSocialValorPrestHS.do
(text/html) [clickButton]  INFO =3D
(com.canoo.webtest.engine.WebClientContext)
- Content of current window changed, it will become curr ent response
[clickButton]  INFO (com.canoo.webtest.engine.WebClientContext) - =3D
Current
form set to none [clickButton]  INFO
(com.canoo.webtest.engine.WebClientContext) - Current response now:
http://espinete:7783/sauss/Histo riaSocialValorPrestHS.do [verifyText]  =
=3D
INFO
(com.canoo.webtest.steps.Step) - >>>> Start Step: verifyText "Texto
presente: En caso afirmativo, ind ique el motivo de cierre. " (112/211) =
=3D
....
INFO (com.canoo.webtest.steps.Step) - Running with: Canoo Webtest: =3D
R_1515.
 INFO (com.canoo.webtest.steps.Step) - Exception thrown from this class:
com.canoo.webtest.engine.StepFailedException
 INFO (com.canoo.webtest.steps.Step) - Message was: Step[verifyText =3D
"Texto
presente: En caso afirmativo, indique el moti vo de cierre. " =3D
(112/211)]:
Text not found in page. Expected <En caso afirmativo, indique el motivo =
=3D
de
cierre.> Adding reference: ant.PropertyHelper  INFO
(com.canoo.webtest.ant.WebtestTask) - Finished executing webtest
"PruebaPc001" (C:\Webtest\SAUSS\PruebaPc001.xml:4
4: )
 INFO (com.canoo.webtest.ant.WebtestTask) - Test report successfully
created.

BUILD FAILED
C:\Webtest\SAUSS\PruebaPc001.xml:44: Canoo Webtest: R_1515.
Test failed.
Test step steps (C:\Webtest\SAUSS\PruebaPc001.xml:47: ) null failed with
message "Step[verifyText "Texto presente: En ca so afirmativo, indique =
=3D
el
motivo de cierre. " (112/211)]: Text not found in page. Expected <En =3D
caso
afirmativo, indique el motivo de cierre.>"
        at
com.canoo.webtest.ant.WebtestTask.stopBuildIfNeeded(WebtestTask.java:228)=
=3D

        at =3D
com.canoo.webtest.ant.WebtestTask.execute(WebtestTask.java:175)
        at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecuto=
=3D
r.j
ava:40)
        at =3D
org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

Total time: 32 seconds


Thanks for your time.=3D20
-------------------------------------------------------------------------=
=3D
-
Hi,

how does your clickLink fail? Does it produce some error or does is it =
=3D
just
successful but without getting a new page?

Your js code looks simple and shouldn't be a problem for WebTest =3D
(neither
2.1 nor 2.5). For 2.1 I could imagine that the default answer to confirm =
=3D
was
false (I don't remember exactly when the change has been
done) what could explain that nothing happens. Nevertheless the default
behavior for confirm is now true so this shouldn't be a problem with =3D
2.5. To
precisely specify what should happen you can give a try to =3D
<expectDialogs
...>.

Last (but not least), to "see" what happens, I recommend you to turn the =
=3D
log
level to debug (see lib/log4j.properties) and look at what is printed to =
=3D
the
log when the link is clicked.

Marc.
-- __--__--=20

Message: 3
From: "Francisco Javier Martin Gutierrez"
<francisco-javier.martin@thalesgroup.com>
To: <webtest@lists.canoo.com>
Date: Thu, 10 May 2007 17:34:48 +0200
Organization: THALES
Subject: [Webtest] WebTest clicklink fail
Reply-To: webtest@lists.canoo.com
Reply-To: <francisco-javier.martin@thalesgroup.com>

Hello:

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

Webtest (version 2.1 =3D3D3D R_1515 and version =3D3D3D 2.5 R_1538) =
can't =3D
fail =3D3D
following a clickButton image or a clikLink. The page works well on =3D
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:=3D3D20
href=3D3D3D"javascript:eliminar('10101A', 'prueba marcos');"

And the javascript function is:
function eliminar(codValoracion, nomValoracion) {
  document.forms[0].codValoracion.value=3D3D3DcodValoracion;
  document.forms[0].nomValoracion.value=3D3D3DnomValoracion;
  document.forms[0].modo.value=3D3D3D"listado";
  document.forms[0].accion.value=3D3D3D"eliminar";
  if(confirm("=3D3DBFEst=3D3DE1 seguro de que desea eliminar la =3D
Valoraci=3D3DF3n  '" =3D3D
+
codValoracion + " : " + nomValoracion + "' de la lista de favoritas?")){
  	document.forms[0].submit();
  }
     =3D3D20
}

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 =
=3D
=3D3D the
manual. If you execute a scriptStep at the next form:

<scriptStep description=3D3D3D"boton eliminar" =
language=3D3D3D"javascript">
				=3D3D09
	codValoracion=3D3D3D'10101A';
	nomValoracion=3D3D3D'prueba marcos';
=3D3D09
document.forms[0].codValoracion.value=3D3D3DcodValoracion;
=3D3D09
document.forms[0].nomValoracion.value=3D3D3DnomValoracion;
	document.forms[0].modo.value=3D3D3D"listado";
	document.forms[0].accion.value=3D3D3D"eliminar";
	if(confirm("=3D3DBFEst=3D3DE1 seguro de que desea eliminar la =3D
Valoraci=3D3DF3n
'" =3D3D
+
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" =
=3D3D =3D
from
undefined ...
[scriptStep]  INFO (com.canoo.webtest.steps.Step) - Exception thrown =
=3D3D =3D
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: =3D3D =3D
R_1515.


What can I do?


End of WebTest Digest


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

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


--__--__--

Message: 2
Date: Thu, 17 May 2007 06:23:30 +1000
From: Paul King <paulk@asert.com.au>
To: webtest@lists.canoo.com
Subject: Re: [Webtest] Problemas con java y setproxy
Reply-To: webtest@lists.canoo.com
Reply-To: Paul King <paulk@asert.com.au>

Francisco Javier Martin Gutierrez wrote:
> Hello:
> You didn't answer the last question but there is one more.=20
>=20
> I need to test an internet page. I've read how to configure a proxy =
but
all
> I do fail. I need to configure not only proxyhost or proxyport, but I =
need
> also proxyuser and proxypassword.=20
>=20
> I've tried just:
> <setproxy proxyhost=3D"192.168.43.1" proxyport=3D"3128" =
user=3D"sistemas"
> password=3D"contrase=F1a" description=3D"Configure proxy through =
normal ant
> task"/>
> But webtest says that proxyuser is not allowed for setproxy command. =
What
is
> the properly command to use? Is better use an ant step? Which is the =
best
> solution?=20

I use:

    <setproxy proxyhost=3D"${proxyservername}" =
proxyport=3D"${proxyport}"
        proxyuser=3D"${proxyuser}" proxypassword=3D"${proxypassword}"
        nonproxyhosts=3D"${nonproxyhosts}"/>

where the ant variables are set earlier. We actually use JeraAntTasks
to prompt the user for the proxyuser and proxypassword.

Cheers, Paul.



--__--__--

_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest


End of WebTest Digest


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.