简体   繁体   中英

C# Selenium - Send Keys Not Working - Downloading a File - Need Solution

I am trying to automate the ' Downloading a File ' using c# selenium in the IE9 browser. I tried my level best in exploring the Google to find the solution but nothing helps or works out.

My approach is, i just used ' send keys ' but still the send keys are not able to send the keys.

Waiting for the solution. I am sure some one had automated this scenario.


Requirement specs:
Programming language:  C#
Automation Tool:Selenium
browser:IE9

Some HTML and C# code will be nice. I can't understand why you use SendKeys() for

automate the 'Downloading a File'

Usually if the page allows it, this method is used to Upload a file. You don't need Selenium to download a file, try with the WebClient class :

using System.Net;
//...
WebClient Client = new WebClient ();
Client.DownloadFile("http://www.thereforesystems.com/wp-content/uploads/2008/08/image35.png", @"C:\mypicz\stackoverflowlogo.png");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM