我正在尝试使用selenium-webdriver实现关键字"Unselect Frame“,但不知道如何使其对所有框架通用。
以下示例不起作用:
/**
* Sets the top frame as the current frame.
*
*/
public void unselectFrame(){
try {
WebElement element = getElement("//body");
driver.switchTo().frame(element);
} catch (Exception e) {
//exception
}
}都会非常感谢你的帮助。
发布于 2012-10-02 21:24:12
你的意思是换出画面吗?在这种情况下,这应该是可行的:
driver.switchTo().defaultContent();https://stackoverflow.com/questions/12689906
复制相似问题