Selenium
has
multiple methods to handle Frames.driver.switchTo().frame(name)
driver.switchTo().frame(id)
driver.switchTo().frame(index)
driver.switchTo().frame(iframe_element)
Example:
<iframe
name=”content” id=”contentSection”></iframe>
Multiple
options:
driver.switchTo.frame(“content”);
driver.switchTo.frame(“contentSection”);
driver.switchTo.frame(0);
driver.switchTo.frame(
driver.findElement(By.cssSelector("iframe[id='
contentSection
']")
)
To get out of Frame:
driver.
SwitchTo
().
DefaultContent
()
Switch to Parent Frame:
driver.switchTo().parentFrame();
No comments:
Post a Comment