简体   繁体   中英

Malformed url exception linux local file system

I have been trying to execute a selenium.attachFile command to upload a file-

sel.attachFile(dom_locator,"/home/xyz/Desktop/tstfl.txt");

but getting a Malformed URL Exception for the file path specified. The file is present in the linux local file system. Please help me with the proper format of the file path.

Likely what you need is

sel.attachFile(dom_locator,"file:///home/xyz/Desktop/tstfl.txt");

For an explanation of file uris, see File URI scheme in wikipedia.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM