Reputation: 11
As chrome has blocked Java, Silverlight and other plugins by default now. So to make it work we need to Enable the NPAPI in chrome://flags and restart the browser to make the setting into effect,the same needs to be done in chrome driver however the setting gets lost after restarting the chrome driver, is there any way to make the permanent settings into chrome driver?
Upvotes: 1
Views: 2863
Reputation: 323
When you open a new instance[profile] of the chrome browser every time, npapi flag can be enabled by using following line:
browser = Watir::Browser.new :chrome,:switches => %w[--enable-npapi]
Upvotes: 0
Reputation: 2280
My earlier comment was wrong because desired capabilities is for non-browser specific settings like proxy address. If you want to modify Chrome behavior, you need to use ChromeOptions. Create Webdriver keyword was created for special cases like this:
*** Settings ***
Library Selenium2Library
*** Test Cases ***
Stackoverflow
${options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
Call Method ${options} add_argument always-authorize-plugins
Call Method ${options} add_argument enable-npapi
Create WebDriver Chrome chrome_options=${options}
Go To https://www.java.com/verify
Close All Browsers
Upvotes: 3