Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Selenium by (5k points)

For single files it is working fine, this is the path.

"C:\\testdata\\testfile.txt"

But, syntax changes for multiple uploads and different browsers.

(

IE: 

"\"" + "C:\\Selenium\\TestData\\Flexy - BigFile1.txt"+"\"" +"\""+"C:\\Selenium\\TestData\\Flexy - BigFile2.txt" + "\""

CHROME: 

"C:\\Selenium\\TestData\\Flexy - BigFile1.txt"+"\n"+"C:\\Selenium\\TestData\\Flexy - BigFile2.txt".

Is there a common syntax available for all browsers?

1 Answer

0 votes
by (10.2k points)

Well, Selenium still does not support the uploading of multiple files. There is at least one workaround available: apparently create a form that contains as many input fields as you need. It is not the best solution, as it requires altering your code for selenium to work. However, as you have found out,  it does seem possible to trigger multiple file uploads in chrome and IE as well.

It is confirmed that the chrome "\n" trick works both locally and on Browserstack. I hope it will work for the problem you mentioned. 

Browse Categories

...