How to authorize plugins execution for ChromeDriver?

1,696 views
Skip to first unread message

Juan Luna

unread,
Jun 7, 2013, 10:05:22 AM6/7/13
to webd...@googlegroups.com
Hello everyone, 

My system:
Windows 7 64 bits // Selenium 2.31.0 // ChromeDriver server (v2.0.204324.dyu) // Chrome 27.0.14

When using ChrimeDriver, I have the following two questions:

1. ChromeDriver is logging all the "INFO" level messages into my console, how can I disable it?

I have tried by changing the ""--logging-level=1" or using "capabilities.setCapability("chrome.switches", Arrays.asList("--disable-logging"));" but I still have the INFO messages.

2. My application uses a Java applet. So when testing it I get the yellow ribbon asking authorization to run it (Java(TM) needs your permission to run...) How to authorize it?

I have tried capabilities.setCapability("chrome.switches", Arrays.asList("--always-authorize-plugins=true")); and I cannot treat it as an alert (driver.switchTo().alert().accept();)....so not sure how to deal with it.


Any help is appreciated.

The console shows the following information when creating the chrome instance:

[0.979][INFO]: received WebDriver request: POST /session {
   "desiredCapabilities": {
      "browserName": "chrome",
      "chrome.switches": [ "--always-authorize-plugins" ],
      "platform": "ANY",
      "version": ""
   }
}
[1.024][INFO]: Launching chrome: "C:\Users\jluma\AppData\Local\Google\Chrome\Application\chrome.exe" --remote-debugging-port=54689 --no-first-run --enable-logging --logging-level=1 --user-data-dir="C:\Users\jluma\AppData\Local\Temp\scoped_dir8436_1109" --load-extension="C:\Users\jluma\AppData\Local\Temp\scoped_dir8436_3085\internal" --ignore-certificate-errors data:text/html;charset=utf-8,
[8.682][INFO]: sending WebDriver response: 303 
[8.704][INFO]: received WebDriver request: GET /session/bb9fe10d279720236f2ebdc878474bb2 
[8.704][INFO]: sending WebDriver response: 200 {
   "sessionId": "bb9fe10d279720236f2ebdc878474bb2",
   "status": 0,
   "value": {
      "acceptSslCerts": true,
      "applicationCacheEnabled": false,
      "browserConnectionEnabled": false,
      "browserName": "chrome",
      "chrome": {
         "chromedriverVersion": "2.0"
      },
      "cssSelectorsEnabled": true,
      "databaseEnabled": true,
      "handlesAlerts": true,
      "javascriptEnabled": true,
      "locationContextEnabled": true,
      "nativeEvents": true,
      "platform": "Windows NT",
      "rotatable": false,
      "takesScreenshot": true,
      "version": "27.0.1453.110",
      "webStorageEnabled": true
   }
}


ValB

unread,
Feb 3, 2014, 5:47:10 PM2/3/14
to webd...@googlegroups.com
Hi Juan,
   Did you ever find a solution for this (item 2)?  I have the same problem, can't get e.g. --always-authorize-plugins to have any effect. 

   Not entirely thrilled with this as a solution, but I did find the following workaround: When launching Chrome to run your test, first load the plugins page i.e.

driver.get("chrome://plugins/");

then, check all the checkboxes on the page to enable all plugins (could of course do it more selectively too):
for (WebElement e : driver.findElements(By.xpath("//input[@type='checkbox']")))
    { if (!e.isSelected())
         e.click(); }

Manjunath T

unread,
Apr 1, 2014, 2:02:55 AM4/1/14
to webd...@googlegroups.com
Hi Guys,

I had similar problem for item#2. We had plugin which will always ask for the "run this time" or "always run". by adding below option i could solve the problem.


ChromeOptions options = new ChromeOptions();
options.addArguments("--always-authorize-plugins=true");
capabilities.setCapability(ChromeOptions.CAPABILITY, options);




 
Reply all
Reply to author
Forward
0 new messages