博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
selenium在使用sendkeys()时出现的问题
阅读量:6998 次
发布时间:2019-06-27

本文共 407 字,大约阅读时间需要 1 分钟。

hot3.png

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

转载于:https://my.oschina.net/CeShiXiaoSongShu/blog/345640

你可能感兴趣的文章