I'm automating the input to a search bar; the program work fine when using chrome driver, but fails when I try to use PhantomJS.
The text that should go in the search bar is not being typed properly:
WebElement searchBar = driver.findElement(By.cssSelector("input.sbox-ui-input")); searchBar.sendKeys(query); util.waitFor(3); // we wait to get all the possible suggestions searchBar.sendKeys(Keys.ENTER);
I also tried this code:
Actions action = new Actions(driver); action.sendKeys(searchBar, query).build().perform();
None of them are working. Is there another way to 'type' the text in the input/search bar?
I often had a similar problem when clicking certain buttons, so I had a script like this that worked with PhantomJS:
Is there something similar for sending text input?