I am automating a UI test where selecting file to upload is involved, I was able to automate the file selection using this solution.
WebElement filepath=driv
To upload multiple files you can construct the character string adding all the absolute path of the files seperated by \n as follows:
\n
WebElement filepath = driver.findElement(By.id("fileUploadId")); filepath.sendKeys("C:/TextFile1.txt \n C:/TextFile2.txt \n C:/TextFile3.txt");