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版本。

时间: 2024-08-05 06:39:29

The method sendKeys(CharSequence[]) in the type WebElement is not applicable for the arguments (String)的相关文章

The method sort(Comparable[]) in the type Shell is not applicable for the arguments (int[])

看算法第四版的希尔排序时,打算把例中的String数组换成int数组,却出现了上面的问题.最后在StackOverflow找到答案原代码: package sort; import edu.princeton.cs.algs4.In; public class Shell{ public static void sort(Comparable[] a) { //将a[]升序排列 int N = a.length; int h = 1; while (h<N/3) h = 3*h + 1; //

The method load(Class, Serializable) in the type Session is not applicable for the arguments (Class&lt;

Transaction transaction = session.beginTransaction(); //load是通过主键属性,获取对象的实例 Employee employee  =(Employee) session.load(Employee.class, 1); employee.setName("demo"); transaction.commit(); session.close(); 报错The method load(Class, Serializable) i

错误:The method replace(int, Fragment) in the type FragmentTransaction is not applicable for the arguments (int, MyFragment)

Fragment newfragment =new MyFragment();fragmentTransaction.replace(R.layout.activity_main,newfragment ).commit(); 提示错误:The method replace(int, Fragment) in the type FragmentTransaction is not applicable for the arguments (int, MyFragment) 妈蛋,找了好久!一直以

The method setItems(String) in the type ForTokensTag is not applicable for the arguments (Object)

1. 问题 看到这个错误以为是貌似jsp页面有误,c:forTokens标签用错了?? An error occurred at line: 444 in the jsp file: /WEB-INF/pages/countOrder/viewCountOrderDetails.jsp The method setItems(String) in the type ForTokensTag is not applicable for the arguments (Object) 441: </t

The method load(Class, Serializable) in the type HibernateTemplate is not applicable for the arguments (Class, int)

引入别人的项目发现利用HibernateTemplate的load的方法报错了.错误提示为: 意思为load方法的第二个参数是实现Serializable接口的对象,int类型不符合.但jdk自动装箱,int会自转换为Integer,而Integer是实现了Serializable的,所以应该是可以的.但myeclipse偏偏报错了,原因是我的myeclipse中window->preferences->java-compiler中的Compiler compliance level设置为1.

The method setPositiveButton(int, DialogInterface.OnClickListener) in the type AlertDialog.Builder is not applicable for the arguments

The method setPositiveButton(int, DialogInterface.OnClickListener) in the type AlertDialog.Builder is not applicable for the arguments (String, new   View.OnClickListener(){}) .setNegativeButton("Don't Remind", new OnClickListener() .setNegative

The method replace(int, Fragment, String) in the type FragmentTransaction is not applicable for the

 The method replace(int, Fragment, String) in the type FragmentTransaction is not applicable for the arguments (int, SettingFragment, String) 今天遇到这样一个很奇葩的错误信息,后来查到我导入的包有问题  import android.app.Fragment; import android.app.FragmentManager;   其实我应该使用的

Access restriction: The method createJPEGEncoder(OutputStream) from the type JPEGCodec is not access

准备使用Java进行图片压缩的时候,使用 import com.sun.image.codec.jpeg.*; 结果出现错误: Access restriction: The method createJPEGEncoder(OutputStream) from the type JPEGCodec is not accessible due to restriction on required library 上网查了一下,发现是IDE的设置问题,它默认把这些受访问限制的API设成了ERROR

Mapper method &#39;com.autoyol.mapper.trans.AccountLogMapper.getTotalIncomByMemNoLastest attempted to return null from a method with a primitive return type (int).解决方法

1.打开日志输出,降低日志级别. <AppenderRef ref="console" level="trace"></AppenderRef> 否则看不到报错.. 2.调整mysql语句,不能使用order by limit之类的 <!-- SELECT IFNULL(amt,1) FROM account_log WHERE mem_no=#{value} AND income_type != 4 ORDER BY id DESC