Hi Pradeep,
I assume you are trying to automate IE or FF browser, if not
please ignore. 

If you are I believe this should help you.
http://wiki.openqa.org/display/WTR/Pop+Ups

Regards,
Manish

Excerpts from Pradeepta Swain's message of Mon Feb 04 16:24:21 +0530 2008:
> How can I access java script pop ups using ruby ? I want to access the
> alert message as well as click the button of pop up boxes . How can I do
> that ? Anybody help ??