How to type in textbox using Selenium WebDriver (Selenium 2) with Java?

后端 未结 6 2123
栀梦
栀梦 2021-01-04 10:18

\"enter I am using Selenium 2. But after running following code, i could not

6条回答
  •  执念已碎
    2021-01-04 10:32

    Another way to solve this using xpath

    WebDriver driver =  new FirefoxDriver();
    driver.get("https://www.facebook.com/");
    driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
    driver.findElement(By.xpath(//*[@id='email'])).sendKeys("your@email.here");
    

    Hope that will help. :)

提交回复
热议问题