Selenium 2.25, Firefox, OSX ML.
I have Selenium click a button that has an Ajax impact.
Then I want to interact with the results. Without the sleep below, I get an error that the click fails because it cannot scroll the click target into view. I don't get it. What's going on?
WebElement sampleComboInput = driver.findElement(By.id("sampleCombo-inputEl"));
sampleComboInput.click();
sampleComboInput.sendKeys("English-03.txt");
sampleComboInput.sendKeys(Keys.TAB, Keys.TAB);
WebElement goButton = driver.findElement(By.id("inputDialogGoButton-btnInnerEl"));
goButton.click();
WebElement resultsSpan = driver.findElement(By.cssSelector("span.ne-type-node.PERSON"));
assertTrue(resultsSpan.isDisplayed());
assertEquals("PERSON (3)", resultsSpan.getText());
WebElement parent = resultsSpan.findElement(By.xpath(".."));
Thread.sleep(5000); // without sleep, get error unable to scroll
Actions action = new Actions(driver);
action.doubleClick(parent);
action.perform();