下面是代码片段,当我尝试执行sendKeys时,它会抛出错误。
public class Revision {
public static void main(String[] args) {
WebDriver dr = new FirefoxDriver();
dr.get("https://www.youtube.com/");
dr.manage().window().maximize();
dr.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
WebElement you=dr.findElement(By.id("masthead-search-term"));
you.sendKeys("lean on");