I'm new to Java, I made a Python version so I thought I'd give it a go in Java too.
Here's it in action (it's slightly slower than the Python version, however.)
![[Image: 788dec1e309a896fafe9d6b648903b45.gif]](https://i.gyazo.com/788dec1e309a896fafe9d6b648903b45.gif)
The code, please criticise me.
Here's it in action (it's slightly slower than the Python version, however.)
![[Image: 788dec1e309a896fafe9d6b648903b45.gif]](https://i.gyazo.com/788dec1e309a896fafe9d6b648903b45.gif)
The code, please criticise me.
PHP Code
<?php
package typingTest;
import java.util.List;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class TypingBot {
static final String URL = "http://typing-speed-test.aoeu.eu/";
static final ChromeDriver DRIVER = new ChromeDriver();
static List<WebElement> wordList;
public static void main(String[] args) {
DRIVER.get(URL);
setWordList();
run();
}
synchronized public static void setWordList() {
wordList = DRIVER.findElementsByXPath("//*[@id=\"words\"]/span");
}
synchronized public static void run() {
WebElement input = DRIVER.findElementById("input");
for(WebElement el : wordList) {
String word = el.getAttribute("innerHTML") + " ";
input.sendKeys(word);
}
}

