I have this code
File folder = new File("F:\\gals"); File[] listOfFiles = folder.listFiles();
this code returns an array of locations of all the files in the F: \ gals folder, and I tried to use this location in selenium code
driver.findElement(By.id(id1)).sendKeys(listOfFiles[1]);
and I see errors
The method sendKeys(CharSequence...) in the type WebElement is not applicable for the arguments (File)
so I think I need to convert listOfFiles [] to a String array, plz tell me an easy way to do this. thanks
source share