input[file]
(, CSS) :
driver.findElement(By.cssSelector("input.your-file-input-class")).sendKeys("/my/file/path");
input.your-file-input-class
. CSS .
, , - . input[type="text"]
, , .
driver.findElement(By.cssSelector("input[type=\"text\"]")).sendKeys("/my/file/path");
, , myfilepath
- , . , , :
String myfilepath = "/path/to/file";
driver.findElement(By.cssSelector("input[type=\"text\"]")).sendKeys(myfilepath);
, , , :
WebDriverWait wait = new WebDriverWait(driver, 60); // 1 min timeout
WebElement el = wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("input[type=\"text\"]")));
el.sendKeys(myfilepath);