The web site that I am testing sometime raises zero, one, two or more alerts so I have to wait until no more alerts occur. The time between alerts may be zero, one or more seconds so I have to wait the worst case seconds just in case one or more of the delayed alerts occur. So my problem is all the fault of the web site that I am testing.