lunes, 3 de agosto de 2015

Popup Window

There are many cases where a application displays multiples windows when we open a website.
We can handle popup window in selenium using getWindowsHandles() method to get the set of windows and get their handle. Then pass the handle to window() method available in WebDriver instance variable.

We can remove all the handles from before the popup window appears with the command
Set afterPopup=driver.getWindowsHandles();
afterPopup.removeAll(beforePopup).

Using Popup Window

This is the page






Run the test









No hay comentarios:

Publicar un comentario