Upload a file
Add ability to upload a file
Previously, uploading a file was: Command: type Target (xpath/css): data.upload.whatever Value (file path): /users/foo/bar/file.png
Now it doesn't work and gives an error: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string.
I'm afraid that's currently impossible,
The new extension standard doesn't allow filesystem access, to protect users.
Cant you simulate it somehow? Serialize the file as part of the project?
On Mar 7, 2018 10:03, "Tomer Steinfeld" [email protected] wrote:
Closed #120 https://github.com/SeleniumHQ/selenium-ide/issues/120.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/SeleniumHQ/selenium-ide/issues/120#event-1508277566, or mute the thread https://github.com/notifications/unsubscribe-auth/AD_LoJXJyLw3r_GGBcwqv7Wf8BwFSC7aks5tb5RKgaJpZM4Sf4Ie .
I can add a file upload, and save it as base64 as part of the project,
I'll also need to add some kind of file management view to delete old files.
Not being able to upload a file would be a disaster. Countless tests involve uploading an image or a video such as a profile image or album or youtube video.
The Kantu Selenium IDE can upload files, see https://a9t9.com/kantu/docs/webextensions#fileupload - so technically it is doable.
@idefix, He said he can, but didn’t want.
@Jongkeun Ah, yes, I missed that. But also, Kantu uses a direct file upload, not the base64 method suggested here. So no need to add file management.
We threw a few ideas at the office, I’ve found a workaround for chrome, but it doesn’t work on Firefox.
Cheers, Tom
On 9 Mar 2018, 12:05 +0200, idefix1 [email protected], wrote:
@Jongkeun Ah, yes, I missed that. — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
Just here to update, I'm working on it for Chrome,
Firefox might take a bit longer because the same method doesn't work for it.
I'm gonna look for a way to bring file upload to both.
Anyway like Kantu, using this workaround I won't be able to recreate the path the file was uploaded from, and you'll have to reenter it.
We have a way to get this working on Chrome,
In playback it's gonna work on Chrome, and once we change the playback to work on top of webdriver instead of selenium core, we'll ship it to Firefox as well.
Just to note, we're gonna finish up working on running in CI on top of webdriver as well, which we will support file upload in too, so that you can use it with firefox that way.
Thank you. I'm waiting for this to be shipped to the selenium ide chrome extension!
I'm running the current release in Chrome from April (after Mar 13) and there does not appear to be a way to upload a file. I'm looking for commands like "get file" or "upload file" and don't see any.
Just like in Selenium, use:
type | locator to input[type="file"] | /path/to/the/file.png
This still does not work on the latest Chrome. Has anyone actually tried this?
This test is ran daily, and confirmed working.
@kwmtang Yes people test this and try this.

OK. I just tried it on the Github profile picture and I found:
Using this target works: id=upload-profile-picture
But using this target doesn't work: //*[@id="upload-profile-picture"]
They mean the exact same thing except the first one is css and the 2nd is xpath. This looks like a bug.
xpath isn't supported, because the underlying engine used doesn't support it.
Furthermore the reference tab and errors say this exact thing.
No way!! Selenium not supporting xpath is like a Chinese restaurant not serving rice!!!
But this isn't a selenium command (hehe), webextensions don't support selenium file uploads, instead we are using Chrome debugging protocol, that only supports query selectors.
This is gotta be a P0 blocker. How can Selenium IDE be expected to survive without this feature? My devs almost never have the time to make ids with all the crazy fields and buttons that need to be made every sprint and QA makes do with whatever crazy fragile xpaths we can use. We are able to keep up because IDE is so much faster to write than our TestNG and RobotFramework tests. Can we escalate this somehow? This is a mission critical feature. Any testing of a modern site/app will normally include uploading images, documents, audio, and video files.