【发布时间】:2014-06-16 03:13:52
【问题描述】:
我正在尝试运行 selenium webdriver,模仿在文本框中输入内容并提交。
我有以下代码:
WebElement element = null;
element = waitForElementPresent(tFByCssSelector,timeoutValue);
element.clear();
element.click();
element.sendKeys("Input String");
代码成功在文本字段中输入“输入字符串”,但是当我提交表单时,它说表单为空(表单已设置为捕获空输入异常)。
我想知道为什么 sendKeys 没有设置文本字段的值,即使它已经在文本字段中输入了想要的值。
【问题讨论】:
标签: selenium automation webdriver sendkeys