Is sendKeys ever going to work properly with Java Selenium? : <p>how am I ever going to write any selenium automation code that can have the same outcome everytime and could ever ever ever be trusted? 
as most of you should know sendKeys is simply shit.</p>

<p>-it doesnt write the complete input</p>

<p>-sometimes it doesnt write at all</p>

<p>-its skips to other elements and messes up the input</p>

<p>-it cant write longer character sequences</p>

<p>-you cant check it correctly</p>

<p>-you cant make it wait.until everything is sent</p>

<p>and this all is simply randomized into a clusterfuck of one-to-a-billion
my at this moment examples (I probably changed my approach more than 10 times)</p>

<pre><code>public static void sendKeys(By by, String input) {
    if (by == null) {
        throw new IllegalArgumentException("Parameter 'by' is null.");
    }
    if (input == null) {
        throw new IllegalArgumentException("Parameter 'input' is null.");
    }
    LOGGER.info("sendKeys() - By locator '{}'", by.toString());
    WebElement elem = WebElementFinder.getElement(by);
    elem.clear();
    elem.sendKeys(input);
    checkKeySendResult(by, input);
    }

public static void checkKeySendResult(By by, String input) {
    WebElement elem = WebElementFinder.getElement(by);
    String value = elem.getAttribute("value");
    if (!value.equals(input)) {
        LOGGER.info("sendKeys() - didn't work");
        elem.clear();
        elem.sendKeys(input);
        checkKeySendResult(by, input);
    } else {
        LOGGER.info("sendKeys() - sent all characters");
    }
}
</code></pre>

<p>you know what I expect; </p>

<p>-all keys should be sent</p>

<p>-sendKeys shouldn't stop midway of typing and then go somewhere else</p>

<p>-I should be able to correctly check if the input is right</p>

<p>-if incorrect, I should be able to correct it easily and unwaveringly</p>

<p>and please dont tell me to use a waiter, cause I obviously did try out waiters in every single step...</p>

<p>I'll test out any kind of advice offered here as I do hope everyone does and hopefully someone can open my eyes to a steady sendKeys method.</p>

<p>if you cant help me, please do use this thread to ragingly describe your hatred towards sendKeys and how frustrating it is to be working with it.</p>

<p>Thank you all for your input.</p>

<p>obs: sorry for my french</p>
