Reputation: 568
I want to add about 1000 or 10000 repeating letters/words to a textarea with:
driver.findElement(By.name("message")).sendKeys("asdasdsadasdasdasdasdasdasdasd");
I haven't found a proper example how to achieve this.
Upvotes: 1
Views: 612
Reputation: 140319
Just build a string to pass to sendKeys
:
StringBuilder sb = new StringBuilder(1000);
while (sb.length() < 1000) {
sb.append("sequencetorepeat");
}
webElement.sendKeys(sb.toString());
There are more efficient ways to repeat strings, but this is a simple approach for reasonably short strings.
Upvotes: 1