Set value of input instead of sendKeys() - Selenium WebDriver nodejs

后端 未结 8 1975
死守一世寂寞
死守一世寂寞 2020-11-30 03:53

I have a long string to test and sendKeys() takes too long. When I tried to set the value of the text the program crashes. I know the Selenium

8条回答
  •  臣服心动
    2020-11-30 04:25

    Thanks to Andrey Egorov, in my case with python setAttribute not working, but I found I can set the property directly,

    Try this code:

    driver.execute_script("document.getElementById('q').value='value here'")
    

提交回复
热议问题