您的位置:首页 > 其它

selenium在使用sendkeys()时出现的问题

2014-11-17 00:00 204 查看
代码: driver.findElement(By.id("kw")).sendKeys("123");

出现的这个问题:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method sendKeys(CharSequence[]) in the type WebElement is not applicable for the arguments (String)

at selenium22.T1.main(T1.java:24)

解决方法
searchField.sendKeys(new String[] { "sample" });
将sendKeys中的内容换成上面的内容。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  selenium sendkeys