I am using selenium webdriver + java + eclipse + testng for my automation scripts.
I am trying to get the URL of window which contains an alert box. On clicking download button on a webpage, it opens an alert box in a new window. I want to fetch the URL of this window.
I tried getCurrentURL command for this but i am getting UnhandledAlertException : Modal dialog present. If i dismiss the alert box the window containing is immediately closed so it is not possible to get the URL.
It seems the alert box (modal dialog here) is blocking webdriver in reading the URL of the window. Please suggest me a solution for this.
Thanks