sagarpabba / selenium-vba

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

Change firefox preferences #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Operating system :
.Net Framework version : 3.5
Office Version : 2010
SeleniumWrapper version : 1.0.6

I need to download files without confirmation and seen that it could be done in 
selenium rc using setPreference command. Is there currently any way to 
manipulate firefox preferences (about:config) using Selenium VBA or is it going 
to appear or how can I implement it myself if it not overwhelmingly cumbersome?

I've managed to implement this task in Win7/Chrome/Office 2010 environment 
since Chrome doesn't ask confirmation by default. But script crushes in 
WinXp/Chrome/Office 2003 which most users are equipped with and firefox has 
this confirmation issue yet unresolved.

Original issue reported on code.google.com by frolo...@gmail.com on 9 Aug 2012 at 11:59

GoogleCodeExporter commented 9 years ago
Cannot find how to change report type from "Defect" to "Feature request". I 
hope my question won't look offensive =)

Original comment by frolo...@gmail.com on 9 Aug 2012 at 12:02

GoogleCodeExporter commented 9 years ago
I implemented the setPreference command in the next release (1.0.6.2). It 
should be available at the end of the week. 
It will apply to Firefox only. Here is the way to use it to automatically 
download a file :

  Dim selenium As New SeleniumWrapper.WebDriver 
  selenium.setPreference("browser.download.folderList",2); 
  selenium.setPreference("browser.download.manager.showWhenStarting",false); 
  selenium.setPreference("browser.download.dir","c:\downloads");        'Target folder 
  selenium.setPreference("browser.helperApps.neverAsk.saveToDisk","text/csv"); 'MIME types separated by a comma 
  selenium.start "firefox", "https://www.google.com/" 

The setPreference command must be placed before the start command.
The target folder must exist for the preference "browser.download.dir".
For each file type, the MIME has to be defined in 
"browser.helperApps.neverAsk.saveToDisk" 
[http://www.webmaster-toolkit.com/mime-types.shtml]

Original comment by florentbr on 20 Aug 2012 at 3:51

GoogleCodeExporter commented 9 years ago
Could you provide me detailed information in a new ticket (steps to reproduce, 
screen captures...) about the crash you have with WinXp/Chrome/Office 2003 ?
Thanks.

Original comment by florentbr on 20 Aug 2012 at 3:58

GoogleCodeExporter commented 9 years ago
Implemented in version 1.0.6.1

Original comment by florentbr on 26 Aug 2012 at 8:39