I've tried your code, and it works fine for me. I do notice that when I point my browser to http://delfin.klte.hu/~benedeki, there is no alert box. Are you sure you're using the correct address?
James Tikalsky
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
First I have to tell I'm beginner in httpunit testing. May be the solution is very simple.
I have a very simple site :
<html><head><title>Alert sample</title></head>
<body onload='alert("foo");'>
</body></html>
It is only for testing and I want to obtain alert's text.
My code looks like this:
WebConversation wc = new WebConversation();
WebRequest req = new GetMethodWebRequest("http://delfin.klte.hu/~benedeki");
WebResponse resp = wc.getResponse( req );
An if call this at this point :
wc.getNextAlert());
I get null.
Anyone of You can help me in this problem ?
ASAP:)
I made something wrong?
Thanks in advance!
Best Regards,
Istvan Benedek
Istvan,
I've tried your code, and it works fine for me. I do notice that when I point my browser to http://delfin.klte.hu/~benedeki, there is no alert box. Are you sure you're using the correct address?
James Tikalsky