In Firefox you can use firefox setting to manage popup with selenium webdriver. This is explained in video 16 of the training
In Chrome you can use Auto it to manage popup with selenium webdriver. This is explained in video 15 of the training at qtpselenium.com