Tag: iframe

如何在iframe中的Rich Text编辑器中使用SendKeys(webdriver)命令

我面临以下问题。我无法在iframe中输入文本编辑器中的文本:这是html: 这是我到目前为止所做的,但测试成功通过,文本编辑器中没有写入任何文本。可能解决方案是使用Javascript执行程序,但我不熟悉它。 WaitTool.waitForElementPresent(Browser.instance, By.tagName(“iframe”), 10); WebElement iframe = Browser.instance.findElement(By.tagName(“iframe”)); Browser.instance.switchTo().frame(iframe); WebElement description=Browser.instance.findElement(By.xpath(“//body[@class=’cke_editable cke_editable_themed cke_contents_ltr’]”)); description.click(); description.sendKeys(“someText”); Browser.instance.switchTo().defaultContent(); 提前致谢!