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