Reputation:
I have a problem with Selenium and Chrome. I need to send via SendKeys a really big string (>20'000 characters). It starts very fast, but then it keeps slowing down until it stops sending keys to my body contenteditable=true which i'm referring to by xpath. The browser then is not responding, and I need to kill it via the task manager (I am on Windows 10).
UPDATE: I also tried to send less characters splitting the String and putting some sleeps. The problem is not caused by the amount of character chromedriver has to write, but by the amount of characters in a textbox.
Upvotes: 4
Views: 3599
Reputation: 2947
You may try to use an alternative way to enter characters, by means of JavaScript.
WebElement element = driver.findElement(By.xpath(yourXpath));
JavascriptExecutor jse = (JavascriptExecutor)driver;
jse.executeScript("arguments[0].innerText=arguments[1];", element, yourLongText);
Upvotes: 2