I'm using Java, Selenium, and chrome for test automation.
I want to enter a text, wait for it to be displayed and then click on TAB, I want to avoid thread.sleep
so i'm using this code :
WebElement societe = wait.until(ExpectedConditions.elementToBeClickable(By.id("AutoComplInputBoxfld_XSociete")));
societe.sendKeys("Text");
driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
societe.sendKeys(Keys.TAB);
But it leave the field blank and goes to the next element.
- How can i fix it?
- Is there a way to use explicit wait before sendkeys?
You can use something like this:
you need to configure fluent wait to have certain timeouts, etc.