'sendKeys' are not working in Selenium WebDriver

后端 未结 12 1615
暗喜
暗喜 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条回答
  •  佛祖请我去吃肉
    2020-12-05 14:07

    Clicking the element works for me too, however, another solution I found was to enter the value using JavaScript, which doesn't require the element to have focus:

    var _element= driver.FindElement(By.Id("e123"));
    IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
    js.ExecuteScript("arguments[0].setAttribute('value', 'textBoxValue')", _element);
    

提交回复
热议问题