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

原创
2014/11/17 18:17
阅读数 1.9K

代码: 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中的内容换成上面的内容。


展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
0 评论
0 收藏
0
分享
返回顶部
顶部