Reputation: 184
I've been search in internet for 2 hours or something like that and now I'm a bit frustrated. Sorry if the answer is "duplicated" but I can't find what I want in anywhere and I'm a bit newbie in c# so.
I have to automate a process in internet explorer, the problem is when I have to download an excel file to work with it, I don't know how can I select de "Save" option in the pop-up of open, save, save as...
I try
SendKeys.SendWait(System.Windows.Forms.Keys.Down.ToString());
SendKeys.SendWait(System.Windows.Forms.Keys.Enter.ToString());
and the same with SendKeys.Send(...);
the system not simulate the down or enter, but If i do it with keyboard it works, what I want exactly is to simulate keyboard key pressing with down arrow and then enter.
((Sorry if my english is bad)) POP UP
I think that I can solve the problem if I press the save option ("guardar") simulating keyboard presses, I need to download the file but I don't know how, It have to be all automatic process without user intervention that will enter into a database fields of excel automatically every hour.
Upvotes: 1
Views: 1200
Reputation: 474
You should find a node in html code
<input id='fileupload'>
or something like that. Then may use
driver.FindElement().SendKeys(type absolute path to folder where do you want save file)
This is the easiest solution but if you must handling dialog you can take a look at link or similar post related to this topic (selenium dialog window)
Upvotes: 1