From the course: Selenium Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Switch to active window

Switch to active window - Selenium Tutorial

From the course: Selenium Essential Training

Start my 1-month free trial

Switch to active window

- [Narrator] Some applications have multiple windows, frames, and alerts that open on a page. Selenium WebDriver assigns each window a unique ID, so that Selenium can differentiate when it is switching controls from one window to another. The switchTo method is provided by the WebDriver interface and allows the driver to switch between windows, frames, and alerts. It offers the following options. First is the option to switch to a window by providing the window name as a parameter. There's also the option to switch to a frame by providing the frame name as a parameter. And third is the option to switch to a pop-up alert. Now, keep that in mind as I focus on automating a test for switching to an active window. I'll start by opening the exercise file for this video, at 02_05 in the start directory. Once the project opens, I will start by building the project by selecting Build, Build Project. When that finishes, I'll want to focus now on filling out the steps of the test. Now let's hop…

Contents