HTML CODE
<html>
<head>
<body style="padding: 10px 25px; margin:0; left:0;right:0;top:0;bottom:0;position:absolute;font:14px 'robotoregular'; cursor:text; width: auto;">
<br _moz_editor_bogus_node="TRUE"/>
</body>
</html>
JAVA CODE
public TemplateOfNewLetter enterTextMessageToMessageField(String textMessage){
driver.switchTo().frame(0);
//driver.switchTo().frame(driver.findElement(By.tagName("iframe")));
//WebElement body = waitElementToBeClickable(By.cssSelector("html>body"));
WebElement body = waitElementToBeClickable(By.tagName("body"));
body.click();
body.sendKeys(textMessage);
driver.switchTo().defaultContent();
return this;
}
我尝试使用上面的代码,但问题仍然在资源管理器中重现(通过FF和Chrome测试)
请告知如何在短信字段中输入文字
答案 0 :(得分:0)
尝试在此链接中查看如何使用selenium: http://seleniumeasy.com/selenium-webdriver-tutorials