开发者

Malformed url exception linux local file system

开发者 https://www.devze.com 2023-03-18 18:30 出处:网络
I have been trying to execute a selenium.attachFile command to upload a file开发者_运维百科- sel.attachFile(dom_locator,\"/home/xyz/Desktop/tstfl.txt\");

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号