d.findElement(By.id("go")).submit();
// Uploading files across a network may take a while, even if they're really small.
// Wait for the loading label to disappear.
WebDriverWait wait = new WebDriverWait(d, 10);
wait.until(ExpectedConditions.invisibilityOfElementLocated(By.id("upload_label")));
d.switchTo().frame("upload_target");
wait = new WebDriverWait(d, 5);
wait.until(ExpectedConditions.textToBePresentInElementLocated(By.xpath("//body"), LOREM_IPSUM_TEXT));