[Webtest] [Fwd: XmlHttpRequest: page text doesn't change after
ajax call though it should.]
Andrew Sickorsky
andrew.sickorsky@texunatech.com
Tue, 23 Oct 2007 16:03:37 +0400
This is a multi-part message in MIME format.
--------------060000050603050509020001
Content-Type: multipart/alternative;
boundary="------------060409060304090705010307"
--------------060409060304090705010307
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Hello, Mark!
About "no text":
After clicking the button in real browser new string appears on the page
in the table with tex, say, '17 Oct 2007'
After "clicking" using <clickButton> no such text found (though it
should be presented in the page in the table cell), but when i look into
the groovy-printed result I found string needed.
Is there any way to verify such text without groovy-scripting
(unfortunately i'm unfamiliar with Groovy)
Thanks
Andrew
> Hi Andrew,
>
> what do you mean with "there is no text in clickButton result page"?
>
> verifyText works on the rough text of the last response page from server. If
> the page content has been changed dynamically (for instance after
> XMLHttpRequest usage), it won't be seen!
>
> In other words, verifyText works on
> step.context.currentResponse.webResponse.contentAsString
> and NOT on
> step.context.currentResponse.asXml()
>
> Cheers,
> Marc.
>
>
> Andrew Sickorsky wrote:
>
>> Hello all!
>>
>> I faced with AJAX problem: for some reason page doesn't updated after
>> XmlHttpRequest performed (Prototype library was used; ideally some text
>> should appear, but nothing happens). Env: last build of HtmlUnit,
>> Webtest R1619, ant 1.6.5 were used. Tested with IE and FF user agents.
>>
>> Steps:
>> - open page (<invoke>
>> - fill in form and submit (<setInputField> + <clickButton> + <groovy>
>> print currentResponce)
>> - verify that page text changes (it should! - <verifyText>)
>>
>> Interesting point: there is no text in clickButton result page though it
>> is in the groovy printed current responce though verfiyText finds nothing.
>>
>> Thanks in advance
>> Andrew
>>
>>
>>
>> begin:vcard
>> fn:Andrew Sickorsky
>> n:Sickorsky;Andrew
>> org:texunatech
>> adr;dom:;;Magistralnaya street, 5 - 33;Moscow
>> email;internet:andrew.sickorsky@texunatech.com
>> title:Tester
>> tel;work:+7 495 9809067
>> tel;cell:+7 909 9070328
>> x-mozilla-html:TRUE
>> url:www.texunatech.com
>> version:2.1
>> end:vcard
>>
>>
>>
>>
>
>
--------------060409060304090705010307
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hello, Mark!<br>
<br>
About "no text":<br>
After clicking the button in real browser new string appears on the
page in the table with tex, say, '17 Oct 2007'<br>
After "clicking" using <clickButton> no such text found (though
it should be presented in the page in the table cell), but when i look
into the groovy-printed result I found string needed.<br>
<br>
Is there any way to verify such text without groovy-scripting
(unfortunately i'm unfamiliar with Groovy)<br>
<br>
Thanks<br>
Andrew<br>
<br>
<br>
<blockquote cite="mid:13362681.post@talk.nabble.com" type="cite">
<pre wrap="">Hi Andrew,
what do you mean with "there is no text in clickButton result page"?
verifyText works on the rough text of the last response page from server. If
the page content has been changed dynamically (for instance after
XMLHttpRequest usage), it won't be seen!
In other words, verifyText works on
step.context.currentResponse.webResponse.contentAsString
and NOT on
step.context.currentResponse.asXml()
Cheers,
Marc.
Andrew Sickorsky wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hello all!
I faced with AJAX problem: for some reason page doesn't updated after
XmlHttpRequest performed (Prototype library was used; ideally some text
should appear, but nothing happens). Env: last build of HtmlUnit,
Webtest R1619, ant 1.6.5 were used. Tested with IE and FF user agents.
Steps:
- open page (<invoke>
- fill in form and submit (<setInputField> + <clickButton> + <groovy>
print currentResponce)
- verify that page text changes (it should! - <verifyText>)
Interesting point: there is no text in clickButton result page though it
is in the groovy printed current responce though verfiyText finds nothing.
Thanks in advance
Andrew
begin:vcard
fn:Andrew Sickorsky
n:Sickorsky;Andrew
org:texunatech
adr;dom:;;Magistralnaya street, 5 - 33;Moscow
<a class="moz-txt-link-abbreviated" href="mailto:email;internet:andrew.sickorsky@texunatech.com">email;internet:andrew.sickorsky@texunatech.com</a>
title:Tester
tel;work:+7 495 9809067
tel;cell:+7 909 9070328
x-mozilla-html:TRUE
url:www.texunatech.com
version:2.1
end:vcard
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>
--------------060409060304090705010307--
--------------060000050603050509020001
Content-Type: text/x-vcard; charset=utf-8;
name="andrew.sickorsky.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="andrew.sickorsky.vcf"
begin:vcard
fn:Andrew Sickorsky
n:Sickorsky;Andrew
org:texunatech
adr;dom:;;Magistralnaya street, 5 - 33;Moscow
email;internet:andrew.sickorsky@texunatech.com
title:Tester
tel;work:+7 495 9809067
tel;cell:+7 909 9070328
x-mozilla-html:TRUE
url:www.texunatech.com
version:2.1
end:vcard
--------------060000050603050509020001--