我得到了:
类型不匹配:无法从org.openqa.selenium.WebElement转换为WebElement
关于以下代码:
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
public class WebElement {
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.manage().window().maximize();
driver.get("https://accounts.google.com/signin/v2/identifier?continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&service=mail&sacu=1&rip=1&flowName=GlifWebSignIn&flowEntry=ServiceLogin");
WebElement emailField = driver.findElement(By.id("identifierId"));
}
}
发布于 2017-09-21 11:03:08
通过命名类WebElement
,您将跟踪导入的WebElement
。
为你的班级选一个不同的名字。
发布于 2017-09-25 09:21:23
当您访问或尝试导入WebElement
以定位您的元素时,更改类的名称会引起歧义。
https://sqa.stackexchange.com/questions/29738
复制相似问题