Selenium WebDriver and browsers select file dialog
If you are trying to select a file for upload Selenium 2 supports HTML file inputs. For example:
<input type="file" id="uploadhere" />
IWebElement element = driver.FindElement(By.Id("uploadhere"));
Basically you “type” (with
SendKeys) the full file path to the file input element. Selenium handles the file selection dialog for you.
However if you want to manipulate an arbitrary file selection dialog, then like Anders said, you have to go outside of Selenium.
- You must login to post comments