The method sendKeys(CharSequence[]) in the type WebElement is not applicable for the arguments (String)

写了一段测试代码运行时一直报错:The method sendKeys(CharSequence[]) in the type WebElement is not applicable for the arguments (String)

测试代码:

driver.findElement(By.name("wd")).sendKeys("selnium");

原因:旧版本的Java不理解非随机变量参数

解决方法:在工程上点击右键选择Build Path -> Configure Build Path->Java Compiler,选择1.7版本。

 

posted @ 2015-11-21 18:18  老湿鸡  阅读(1365)  评论(0编辑  收藏  举报