INTENT TO SHIP: Change in behavior for IE driver calling click() on <input type="file"> elements

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

INTENT TO SHIP: Change in behavior for IE driver calling click() on <input type="file"> elements

Jim Evans
The W3C WebDriver Specification[1] calls out that the correct behavior for the "Element Click" command (WebElement.click() in Selenium's API) is that when that command is called on a file upload element (<input type="file">), the command should return an error. This will be the behavior of the IE driver in a future release. Please plan accordingly.

Editorial commentary: For years, the guidance from the Selenium development team has been that uploading files should be done using the sendKeys() method, sending the full path to the file to the <input type="file"> element. In many cases, this guidance has been ignored, with users (incorrectly) using the click() method and using some other mechanism[2] to handle the resulting file selection dialog. Starting with a future version of the IE driver, calling click() no longer work in the IE driver; it will throw an exception. If you have not followed the guidance of the Selenium project for uploading files, you will need to change the way your browser automation code handles this for Internet Explorer.

Jim Evans
Maintainer, Internet Explorer Driver
Selenium Project

[1] https://w3c.github.io/webdriver/webdriver-spec.html
[2] Sometimes the mechanism suggested is to use something properly cross-platform, but often it's to use a proprietary and non-open-source solution like AutoIt!

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/889fc391-3792-4e91-a566-e3a0805939a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.