Re[2]: [Webtest] no alert/confirm handler installed warning after attempt to pass through java-script dialogs

Andrew Sickorsky Andrew Sickorsky <andrew.sickorsky@texunatech.com>
Thu, 7 Jun 2007 13:09:34 +0400


------------10311B17B2671F9A4
Content-Type: text/plain; charset=windows-1251
Content-Transfer-Encoding: quoted-printable

Hello, Marc!

Thanks for your help - it seems that there is an JS-error in our/GWT code (=
after <groovy .../> execution):

2007-06-07 13:04:05,985 [INFO,JavaScriptEngine,HtmlUnit Managed Thread #21:=
 window.setTimeout] Catched script exception
EcmaError: lineNumber=3D[1164] column=3D[0] lineSource=3D[null] name=3D[Typ=
eError] sourceName=3D[Embedded script in http://localhost/services/gwt/com.=
texunatech.services.gwt.analysis.Table/47B4062D619886E30AE234AE5D3ECC30.cac=
he.html?0 from (10, 9) to (0, 0)] message=3D[TypeError: Cannot find functio=
n h. (Embedded script in http://localhost/services/gwt/com.texunatech.servi=
ces.gwt.analysis.Table/47B4062D619886E30AE234AE5D3ECC30.cache.html?0 from (=
10, 9) to (0, 0)#1164)]

This error occures in table-rendering process, so this is the problem, that=
 relates steps are failed.

> Hi Andrew,

> I still believe that the problem is that clickElement doesn't do what
> you wanted.

> What is it for an input field?

> To have an idea of the current state of the DOM after clickElement, you
> can do following
> <groovy>
> println step.context.currentResponse.asXml()
> </groovy>

> this will dump the current state of the the page to the console.

> Marc.

> Andrew Sickorsky wrote:
>> Hello Marc,


>> Thanks  for  answer.=20
>>  Test failes with <verifyText text=3D"Total records: 110"/> step.=20

>> The logic is:

>>  - click image button (Duplicate rows)

>>  - click Ok in the confirm-like javascript pop-up

>>  - check, that 10 records were duplicated (total count should be equal
>> to 110)


>>   Ideally (because i'm satisfy with 'Ok' answer for confirm message by
>> default) no <expectDialog> step is needed.=20
>> But - in fact nothing happens, no record are duplicated though
>> <clickelement ../> pass successfully.


>>   May be the reason is that we use GWT table (it constructs table with
>> records after page loading via JavaScript), i don't know - it's another
>> question


>>> Hi Andrew,


>>> as nobody answers I will try (even if don't feel myself very qualified

>>> concerning expectDialog step).


>>> Where does your test fail? When does your application complain with "Pl=
ease

>>> select rows"? Is it possible, that your <clickElement .../> doesn't do =
what

>>> you wanted?


>>> Marc.



>>> Andrew Sickorsky wrote:


>>>> Hello All!


>>>> I'm trying to use WebTest with pop-up alert/confirm messages via

>>>> ExpectDialog:


>>>> <expectDialog description=3D"Expected dialog for record duplicating"

>>>> dialogType=3D"confirm"/>

>>>> <clickElement

>>>> xpath=3D"//ul[@class=3D'dataProcessing']/li/input[@alt=3D'Duplicate re=
cord']"

>>>> description=3D"Duplicate first 10 records"/>

>>>> <verifyText text=3D"Total records: 110" />


>>>> But nothing happens: there is one warning  "window.alert("Please select

>>>> rows") no alert handler installed".=20

>>>> BTW no scence in presence of <expectDialog> step in the testsuite.


>>>> So, what should I do/install/remove/modify to force WebTest to click on

>>>> such dialogs?


>>>> WebTest 2.5 was used.


>>>> Thanks in advance, and sorry for disturbing


>>>> --=20

>>>> Best regards,

>>>>  Andrew.

>>>> Texuna Tech                        =20

>>>> mailto:andrew.sickorsky@texunatech.com






>> --=20

>> Best regards,

>>  Andrew                            mailto:andrew.sickorsky@texunatech.com

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





--=20
Best regards,
 Andrew                            mailto:andrew.sickorsky@texunatech.com
------------10311B17B2671F9A4
Content-Type: text/html; charset=windows-1251
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title></title>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dwindows-125=
1">
<meta http-equiv=3D"Content-Style-Type" content=3D"text/css">
<style type=3D"text/css"><!--
body {
  margin: 5px 5px 5px 5px;
  background-color: #ffffff;
}
/* ---------- Text Styles ---------- */
hr { color: #000000}
body, table /* Normal text */
{
 font-size: 9pt;
 font-family: 'Courier New';
 font-style: normal;
 font-weight: normal;
 color: #000000;
 text-decoration: none;
}
span.rvts1 /* Heading */
{
 font-size: 10pt;
 font-family: 'Arial';
 font-weight: bold;
 color: #0000ff;
}
span.rvts2 /* Subheading */
{
 font-size: 10pt;
 font-family: 'Arial';
 font-weight: bold;
 color: #000080;
}
span.rvts3 /* Keywords */
{
 font-size: 10pt;
 font-family: 'Arial';
 font-style: italic;
 color: #800000;
}
a.rvts4, span.rvts4 /* Jump 1 */
{
 font-size: 10pt;
 font-family: 'Arial';
 color: #008000;
 text-decoration: underline;
}
a.rvts5, span.rvts5 /* Jump 2 */
{
 font-size: 10pt;
 font-family: 'Arial';
 color: #008000;
 text-decoration: underline;
}
span.rvts6
{
 font-weight: bold;
 color: #800000;
}
span.rvts7
{
 font-weight: bold;
 color: #800080;
}
a.rvts8, span.rvts8
{
 color: #0000ff;
 text-decoration: underline;
}
span.rvts9
{
 font-weight: bold;
 color: #800080;
}
span.rvts10
{
 font-size: 8pt;
 font-family: 'arial';
 font-style: italic;
 color: #c0c0c0;
}
a.rvts11, span.rvts11
{
 font-size: 8pt;
 font-family: 'arial';
 color: #0000ff;
 text-decoration: underline;
}
/* ---------- Para Styles ---------- */
p,ul,ol /* Paragraph Style */
{
 text-align: left;
 text-indent: 0px;
 padding: 0px 0px 0px 0px;
 margin: 0px 0px 0px 0px;
}
.rvps1 /* Centered */
{
 text-align: center;
}
--></style>
</head>
<body>

<p>Hello, Marc!</p>
<p><br></p>
<p>Thanks for your help - it seems that there is an JS-error in our/GWT cod=
e (after &lt;groovy .../&gt; execution):</p>
<p><br></p>
<p>2007-06-07 13:04:05,985 [INFO,JavaScriptEngine,HtmlUnit Managed Thread #=
21: window.setTimeout] Catched script exception</p>
<p>EcmaError: lineNumber=3D[1164] column=3D[0] lineSource=3D[null] name=3D[=
TypeError] sourceName=3D[Embedded script in http://localhost/services/gwt/c=
om.texunatech.services.gwt.analysis.Table/47B4062D619886E30AE234AE5D3ECC30.=
cache.html?0 from (10, 9) to (0, 0)] message=3D[TypeError: Cannot find func=
tion h. (Embedded script in http://localhost/services/gwt/com.texunatech.se=
rvices.gwt.analysis.Table/47B4062D619886E30AE234AE5D3ECC30.cache.html?0 fro=
m (10, 9) to (0, 0)#1164)]</p>
<p><br></p>
<p>This error occures in table-rendering process, so this is the problem, t=
hat relates steps are failed.</p>
<p><br></p>
<p><span class=3Drvts6>&gt; Hi Andrew,</span></p>
<p><br></p>
<p><span class=3Drvts6>&gt; I still believe that the problem is that clickE=
lement doesn't do what</span></p>
<p><span class=3Drvts6>&gt; you wanted.</span></p>
<p><br></p>
<p><span class=3Drvts6>&gt; What is it for an input field?</span></p>
<p><br></p>
<p><span class=3Drvts6>&gt; To have an idea of the current state of the DOM=
 after clickElement, you</span></p>
<p><span class=3Drvts6>&gt; can do following</span></p>
<p><span class=3Drvts6>&gt; &lt;groovy&gt;</span></p>
<p><span class=3Drvts6>&gt; println step.context.currentResponse.asXml()</s=
pan></p>
<p><span class=3Drvts6>&gt; &lt;/groovy&gt;</span></p>
<p><br></p>
<p><span class=3Drvts6>&gt; this will dump the current state of the the pag=
e to the console.</span></p>
<p><br></p>
<p><span class=3Drvts6>&gt; Marc.</span></p>
<p><br></p>
<p><span class=3Drvts6>&gt; Andrew Sickorsky wrote:</span></p>
<p><span class=3Drvts7>&gt;&gt; Hello Marc,</span></p>
<p><br></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt; Thanks &nbsp;for &nbsp;answer.&nbsp;</span>=
</p>
<p><span class=3Drvts7>&gt;&gt; &nbsp;Test failes with &lt;verifyText text=
=3D"Total records: 110"/&gt; step.&nbsp;</span></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt; The logic is:</span></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt; &nbsp;- click image button (Duplicate rows)=
</span></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt; &nbsp;- click Ok in the confirm-like javasc=
ript pop-up</span></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt; &nbsp;- check, that 10 records were duplica=
ted (total count should be equal</span></p>
<p><span class=3Drvts7>&gt;&gt; to 110)</span></p>
<p><br></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt; &nbsp; Ideally (because i'm satisfy with 'O=
k' answer for confirm message by</span></p>
<p><span class=3Drvts7>&gt;&gt; default) no &lt;expectDialog&gt; step is ne=
eded.&nbsp;</span></p>
<p><span class=3Drvts7>&gt;&gt; But - in fact nothing happens, no record ar=
e duplicated though</span></p>
<p><span class=3Drvts7>&gt;&gt; &lt;clickelement ../&gt; pass successfully.=
</span></p>
<p><br></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt; &nbsp; May be the reason is that we use GWT=
 table (it constructs table with</span></p>
<p><span class=3Drvts7>&gt;&gt; records after page loading via JavaScript),=
 i don't know - it's another</span></p>
<p><span class=3Drvts7>&gt;&gt; question</span></p>
<p><br></p>
<p><br></p>
<p><span class=3Drvts6>&gt;&gt;&gt; Hi Andrew,</span></p>
<p><br></p>
<p><br></p>
<p><span class=3Drvts6>&gt;&gt;&gt; as nobody answers I will try (even if d=
on't feel myself very qualified</span></p>
<p><br></p>
<p><span class=3Drvts6>&gt;&gt;&gt; concerning expectDialog step).</span></=
p>
<p><br></p>
<p><br></p>
<p><span class=3Drvts6>&gt;&gt;&gt; Where does your test fail? When does yo=
ur application complain with "Please</span></p>
<p><br></p>
<p><span class=3Drvts6>&gt;&gt;&gt; select rows"? Is it possible, that your=
 &lt;clickElement .../&gt; doesn't do what</span></p>
<p><br></p>
<p><span class=3Drvts6>&gt;&gt;&gt; you wanted?</span></p>
<p><br></p>
<p><br></p>
<p><span class=3Drvts6>&gt;&gt;&gt; Marc.</span></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><span class=3Drvts6>&gt;&gt;&gt; Andrew Sickorsky wrote:</span></p>
<p><br></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt;&gt;&gt; Hello All!</span></p>
<p><br></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt;&gt;&gt; I'm trying to use WebTest with pop-=
up alert/confirm messages via</span></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt;&gt;&gt; ExpectDialog:</span></p>
<p><br></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt;&gt;&gt; &lt;expectDialog description=3D"Exp=
ected dialog for record duplicating"</span></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt;&gt;&gt; dialogType=3D"confirm"/&gt;</span><=
/p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt;&gt;&gt; &lt;clickElement</span></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt;&gt;&gt; xpath=3D"//ul[@class=3D'dataProcess=
ing']/li/input[@alt=3D'Duplicate record']"</span></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt;&gt;&gt; description=3D"Duplicate first 10 r=
ecords"/&gt;</span></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt;&gt;&gt; &lt;verifyText text=3D"Total record=
s: 110" /&gt;</span></p>
<p><br></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt;&gt;&gt; But nothing happens: there is one w=
arning &nbsp;"window.alert("Please select</span></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt;&gt;&gt; rows") no alert handler installed".=
&nbsp;</span></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt;&gt;&gt; BTW no scence in presence of &lt;ex=
pectDialog&gt; step in the testsuite.</span></p>
<p><br></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt;&gt;&gt; So, what should I do/install/remove=
/modify to force WebTest to click on</span></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt;&gt;&gt; such dialogs?</span></p>
<p><br></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt;&gt;&gt; WebTest 2.5 was used.</span></p>
<p><br></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt;&gt;&gt; Thanks in advance, and sorry for di=
sturbing</span></p>
<p><br></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt;&gt;&gt; --&nbsp;</span></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt;&gt;&gt; Best regards,</span></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt;&gt;&gt; &nbsp;Andrew.</span></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt;&gt;&gt; Texuna Tech &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span></=
p>
<p><br></p>
<p><a class=3Drvts8 href=3D"mailto:andrew.sickorsky@texunatech.com">&gt;&gt=
;&gt;&gt; mailto:andrew.sickorsky@texunatech.com</a></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt; --&nbsp;</span></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt; Best regards,</span></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt; &nbsp;Andrew &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><=
a class=3Drvts8 href=3D"mailto:andrew.sickorsky@texunatech.com">mailto:andr=
ew.sickorsky@texunatech.com</a></p>
<p><br></p>
<p><span class=3Drvts7>&gt;&gt; ___________________________________________=
____ WebTest mailing list</span></p>
<p><a class=3Drvts8 href=3D"mailto:WebTest@lists.canoo.com">&gt;&gt; WebTes=
t@lists.canoo.com</a><span class=3Drvts9>&nbsp;</span><a class=3Drvts8 href=
=3D"http://lists.canoo.com/mailman/listinfo/webtest">http://lists.canoo.com=
/mailman/listinfo/webtest</a></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><span class=3Drvts10>--&nbsp;</span></p>
<p><span class=3Drvts10>Best regards,</span></p>
<p><span class=3Drvts10>&nbsp;Andrew &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><a class=
=3Drvts11 href=3D"mailto:andrew.sickorsky@texunatech.com">mailto:andrew.sic=
korsky@texunatech.com</a></p>

</body></html>
------------10311B17B2671F9A4--