I'd like to side step the dialog box and upload a file using the sendKeys method but it doesn't seem to work. Is anything wrong with the following code?
WebDriver driver = new FirefoxDriver();
String filename = "test.txt";
File file = new File(filename);
String path = file.getAbsolutePath();
driver.get("http://www.megafileupload.com/");
driver.manage().window().maximize();
driver.findElement(By.cssSelector("i.fa.fa-upload")).click();
driver.findElement(By.cssSelector("div[class=internal] i.entypo-upload")).sendKeys(path);
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.findElement(By.cssSelector("button.btn.btn-green.btn-lg")).click(); //upload button