您可以使用findElement获取框架Webelement,并将其与switchto()方法一起使用。
driver.switchTo().frame(driver.findElement(By.xpath("iframe[contains(@name=pngNewCase1143241142570_Iframe)]")));如果您还有其他属性,例如src,则可以尝试以下操作。
WebElement frame=driver.findElement(By.xpath("//iframe[@src='showNewClaimForm.action']");driver.switchTo().frame(frame);


