Alternative to send keys in Selenium

Viewed 5352

I want to send a string to a textbox using Selenium, but I find that sendKeys is too slow for my liking. If I have a string "abcde", is there any way to send that string as a block instead of typing it out by "a" then "b" then "c" etc via sendKeys?

1 Answers

In python use execute_script

from selenium import webdriver
driver = webdriver.Chrome('chromedriver')
driver.get("http://www.google.com");
driver.execute_script("document.getElementsByName('q')[0].value='abcde'")
Related