[Webtest] [webtest][JIRA] Created: (WT-230) <confirm> buggy
Jon Nermut (JIRA)
webtest@lists.canoo.com
Fri, 1 Sep 2006 06:15:28 +0200 (CEST)
<confirm> buggy
---------------
Key: WT-230
URL: http://webtest-community.canoo.com/jira/browse/WT-230
Project: WebTest
Type: Bug
Versions: 2.0 =20
Environment: r1389
Reporter: Jon Nermut
I am having a lot of trouble getting the <confirm> subtask to behave correc=
tly.
The situation is an <a> tag with an onclick handler, which has a confirm bu=
tton on it.
The web test script is:
<expectDialogs description=3D"Expect confirmation for return=
">
<confirm response=3D"true" />
</expectDialogs>
=09=09<clickLink label=3D"Return to Itinerary" />
=20
<verifyTitle
=09=09 description=3D"Ensure we are at the itinerary page"
=09=09 text=3D"Pems : Itinerary"
=09=09 />
This fails with, saying it cannot find the confirm:
[expectDialogs] INFO (com.canoo.webtest.steps.Step) - >>>> Start Step: exp=
ectDialogs "Expect confirmation for return" (41/43)
[confirm] INFO (com.canoo.webtest.steps.Step) - >>>> Start Step: confirm=
(41/43)
[clickLink] INFO (com.canoo.webtest.steps.Step) - >>>> Start Step: clickLi=
nk (42/43)
[clickLink] INFO (com.canoo.webtest.steps.request.AbstractTargetAction) - =
-> gotoTarget by clickLink
[clickLink] INFO (com.canoo.webtest.steps.Step) - Running with: Canoo Webt=
est: R_1389.
[clickLink] INFO (com.canoo.webtest.steps.Step) - Exception thrown from th=
is class: com.canoo.webtest.engine.StepFailedException
[clickLink] INFO (com.canoo.webtest.steps.Step) - Message was: Step[clickL=
ink (42/43)]: Script error loading page executing webtest at: clickLink Wra=
pped com.gargoylesoftware.htmlunit.ScriptException: Wrapped com.canoo.webte=
st.engine.StepFailedException: Expected dialogs but none found!, Step: Expe=
ctDialogs at C:\svn\pems\trunk\code\webtest\functional\tripManagement\endTo=
End.xml:155: with (description=3D"Expect confirmation for return", taskNam=
e=3D"expectDialogs")com.canoo.webtest.extension.dialogs.ExpectDialogs(wrapp=
edSteps=3D[<ConfirmDialogStep at C:\svn\pems\trunk\code\webtest\functional\=
tripManagement\endToEnd.xml:156: with (response=3D"true", taskName=3D"conf=
irm")> ]) (http://localhost:8080/pems/classpath/com/dytech/common/xjsf/comp=
onents/js/jsonrpc-1.0.js#329) (event for HtmlAnchor[<a id=3D"mainForm:nc62:=
commandBarReturn" href=3D"#" onclick=3D"if(confirm('Are you sure you wish t=
o return? (TODO: should be Save, Proceed or Cancel)')){document.forms['main=
Form']['mainForm:j_idcl'].value=3D'mainForm:nc62:commandBarReturn';if (docu=
ment.forms['mainForm']['action']) document.forms['mainForm']['action'].valu=
e=3D'';document.forms['mainForm'].target=3D'_self';if (this.selectAllForSub=
mit) selectAllForSubmit(document.forms['mainForm']);document.forms['mainFor=
m'].submit(); return false;} else return false;" class=3D"formLabel">]#1)
[clickLink] Source code:
[clickLink] function () {
[clickLink] =09[native code, arity=3D0]
[clickLink] }
This is screwy however as it doesn't give a warning about an unhandled conf=
irm, and it does actually seem to do the navigation (if i turn on wire debu=
gging I can see the new page come down).
However, if I leave out the <expectDialogs> step, it complains about having=
no handler for the confirm. It also does not perform the navigation, as it=
is evidently clicking Cancel on the confirm (I thought the default was sup=
posed to be OK??)
--=20
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://webtest-community.canoo.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira