I am automating a page with two file upload buttons across all browsers. Here is the code snippet:
WebElement thumbnailClick = driver.findElement(By.id("PageForm_tile_src"));
jse.executeScript("scroll(0, 250)");
thumbnailClick.click();
This is the click on the first upload button, and this works perfectly in Chrome, but trying to run on Firefox gecko driver throws an InvalidArgumentException: Cannot click <input type=file> elements
error
I have to find these elements by id since there are multiple upload buttons on this page. Why would firefox reject this click when it is easy to do manually and works on any other browser?
Adding HTML of element:
<input name="PageForm[tile_src]" id="PageForm_tile_src" type="file">