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

后端 未结 8 1941
死守一世寂寞
死守一世寂寞 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:06

    JavascriptExecutor js = (JavascriptExecutor)driver;
    js.executeScript("document.querySelector('attributeValue').value='new value'");
    

提交回复
热议问题