Hi all,

I'm having a problem using canoo to test a webpage's search function which
gives an AJAX response (without reloading page). The case is that when I run
the test script, it will work properly and pass most of the time (like
>95%), but there is a low chance that htmlunit will be stuck in a loop where
it does nothing except spit out errors continuously, and the canoo webtest
won't even time out.

and yes, I am running the latest snapshot as of this postdate.


The errors look like this: 
[verifyxpath]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
verifyxpath "Verifying search results" (33/49)
ERROR (com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest) -
XMLHttpRequest.getResponseHeader() was called before the response was
available.
ERROR (com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest) -
XMLHttpRequest.getResponseHeader() was called before the response was
available.
ERROR (com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest) -
XMLHttpRequest.getResponseHeader() was called before the response was
available.
ERROR (com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest) -
XMLHttpRequest.getResponseHeader() was called before the response was
available.
ERROR (com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest) -
XMLHttpRequest.getResponseHeader() was called before the response was
available.
...and on...


The script looks like this: 
<setInputField 
        htmlId="foo" 
        value="#{test_id}" 
        description="Enter value into dashboard search bar" />
<groovy>
        step.context.currentResponse.getHtmlElementById("foo").type('\n')
</groovy>
<ajaxLoad>
        <verifyxpath 
                xpath="//search_resu...@category='Types' and 
@value='#{test_id}']"
                description="Verifying search results"/>
</ajaxLoad>


where ajaxLoad is a macro that loops and waits for the ajax response: 
<macrodef name="ajaxLoad">
        <element name="value" implicit="yes"/>
        <sequential>
                <retry maxcount="30">
                        <sleep seconds="1"/>
                        <value/>
                </retry>
        </sequential>
</macrodef> 



Because this webtest script is being developed for automated testing that
runs periodically, we can't have it hang in the background even if it rarely
happens.

Is there a way for me to get around this problem? 

Thanks in advanced, 

- Dave
-- 
View this message in context: 
http://old.nabble.com/Webtest-stuck-in-HTML-error-loop-tp27658730p27658730.html
Sent from the WebTest mailing list archive at Nabble.com.

_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to