window handling selelnium code example
Example 1: how to handle windows
How do you handle windows?
- We use window handles for handling windows & tabs.
- A window handle is a randomly generated
unique id for each window.
- We can use WindowHandles to switch in
between different windows.
SYNTAX =
driver.getWindowHandle;-> returns current window handle
driver.getWindowHandles; return all current opened windows
Example 2: how to handle windows in selenium
How do you handle windows?
- We use window handles for handling windows & tabs.
- A window handle is a randomly generated
unique id for each window.
- We can use WindowHandles to switch in
between different windows.
SYNTAX =
driver.getWindowHandle;-> returns current window handle
driver.getWindowHandles; return all current opened windows