Skip to content

Instantly share code, notes, and snippets.

@angelovstanton
Created August 20, 2020 10:13
Show Gist options
  • Save angelovstanton/5003c0bcff2182e24a353b53d66835eb to your computer and use it in GitHub Desktop.
Save angelovstanton/5003c0bcff2182e24a353b53d66835eb to your computer and use it in GitHub Desktop.
@Test
public void fileUpload() throws IOException {
driver.navigate().to(
"https://demos.telerik.com/aspnet-ajax/ajaxpanel/application-scenarios/file-upload/defaultcs.aspx");
var element = driver.findElement(By.id("ctl00_ContentPlaceholder1_RadUpload1file0"));
String filePath = Paths.get(getProperty("java.io.tmpdir"), "debugWebDriver.xml").toString();
File destFile = new File(filePath);
destFile.createNewFile();
element.sendKeys(filePath);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment