leochabi / selenium-vba

Automatically exported from code.google.com/p/selenium-vba
0 stars 1 forks source link

How to complete save-as form in Chrome with sendKeys #81

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Operating system : Win 7
.Net Framework version : 4.0
Office Version : 2010
SeleniumWrapper version : 1.0.19.0

What is your issue ? I am trying to populate the save-as dialog box
and save file to a local directory. I am able to invoke the save-as dialog box 
but not able to send any keys such as file name. 

I saw a code snippet in a prev post but did not understand what "pagename.htm" 
stood for.

Please also let me know how to set the download directory. Thanks so much for 
your help.

shell.SendKeys "^s"
driver.Wait 1000
shell.SendKeys "pagename.htm{ENTER}"

Original issue reported on code.google.com by usmur...@gmail.com on 31 Jul 2014 at 10:44

GoogleCodeExporter commented 8 years ago
The SendKeys is a Microsoft method to simulate keyboard inputs:
http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys(v=vs.110).
aspx

The string "pagename.htm" is the file that is created from the saving. If you 
want to specify a directory, just add it in the front:
shell.SendKeys "c:\pagename.htm{ENTER}"

Original comment by florentbr on 4 Aug 2014 at 4:54

GoogleCodeExporter commented 8 years ago

Original comment by florentbr on 8 Sep 2014 at 5:40