When i load Url by click i am getting Refresh to Load error

Hi team ,

When i am trying to loadUrl by click i am getting an error message

" Refresh to Load Url (0s) aborted by HtmlUnit: Attempted to refresh a page using an ImmediateRefreshHandler which could have caused an OutOfMemoryError Please use WaitingRefreshHandler or ThreadedRefreshHandler instead."

Why this is happening and how can i resolve these kind of issues ?

Thanks ,
Sumanth P


Looks like your page specifies a <meta> tag with a http-equiv="refresh" attribute. Alternatively, the server may have delivered the page with a Refresh response header. Can you confirm? If so, please post the complete refresh configuration, i.e. the complete <meta> tag or the response header value. Does your test case rely on the page actually being refreshed or would it still work if the page would not be refreshed at all?

Previously its worked fine and i am just making LoadpageBYclick(URL)

i think this will help you to understand .

Sumanth P

Try any of these statements right before your failing loadPageByClick() and see if it helps in your case:

getWebClient().setRefreshHandler(new ThreadedRefreshHandler());
getWebClient().setRefreshHandler(new WaitingRefreshHandler());
getWebClient().setRefreshHandler(new WaitingRefreshHandler(5000));
getWebClient().setRefreshHandler(new RefreshHandler()
    public void handleRefresh(Page page, URL url, int seconds) throws IOException
        // don't refresh at all 

Thanks for the replay i think it will work