Hi,
I have the following scenario which is not working in webtest. Can you please
let me know how to handle this?
OnButtonClick(){
Change the src attribute of IFrame. This is used to record the history in
the browser. This triggers a HTTP Get to a static page
Send a HTTP request using XMLHttpRequest object
}
Webtest considers the HTTP Get response triggered by IFrame as the response of
OnButtonClick. It ignores the response from the XMLHTTPRequest object.
Any idea how to fix this?
BTW I'm using : R_1786
Thanks,
Haneef
-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Marc Guillemot
Sent: Monday, October 12, 2009 11:13 PM
To: [email protected]
Subject: Re: [Webtest] Problem using Webtest and DOM tree's
Hi,
instead of sleeping or retrying, you can use
<config easyajax="true"/>
which works fine for a lot of AJAX libraries... but not all :-(
Cheers,
Marc.
Soula, William a écrit :
> Thanks Stephan for the example for:
>>Taken a step farther you can make a macro that takes an element and do a
> retry on the element sleeping between retries. Then all you >have to do
> is pass a verifyXPath step for whatever will load with ajax to the macro
> and it will keep trying till it is loaded.
>
> Truly examples are better than sentences, so, I'll include mine as it is
> a little different than Stephan's:
> <macrodef name="ajaxLoad">
> <element name="value" implicit="yes"/>
> <sequential>
> <retry maxcount="30">
> <sleep seconds="1"/>
> <value/>
> </retry>
> </sequential>
> </macrodef>
>
> <ajaxLoad>
> <verifyXPath xpath="//tab...@id='ajaxLoadTable']"
> description="Wait for ajax to load"/>
> </ajaxLoad>
>
> This way you can also use webtest steps to verify when ajax is loaded so
> you could do:
> <ajaxLoad>
> <verifyInputField name="valueSetWithAjax" value="100"
> description="Wait for ajax to load"/>
> </ajaxLoad>
> --------------------------------------------------------
>
> Hi,
>
> On Thu, Oct 08, 2009 at 02:44:55PM -0500, Soula, William wrote:
>> Is it possible this stuff is created using ajax for you guys? If so
>> you can use a sleep to wait for it to load and then check it with
>> xpath.
>
> Instead of sleeping a certain time you can do the check in a loop and
> sleep one second only. That saves you time if your request is a lot
> shorter that the aproximated 5 seconds and also if a request hangs once
> you wont get a failure.
>
> I use this macro to check for an xpath that must be exist after the
> response from an ajax call was reveived:
>
> <macrodef name="checkAjaxResponseXpathRegex" description="check
> response of an ajax request">
> <attribute name="description" />
> <attribute name="xpath" />
> <attribute name="regex" />
> <sequential>
> <retry maxcount="10">
> <sleep seconds="1"/>
> <verifyXPath
> description="@{description}"
> xpath="@{xpath}"
> regex="@{regex}"
> />
> </retry>
> </sequential>
> </macrodef>
>
> Inside the webtest I do this:
>
> <setSelectField
> description="Select some value"
> xpath="//sele...@id='some_id']"
> value="some_val"
> />
> <checkAjaxResponseXpathText
> description="check result after ajax call"
> xpath="//d...@id='some_id']/ol/li[4]/a"
> text="Sometext"
> />
>
> With this mechanism I can test most of the Ajax stuff inside a page
> that changes the DOM tree when the response is received.
>
> Best regards, Stephan
> _______________________________________________
> WebTest mailing list
> [email protected]
> http://lists.canoo.com/mailman/listinfo/webtest
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest