driver.switchTo().frame()
has multiple overloads.
-
driver.switchTo().frame(name_or_id)
Here youriframe
doesn’t have id or name, so not for you. -
driver.switchTo().frame(index)
This is the last option to choose, because using index is not stable enough as you could imagine. If this is your only iframe in the page, trydriver.switchTo().frame(0)
-
driver.switchTo().frame(iframe_element)
The most common one. You locate your iframe like other elements, then pass it into the method.
Here locating it by title
attributes seems to be the best.
driver.switchTo().frame(driver.findElement(By.cssSelector("iframe[title="Fill Quote"]")));
// driver.switchTo().frame(driver.findElement(By.xpath(".//iframe[@title="Fill Quote"]")));