导出代码:
public void testUntitledTestCase() throws Exception {
driver.get("URL");
driver.findElement(By.xpath("//button[@id='add-items']")).click();
driver.findElement(By.id("item_title")).sendKeys("Automation");
driver.findElement(By.id("item_cat_id")).click();
// ERROR: Caught exception [ERROR: Unsupported command [selectFrame | index=1 | ]]
driver.findElement(By.linkText("Cat1")).click();
// ERROR: Caught exception [ERROR: Unsupported command [selectFrame | relative=parent | ]]
driver.findElement(By.xpath("//button[@id='item-save']"").click();
}
错误发生在Iframe打开的位置。该应用程序具有其中某些字段具有按钮的形式-单击这些其他视图时,将在弹出式窗口(Iframe)中打开该视图。我需要从iframe中选择元素。它抛出一个错误:
// ERROR: Caught exception [ERROR: Unsupported command [selectFrame | index=1 | ]].
// ERROR: Caught exception [ERROR: Unsupported command [selectFrame | relative=parent | ]]
炎炎设计
慕森卡
相关分类