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

相關文章
相關標籤/搜索