Hi:
I need to follow a javascript link but it does not work. I try using
clicklink and storeregex but both fail. There are more than one links like
this:
<!--<td align="center" bgcolor="#FBFBFB"> <a
href="javascript:eliminar('10101A', 'prueba marcos');"><img
src="imagenes/ico_eliminar.gif" alt="eliminar" width="8" height="9"
border="0"></a></td>-->
If I try:
<clickLink description="Click link: click boton: Eliminar"
href="javascript:eliminar('10101A', 'prueba marcos');"
Output is:
[ifStep] INFO (com.canoo.webtest.steps.Step) - >>>> Start Step: ifStep
(54/56)
[condition] INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
condition (54/56)
[verifyText] INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
verifyText "Texto presente: 10101A" (54/56)
[expectDialog] INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
expectDialog "Esta seguro que desea eliminar la valoracion..." (54/56)
[clickLink] INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
clickLink "Click link: click boton: Eliminar" (54/56)
[clickLink] INFO (com.canoo.webtest.steps.request.AbstractTargetAction) -
-> gotoTarget by clickLink
[not] INFO (com.canoo.webtest.steps.Step) - >>>> Start Step: not (55/56)
[verifyText] INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
verifyText "Texto presente: 10101A" (55/56)
INFO (com.canoo.webtest.steps.Step) - Running with: Canoo Webtest: R_1561.
INFO (com.canoo.webtest.steps.Step) - Exception thrown from this class:
com.canoo.webtest.engine.StepFailedException
INFO (com.canoo.webtest.steps.Step) - Message was: Wrapped step did not
fail: null
INFO (com.canoo.webtest.steps.Step) - Running with: Canoo Webtest: R_1561.
INFO (com.canoo.webtest.steps.Step) - Exception thrown from this class:
com.canoo.webtest.engine.StepFailedException
INFO (com.canoo.webtest.steps.Step) - Message was: Wrapped step did not
fail: null
Adding reference: ant.PropertyHelper
INFO (com.canoo.webtest.ant.WebtestTask) - Finished executing webtest
"PruebaPc004" (C:\webtest 2.5\SAUSS\PruebaPc004b.
xml:50: )
INFO (com.canoo.webtest.ant.WebtestTask) - Test report successfully
created.
BUILD FAILED
C:\webtest 2.5\SAUSS\PruebaPc004b.xml:50: Canoo Webtest: R_1561.
Test failed.
Test step steps (C:\webtest 2.5\SAUSS\PruebaPc004b.xml:53: ) null failed
with message "Wrapped step did not fail: null"
at
com.canoo.webtest.ant.WebtestTask.stopBuildIfNeeded(WebtestTask.java:228)
at 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(DefaultExecutor.j
ava:40)
at 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)
So I though that I could store the link contained in javascript function but
it also failed. I tried:
<storeRegEx
description="Extract target location from javascript command"
text=".*name="href".*href="javascript:eliminar(10101A,
prueba marcos)""
property="targetLocation" />
<invoke
description="Invoke target page specified in the javascript statement"
url="#{targetLocation}"
save="targetPage" />
But It also fails:
[expectDialog] INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
expectDialog "Esta seguro que desea eliminar la valoracion..." (55/57)
[storeRegEx] INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
storeRegEx "Extract target location from javascript command" (55/57)
[storeRegEx] INFO (com.canoo.webtest.steps.Step) - Running with: Canoo
Webtest: R_1561.
[storeRegEx] INFO (com.canoo.webtest.steps.Step) - Exception thrown from
this class: com.canoo.webtest.engine.StepFailedException
[storeRegEx] INFO (com.canoo.webtest.steps.Step) - Message was: No match
for regular expression <.*name="href".*href="javascript:eliminar('10101A',
'prueba marcos')">
INFO (com.canoo.webtest.steps.Step) - Running with: Canoo Webtest: R_1561.
INFO (com.canoo.webtest.steps.Step) - Exception thrown from this class:
com.canoo.webtest.engine.StepFailedException
INFO (com.canoo.webtest.steps.Step) - Message was: No match for regular
expression <.*name="href".*href="javascript:eliminar('10101A', 'prueba
marcos')">
INFO (com.canoo.webtest.steps.Step) - Running with: Canoo Webtest: R_1561.
INFO (com.canoo.webtest.steps.Step) - Exception thrown from this class:
com.canoo.webtest.engine.StepFailedException
INFO (com.canoo.webtest.steps.Step) - Message was: No match for regular
expression <.*name="href".*href="javascript:eliminar('10101A', 'prueba
marcos')">
Adding reference: ant.PropertyHelper
INFO (com.canoo.webtest.ant.WebtestTask) - Finished executing webtest
"PruebaPc004" (C:\webtest 2.5\SAUSS\PruebaPc004b.xml:50: )
INFO (com.canoo.webtest.ant.WebtestTask) - Test report successfully
created.
BUILD FAILED
C:\webtest 2.5\SAUSS\PruebaPc004b.xml:50: Canoo Webtest: R_1561.
Test failed.
Test step steps (C:\webtest 2.5\SAUSS\PruebaPc004b.xml:53: ) null failed
with message "No match for regular expression <
.*name="href".*href="javascript:eliminar('10101A', 'prueba marcos')">"
at
com.canoo.webtest.ant.WebtestTask.stopBuildIfNeeded(WebtestTask.java:228)
at 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(DefaultExecutor.j
ava:40)
at 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)
Javascript is enabled to can store href parameter. It is right or not?
Should I change storeRegEx regular expression?
¿?
Cheers, FJMartin.
AVISO LEGAL: La informacion contenida en este mensaje y cualquier documento
adjunto en el mismo es confidencial, puede estar legalmente protegida y esta
dirigida solamente al destinatario. La publicacion, uso, distribucion,
impresion o copia no autorizada del contenido de este mensaje, esta
estrictamente prohibida y puede ser ilegal. Si Vd. ha recibido este mensaje 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 document
is confidential, covered by law and intended solely for the recipient. 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.
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest