'sendKeys' are not working in Selenium WebDriver

后端 未结 12 1579
暗喜
暗喜 2020-12-05 13:36

I am not able to put any value in my application using WebDriver. My application is using frames.

I am able to clear the value of my textbox with driver.findEle

12条回答
  •  -上瘾入骨i
    2020-12-05 14:04

    Before sendkeys(), use the click() method (i.e., in your case: clear(), click(), and sendKeys()):

    driver.findElement(By.name("name")).clear();
    driver.findElement(By.name("name")).click(); // Keep this click statement even if you are using click before clear.
    driver.findElement(By.name("name")).sendKeys("manish");
    

提交回复
热议问题