When testing on Firefox 55.0 Selenium 3.5.3, I encountered an issue with focusing on an input element and then focusing out after editing the text, so that client side validation can occur and display any errors as needed.
javascriptExecutor.executeScript("document.getElementById('" + elementId + "').focus();");
javascriptExecutor.executeScript("document.getElementById('" + elementId + "').blur();");
This is the code snippet in question.
The problem lies in the fact that while the code runs without any errors, it fails to consistently display errors. I have implemented a WebDriverWait for 5 seconds to allow the error to appear.
I am perplexed as to why my code randomly fails on Firefox. Any insights into this issue are appreciated.