I’m trying to implement the keyword “Unselect Frame” with selenium-webdriver, but have no idea how to make it universal to all frames.
The following example doesn’t work:
/**
* Sets the top frame as the current frame.
*
*/
public void unselectFrame(){
try {
WebElement element = getElement("//body");
driver.switchTo().frame(element);
} catch (Exception e) {
//exception
}
}
Will be grateful for any help.
Did you mean switching out of the frame?
In that case this should work: