Hi guys,
I can't sendKeys to webElement in iframe. I got page with iframe with <p> in it.
driver.switchTo().frame(1);
Then
WebElement frameInput = driver.switchTo().activeElement();
frameInput.sendKeys("Test");
or
driver.findElement(By.cssSelector("p")).sendKeys("Test");
Sometimes test fails due to invisibility of element (WebDriverWait.until(visibilityof()) doesn't help) and sometimes test pass, but text doesn't appear in element.
I tried Actions and ((JavascriptExecutor) driver).executeScript("document.body.innerHTML = '<br>'"), but got
java.lang.ClassCastException: com.sun.proxy.$Proxy11 cannot be cast to org.openqa.selenium.JavascriptExecutor
and java.lang.ClassCastException: com.sun.proxy.$Proxy11 cannot be cast to org.openqa.selenium.interactions.HasInputDevices
at org.openqa.selenium.interactions.Actions.<init>
Using selenium-server 2.41.0 and FF 28
Thanks in advance!