Hi Andrew,
ups, I see now that your test is not safe:
<verifyText text="Please wait while your feed is being imported."/>
verifies that this text is contained in server response of the current
page. This means that it can be at any place in the html file and, that
it is there even before you click the upload button, and if you use
AJAX, it will still be there once the request has been processed.
You should configure the log to "see" if the AJAX call occured. And you
can probably look at the logs of your server too.
Marc.
Andrew Sickorsky wrote:
> Hi, Marc!
> Thanks for the answer. But it seems that this didn't work for me. So,
> I've included code:
> <groovy>
> import
> com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController
> step.context.webClient.ajaxController = new
> NicelyResynchronizingAjaxController()
> </groovy>
>
> The text code is:
> <clickElement
> xpath="//[EMAIL PROTECTED]'dashboard-icons']/[EMAIL
> PROTECTED]'import_excel']"/>
> <setFileField
> xpath="//[EMAIL PROTECTED]'import-excel']//[EMAIL PROTECTED]'field']"
> fileName="${analysis-test-web.dir}/testdata/${excel.name}"/>
> <clickElement
> xpath="//[EMAIL PROTECTED]'import-excel']//[EMAIL
> PROTECTED]'upload-button']"/>
> <retry maxcount="40" description="wait while spreadsheet is importing">
> <sleep seconds="6"/>
> <not>
> <verifyText text="Please wait while your feed is being
> imported."/>
> </not>
> <sleep seconds="6"/>
> </retry>
> <verifyText text="Your data have been successfully imported."/>
> <clickElement xpath="//[EMAIL PROTECTED]'buttons']/[EMAIL
> PROTECTED]'Close']"/>
>
> but this All nested steps 'retried without success'. Total time for
> uploading: 40*60=240 seconds = 4 minutes is enough for testing s/s. I've
> tested this with 'Seconds' parameter equal to '30' (30*40 = 1200
> seconds) but result remains the same.
>> Hi Andrew,
>>
>> can you try this (with a recent build containing HtmlUnit 1.13):
>>
>> <groovy>
>> import com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController
>> step.context.webClient.ajaxController = new
>> NicelyResynchronizingAjaxController()
>> </groovy>
>>
>> this will be the default setting for WebTest... once I've found time
>> for it.
>>
>> More about the motivation of this resynchronization:
>> http://mguillem.wordpress.com/2007/07/24/htmlunit-re-synchronize-ajax-calls-for-simple-deterministic-test-automation/
>>
>>
>> Marc.
>>
>
--
Blog: http://mguillem.wordpress.com
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest