selenium: IEDriver 3.2 doesn't work with file input dialog

Meta -

OS:
Windows 7 64Bit Selenium Version:

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>3.2.0</version>
</dependency>

Browser:
Internet Explorer 11

Browser Version:
11.0.9600.18015

Expected Behavior -

SendKeys to a file input field opens the file dialog and sets the correct path and closes the file dialog.

Actual Behavior -

With IEDriver 32Bit 3.2 no path is set and the dialog stays open. Switching to IEDriver 3.1 (now used because 3.2 doesnt work) or 2.48 (was used before updating to selenium 3) resolves the issue.

Steps to reproduce -

Following codes shows the missbehavior (you need to adjust paths):

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.ie.InternetExplorerDriver;

public class TestFileUpload {

	public static void main(String[] args) {
		String driverPath_2_48 = "C:/work/temp/iedriver/2.48/IEDriverServer.exe";
		String driverPath_3_1 = "C:/work/temp/iedriver/3.1/IEDriverServer.exe";
		String driverPath_3_2 = "C:/work/temp/iedriver/3.2/IEDriverServer.exe";
		System.setProperty("webdriver.ie.driver", driverPath_3_2);
		InternetExplorerDriver driver = new InternetExplorerDriver();

		driver.get("https://www.google.de/imghp");

		driver.findElement(By.id("qbi")).click();
		driver.findElement(By.xpath("//a[text()='Bild hochladen']")).click();

		WebElement fileInput = driver.findElement(By.id("qbfile"));
		fileInput.sendKeys("C:\\work\\temp\\someImage.jpg");

		try {
			Thread.sleep(2500);
		}
		catch (InterruptedException e) {
			// ignore
		}

		driver.quit();
	}
}

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 26 (9 by maintainers)

Most upvoted comments

@jimevans: I set the timeout to 10secs but didnt help. I can reproduce this with the above snippet everytime. Can’t you reproduce it with the above code?

Same issue with 3.3 Should we expect fix for that soon? Just to add the same behavior apply to Edge as well!