Hello, Marc!
First thanks for you to point at unsafe construction: this text was
presented in HTML. But the problem still persists:
I've re-wrote test as follows:
<retry maxcount="20" description="wait while spreadsheet is importing">
<sleep seconds="6"/>
<verifyText text="Importing data ..."/>
</retry>
'Importing data' text is added by java script during process and doesn't
hardly located in any page. Then i think that this (dynamic) text
shouldn't be located by HtmlUnit (at least verified by verifyText), so I
rewrite test:
<retry maxcount="20" description="wait while spreadsheet is importing">
<sleep seconds="6"/>
<verifyTitle text="Bitcut - View data"/>
</retry>
Ideally should track that page (by auto-redirect) changes to necessary
view (this can be seen in a common browser).
I've switched to Debug mode in log output: seems that file uploaded
sucessfully, but for some reason HtmlUnit doesn't load new page. So, i
have no idea how I could track such processes in our app.
King regards for your patience
Andrew
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.
begin:vcard
fn:Andrew Sickorsky
n:Sickorsky;Andrew
org:Texuna Tech Ltd.
adr;dom:;;Magistralnaya street, 5 - 33;Moscow
email;internet:[EMAIL PROTECTED]
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