Pages

WebDriver SwitchTo() Methods


switchTo():it moves the cursor to the specified window/frame/alerts
//switch to specified window
driver.switchTo().window(windowref);
//switch to the frames
driver.switchTo().frame(String framelocator);
driver.switchTo().frame(int index);
driver.switchTo().frame(WebElement elelementName);
//switch to the alerts
Alert refvar=driver.switchTo().alert();
Alert is an interface

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.