You can verify that the employeeName text field is filled in before proceeding with this code -
new WebDriverWait(driver,10).until(new ExpectedCondition<Boolean>() { public Boolean apply(WebDriver driver) { String text = driver.findElement(By.id("employeeName")).getText(); return !text.equals(""); } });
Now this code checks to see if the text in the employeeName text field is empty. If it is empty, the driver waits 10 seconds or if some data is filled in the text field due to an AJAX call, then it continues with execution.
If this does not work, you can publish part of your code with which you make an AJAX call.
source share