How do I upload a file using Selenium tool in automation testing? I tried with the following code:
selenium.attachFile(//*[@id='file-uploader']/div/div[1]",
"C:\\Users\\Public\\Pictures\\Sample Pictures\Desert.jpg");
This is the error I am getting:
Malformed URL C:\\Users\\Public\\Pictures\\Sample Pictures\\Desert.png.
It has to be in this format:
We’re dealing with the Windows world, so the slashes are backwards.
Try this: