selenium在使用sendkeys()时报错

在eclipse上使用selenium 写脚本的时候,碰到sendkeys("selenium");报错
eclipse

image.png



解决方法ide

searchField.sendKeys(new String[] { "sample" });
将sendKeys中的内容换成上面的内容
spa


image.png

这样就能够正常运行了ip




若是这样还报错selenium

image.png



缘由是旧版本的Java不理解非随机变量参数it

解决方法io

在工程上点击右键选择Properties -> Java Compiler,选择1.7版本class

image.png

image.png

相关文章
相关标签/搜索