报错org.openqa.selenium.NoSuchElementException的原因有很多:


1、通过class或者name等定位元素,元素不唯一
2、元素位于iframe中
3、元素还未加载出来


第一种情况,建议使用​​id​​​或者​​xpath​​来定位元素。

By.xpath("//input[@value='']");

更多文章请关注《万象专栏》