I have a C# Selenium WebDriver script that uses the AutoItX3Lib to attempt to perform a download of an excel file.
The script works up to the point when it clicks the link to start the download.
Relevant section of script copied below:
// Wait until "Contacts.xls" link displays
WebDriverWait wait4 = new WebDriverWait(driver, TimeSpan.FromSeconds(300));
wait4.Until(ExpectedConditions.ElementIsVisible(By.LinkText("contacts.xls")));
// Click "Contacts.xls"
driver.FindElement(By.LinkText("contacts.xls")).Click();
// Perform file download and saving using AutoIt
autoit.WinActivate("Opening contacts.xls","");
autoit.Send("{ALTDOWN}s{ALTUP}");
autoit.Sleep(3000);
autoit.Send("{ENTER}");
The problem is that at the first Send command (autoit.Send("{ALTDOWN}s{ALTUP}");) ,which should send the ALT + s keys to the Firefox file download dialog window, the script stops. However, instead of sending the keys to the Firefox file download dialog window, it sends the keys to Visual Studio (which is IDE that I am using to create and execute the script).
Thanks in Advance