Method and Description:
- getWindowHandle
()
- Return an opaque handle to this window that uniquely identifies it within this driver instance. - getWindowHandles
()
- Return a set of window handles which can be used to iterate over all open windows of this WebDriver instance by passing them toswitchTo()
.WebDriver.Options.window()
Example:
- Below example opens a page of w3schools.com
- And then clicks on ‘Try it yourself »’ link, which opens a new window.
- Switch to new window, perform some actions on it and then switch back to previous window
No comments:
Post a Comment