[Webtest] RE: Displaying pages modified by Javascript in Webtest results

Robert Bodziony Robert Bodziony" <robert.bodziony@gmail.com
Fri, 4 Jan 2008 19:56:14 +0100


------=_Part_30772_5129897.1199472974178
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

hi

  you can try dump current response via

<groovy>
println step.context.currentResponse.asXml()
</groovy>

 and you can enable debug mode (in log4j.properties in lib directory (add
another appender to file))
  Regards,
 Robert

2008/1/4, Fly High <flyhigh172@hotmail.com>:
>
>  Thanks for the reply Marc,
>
>    I have tried the <sleep> option as well as a wait loop.  The page
> changes its title once the login has completed, but WebTest <verifyTitle>
> never sees the title change.   I'm running version R_1646 which I downloa=
ded
> yesterday.
>
>    A little more info on the app, in the "login window" when the "login"
> button is clicked, a new window (appWindow) is created for the
> application.  The "login window" then establishes a "session" on a back e=
nd
> server and executes a appWindow.location.replace(sessionURL) to connect
> the application window to the back end session.  This effectively refresh=
es
> the appWindow with a new URL.  When this occurs, WebTest no longer see an=
y
> changes in the appWindow.
>
> Here are the step I'm using (I've hidden the username and password) for
> this post:
>
>          <steps>
>             <invoke
>               description=3D"get Login Page"
>               url=3D"" />
>             <verifyTitle
>               description=3D"we should see the LogiQuest login page title=
"
>               text=3D"LogiQuest(R) - Logistics Research Service" />
>             <setInputField description=3D"Set the Username" htmlid=3D"nUs=
er"
> value=3D"***" />
>             <setInputField description=3D"Set the Password" htmlid=3D"nPa=
ss"
> value=3D"***" />
>             <clickButton description=3D"Click the Login Button - this wil=
l
> open a new window" htmlid=3D"nLoginBtn" />
>             <verifyTitle description=3D"we should see the login title in =
the
> new window" text=3D"LogiQuest(R) Login" />
>             <verifyElementText description=3D"Check Progress box text in =
the
> new window" htmlid=3D"nProgress" text=3D"Processing login request. Please=
 Wait."
> />
>
>             <sleep description=3D"sleep for a second" seconds=3D"30"/>
>             <verifyTitle description=3D"Main application title again"
> text=3D"LogiQuest(R) - Logistics Research Service" />
>          </steps>
>
> Here's the end of the output:
>
>
> [setInputField]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
> setInputField "Set the Username" (3/10)
> [setInputField]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
> setInputField "Set the Password" (4/10)
> [clickButton]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
> clickButton "Click the Login Button - this will open a new window" (5/10)
> [clickButton]  INFO (com.canoo.webtest.steps.request.ClickButton) - ->
> findTarget(by input): name=3D value=3DL
> [clickButton]  INFO (com.canoo.webtest.engine.WebClientContext) - Content
> of window changed to (url<http://tcidb1.terabase.com:9084/s2w001/frm_conn=
ect.html>of new app window - removed for this post) (text/html)
> [clickButton]  INFO (com.canoo.webtest.engine.WebClientContext) - Content
> loaded in newly opened window, its content will become current response
> [clickButton]  INFO (com.canoo.webtest.engine.WebClientContext) - Current
> form set to none
> [clickButton]  INFO (com.canoo.webtest.engine.WebClientContext) - Current
> response now: (url<http://tcidb1.terabase.com:9084/s2w001/frm_connect.htm=
l>of new app window - removed for this post) (text/html)
> [clickButton]  INFO (com.canoo.webtest.engine.WebClientContext) - Content
> of window changed to (url<http://tcidb1.terabase.com:9084/$S2W/s2w?LOGIN=
=3D&1199465171912>of backend session - removed for this post) (text/html)
> [clickButton]  INFO (com.canoo.webtest.engine.WebClientContext) - Content
> of window changed with javascript, it will NOT become current response
> [verifyTitle]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
> verifyTitle "we should see the login title in the new window" (6/10)
> [verifyElementText]  INFO (com.canoo.webtest.steps.Step) - >>>> Start
> Step: verifyElementText "Check Progress box text in the new window" (7/10=
)
> [verifyElementText]  INFO (com.canoo.webtest.steps.Step) - >>>> Start
> Step: verifyElementText "Check Progress box text in the new window - this
> should fail" (9/10)
> [verifyTitle]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
> verifyTitle "Main application title again" (10/10)
>  INFO (com.canoo.webtest.engine.WebClientContext) - Responses restored
>  INFO (com.canoo.webtest.ant.WebtestTask) - Finished executing webtest
> "myTest" (C:\Program Files\Webtest\logintest.xml:7: )
>  INFO (com.canoo.webtest.ant.WebtestTask) - No report to write according
> to config
>
> BUILD FAILED
> C:\Program Files\Webtest\logintest.xml:29: Wrong document title found!.
> Expected value "LogiQuest=AB - Logistics Research Service" but got "LogiQ=
uest=AB
> Login", Step: VerifyTitle at C:\Program Files\Webtest\logintest.xml:29:
> with (taskName=3D"verifyTitle")
> Total time: 42 seconds
>
>
>
> > From: mguillemot@yahoo.fr
> > To: webtest@lists.canoo.com
> > Subject: Re: [Webtest] RE: Displaying pages modified by Javascript in
> Webtest results
> > Date: Fri, 4 Jan 2008 10:25:05 +0100
> >
> > Hi,
> >
> > the mail you mention only discuss the pages presented in the reports,
> > this means that it doesn't help your login problem.
> >
> > Concerning your problem:
> > - which WebTest build do you use?
> > - what happens if you add something like <sleep seconds=3D"5"/> (it's
> > quite extreme, but it's just to know)?
> >
> > Cheers,
> > Marc.
> > --
> > Blog: http://mguillem.wordpress.com
> >
> >
> > Fly High wrote:
> > > Hello,
> > >
> > > This is my first day with Webtest. My app. is AJAX based with the
> > > client side updated via Javascript. I can't seem to get past the logi=
n
> > > page. After WebTest "clicks" the login button I get: "Content of
> window
> > > changed with javascript, it will NOT become curent response". I can
> not
> > > get any further with the testing after this point.
> > >
> > > I did some searching of the mail list and found this:
> > > http://lists.canoo.com/pipermail/webtest/2006q4/007344.html (subject:
> > > Displaying pages modified by Javascript in Webtest results) posted
> last
> > > year. Sounds like what I'm running into. Has any progress been made o=
n
> > > this front?
> > >
> > > Thanks,
> > >
> > > John
> > >
> > >
> ------------------------------------------------------------------------
> > > Get the power of Windows + Web with the new Windows Live. Get it now!
> > > <http://www.windowslive.com?ocid=3DTXT_TAGHM_Wave2_powerofwindows_122=
007
> >
> >
> > _______________________________________________
> > WebTest mailing list
> > WebTest@lists.canoo.com
> > http://lists.canoo.com/mailman/listinfo/webtest
>
>
> ------------------------------
> Get the power of Windows + Web with the new Windows Live. Get it now!<htt=
p://www.windowslive.com?ocid=3DTXT_TAGHM_Wave2_powerofwindows_012008>
>

------=_Part_30772_5129897.1199472974178
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

hi <br><br>&nbsp; you can try dump current response via<br><pre>&lt;groovy&=
gt;<br>println step.context.currentResponse.asXml()<br>&lt;/groovy&gt;</pre=
>&nbsp;and you can enable debug mode (in log4j.properties in lib directory =
(add another appender to file))
<br>&nbsp; Regards,<br>&nbsp;Robert<br><br><div><span class=3D"gmail_quote"=
>2008/1/4, Fly High &lt;<a href=3D"mailto:flyhigh172@hotmail.com">flyhigh17=
2@hotmail.com</a>&gt;:</span><blockquote class=3D"gmail_quote" style=3D"bor=
der-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-=
left: 1ex;">




<div>
Thanks for the reply Marc,<br>
&nbsp;<br>
&nbsp;&nbsp; I have tried the &lt;sleep&gt; option as well as a wait loop.&=
nbsp; The page changes its title once the login&nbsp;has completed, but Web=
Test &lt;verifyTitle&gt; never sees the title change.&nbsp;&nbsp; I&#39;m r=
unning version R_1646 which I downloaded yesterday.
<br><br>
&nbsp;&nbsp;&nbsp;A little more info on the app, in the &quot;login window&=
quot;&nbsp;when the &quot;login&quot; button is clicked, a new window (app<=
font size=3D"2">Window</font>) is created for the application.&nbsp; The &q=
uot;login window&quot; then establishes a &quot;session&quot; on a back end=
 server and executes&nbsp;a app
<font size=3D"2">Window.location.replace(sessionURL) to connect the applica=
tion window to the back end session.&nbsp; This effectively refreshes the a=
ppWindow with a new URL.&nbsp; When this occurs, </font>WebTest no longer s=
ee any changes in the appWindow.
<br>
&nbsp;<br>
Here are the step I&#39;m using (I&#39;ve hidden the username and password)=
 for this post:<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;steps&gt;<br>&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;invoke<br>&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
 description=3D&quot;get Login Page&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; url=3D&quot;&quot; /&gt;<b=
r>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ve=
rifyTitle<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp; description=3D&quot;we should see the LogiQuest login page=
 title&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp; text=3D&quot;LogiQuest&reg; - Logistics Research Service&quot; /&gt=
;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt=
;setInputField description=3D&quot;Set the Username&quot; htmlid=3D&quot;nU=
ser&quot; value=3D&quot;***&quot; /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;setInputField description=3D&quot;Se=
t the Password&quot; htmlid=3D&quot;nPass&quot; value=3D&quot;***&quot; /&g=
t;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;=
clickButton description=3D&quot;Click the Login Button - this will open a n=
ew window&quot; htmlid=3D&quot;nLoginBtn&quot; /&gt;<br>&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;verifyTitle description=
=3D&quot;we should see the login title in the new window&quot; text=3D&quot=
;LogiQuest&reg; Login&quot; /&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;=
verifyElementText description=3D&quot;Check Progress box text in the new wi=
ndow&quot; htmlid=3D&quot;nProgress&quot; text=3D&quot;Processing login req=
uest. Please Wait.&quot; /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; &lt;sleep description=3D&quot;sleep for a second&quot; seco=
nds=3D&quot;30&quot;/&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;=
verifyTitle description=3D&quot;Main application title again&quot; text=3D&=
quot;LogiQuest&reg; - Logistics Research Service&quot; /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/steps&gt;<br>
&nbsp;<br>
Here&#39;s the end of the output:<br>
&nbsp;<br>
&nbsp;<br>
[setInputField]&nbsp; INFO (com.canoo.webtest.steps.Step) - &gt;&gt;&gt;&gt=
; Start Step: setInputField &quot;Set the Username&quot; (3/10)<br>[setInpu=
tField]&nbsp; INFO (com.canoo.webtest.steps.Step) - &gt;&gt;&gt;&gt; Start =
Step: setInputField &quot;Set the Password&quot; (4/10)
<br>[clickButton]&nbsp; INFO (com.canoo.webtest.steps.Step) - &gt;&gt;&gt;&=
gt; Start Step: clickButton &quot;Click the Login Button - this will open a=
 new window&quot; (5/10)<br>[clickButton]&nbsp; INFO (com.canoo.webtest.ste=
ps.request.ClickButton
) - -&gt; findTarget(by input): name=3D value=3DL<br>[clickButton]&nbsp; IN=
FO (com.canoo.webtest.engine.WebClientContext) - Content of window changed =
to&nbsp;<a href=3D"http://tcidb1.terabase.com:9084/s2w001/frm_connect.html"=
 target=3D"_blank" onclick=3D"return top.js.OpenExtLink(window,event,this)"=
>
(url</a> of new app window - removed for this post)&nbsp;(text/html)<br>[cl=
ickButton]&nbsp; INFO (com.canoo.webtest.engine.WebClientContext) - Content=
 loaded in newly opened window, its content will become current response<br=
>[clickButton]&nbsp; INFO (
com.canoo.webtest.engine.WebClientContext) - Current form set to none<br>[c=
lickButton]&nbsp; INFO (com.canoo.webtest.engine.WebClientContext) - Curren=
t response now: <a href=3D"http://tcidb1.terabase.com:9084/s2w001/frm_conne=
ct.html" target=3D"_blank" onclick=3D"return top.js.OpenExtLink(window,even=
t,this)">
(url</a><font color=3D"#444444"> of new app window - removed for this post)=
&nbsp;(text/html)</font><br>[clickButton]&nbsp; INFO (com.canoo.webtest.eng=
ine.WebClientContext) - Content of window changed to&nbsp;<a href=3D"http:/=
/tcidb1.terabase.com:9084/$S2W/s2w?LOGIN=3D&amp;1199465171912" target=3D"_b=
lank" onclick=3D"return top.js.OpenExtLink(window,event,this)">
(url</a> of backend session - removed for this post)&nbsp;(text/html)<br>[c=
lickButton]&nbsp; INFO (com.canoo.webtest.engine.WebClientContext) - Conten=
t of window changed with javascript, it will NOT become current response<br=
>[verifyTitle]&nbsp; INFO (
com.canoo.webtest.steps.Step) - &gt;&gt;&gt;&gt; Start Step: verifyTitle &q=
uot;we should see the login title in the new window&quot; (6/10)<br>[verify=
ElementText]&nbsp; INFO (com.canoo.webtest.steps.Step) - &gt;&gt;&gt;&gt; S=
tart Step: verifyElementText &quot;Check Progress box text in the new windo=
w&quot; (7/10)
<br>[verifyElementText]&nbsp; INFO (com.canoo.webtest.steps.Step) - &gt;&gt=
;&gt;&gt; Start Step: verifyElementText &quot;Check Progress box text in th=
e new window - this should fail&quot; (9/10)<br>[verifyTitle]&nbsp; INFO (c=
om.canoo.webtest.steps.Step
) - &gt;&gt;&gt;&gt; Start Step: verifyTitle &quot;Main application title a=
gain&quot; (10/10)<br>&nbsp;INFO (com.canoo.webtest.engine.WebClientContext=
) - Responses restored<br>&nbsp;INFO (com.canoo.webtest.ant.WebtestTask) - =
Finished executing webtest &quot;myTest&quot; (C:\Program Files\Webtest\log=
intest.xml:7: )
<br>&nbsp;INFO (com.canoo.webtest.ant.WebtestTask) - No report to write acc=
ording to config<br>
&nbsp;<br>
BUILD FAILED<br>C:\Program Files\Webtest\logintest.xml:29: Wrong document t=
itle found!. Expected value &quot;LogiQuest=AB - Logistics Research Service=
&quot; but&nbsp;got &quot;LogiQuest=AB Login&quot;, Step: VerifyTitle at C:=
\Program Files\Webtest\logintest.xml:29:&nbsp; with (taskName=3D&quot;verif=
yTitle&quot;)
<br>
Total time: 42 seconds<br>
&nbsp;<br>
&nbsp;<br>
<br>&gt; From: <a href=3D"mailto:mguillemot@yahoo.fr" target=3D"_blank" onc=
lick=3D"return top.js.OpenExtLink(window,event,this)">mguillemot@yahoo.fr</=
a><br>&gt; To: <a href=3D"mailto:webtest@lists.canoo.com" target=3D"_blank"=
 onclick=3D"return top.js.OpenExtLink(window,event,this)">
webtest@lists.canoo.com</a><br>&gt; Subject: Re: [Webtest] RE: Displaying p=
ages modified by Javascript in Webtest results<br>&gt; Date: Fri, 4 Jan 200=
8 10:25:05 +0100<div><span class=3D"e" id=3D"q_11745bdd9258b52d_1"><br>&gt;=
=20
<br>&gt; Hi,<br>&gt; <br>&gt; the mail you mention only discuss the pages p=
resented in the reports,<br>&gt; this means that it doesn&#39;t help your l=
ogin problem.<br>&gt; <br>&gt; Concerning your problem:<br>&gt; - which Web=
Test build do you use?
<br>&gt; - what happens if you add something like &lt;sleep seconds=3D&quot=
;5&quot;/&gt; (it&#39;s<br>&gt; quite extreme, but it&#39;s just to know)?<=
br>&gt; <br>&gt; Cheers,<br>&gt; Marc.<br>&gt; -- <br>&gt; Blog: <a href=3D=
"http://mguillem.wordpress.com" target=3D"_blank" onclick=3D"return top.js.=
OpenExtLink(window,event,this)">
http://mguillem.wordpress.com</a><br>&gt; <br>&gt; <br>&gt; Fly High wrote:=
<br>&gt; &gt; Hello,<br>&gt; &gt; <br>&gt; &gt; This is my first day with W=
ebtest. My app. is AJAX based with the<br>&gt; &gt; client side updated via=
 Javascript. I can&#39;t seem to get past the login
<br>&gt; &gt; page. After WebTest &quot;clicks&quot; the login button I get=
: &quot;Content of window<br>&gt; &gt; changed with javascript, it will NOT=
 become curent response&quot;. I can not<br>&gt; &gt; get any further with =
the testing after this point.
<br>&gt; &gt; <br>&gt; &gt; I did some searching of the mail list and found=
 this: <br>&gt; &gt; <a href=3D"http://lists.canoo.com/pipermail/webtest/20=
06q4/007344.html" target=3D"_blank" onclick=3D"return top.js.OpenExtLink(wi=
ndow,event,this)">
http://lists.canoo.com/pipermail/webtest/2006q4/007344.html</a> (subject:<b=
r>&gt; &gt; Displaying pages modified by Javascript in Webtest results) pos=
ted last<br>&gt; &gt; year. Sounds like what I&#39;m running into. Has any =
progress been made on
<br>&gt; &gt; this front?<br>&gt; &gt; <br>&gt; &gt; Thanks,<br>&gt; &gt; <=
br>&gt; &gt; John<br>&gt; &gt; <br>&gt; &gt; ------------------------------=
------------------------------------------<br>&gt; &gt; Get the power of Wi=
ndows + Web with the new Windows Live. Get it now!
<br>&gt; &gt; &lt;<a href=3D"http://www.windowslive.com?ocid=3DTXT_TAGHM_Wa=
ve2_powerofwindows_122007" target=3D"_blank" onclick=3D"return top.js.OpenE=
xtLink(window,event,this)">http://www.windowslive.com?ocid=3DTXT_TAGHM_Wave=
2_powerofwindows_122007
</a>&gt;<br>&gt; <br>&gt; _______________________________________________<b=
r>&gt; WebTest mailing list<br>&gt; <a href=3D"mailto:WebTest@lists.canoo.c=
om" target=3D"_blank" onclick=3D"return top.js.OpenExtLink(window,event,thi=
s)">
WebTest@lists.canoo.com</a><br>&gt; <a href=3D"http://lists.canoo.com/mailm=
an/listinfo/webtest" target=3D"_blank" onclick=3D"return top.js.OpenExtLink=
(window,event,this)">http://lists.canoo.com/mailman/listinfo/webtest</a><br=
><br>
<br></span></div><hr><span class=3D"q">Get the power of Windows + Web with =
the new Windows Live. <a href=3D"http://www.windowslive.com?ocid=3DTXT_TAGH=
M_Wave2_powerofwindows_012008" target=3D"_blank" onclick=3D"return top.js.O=
penExtLink(window,event,this)">
Get it now!</a></span></div>
</blockquote></div><br>

------=_Part_30772_5129897.1199472974178--