`
冰糖葫芦有点酸
  • 浏览: 29867 次
  • 性别: Icon_minigender_2
  • 来自: 武汉
社区版块
存档分类
最新评论

UI Automation - Chrome Driver Cannot Load Flash Plugin

 
阅读更多
Since Chrome driver won't setup flash plugin by default, then we can add it in coding when initial drvier.

Here is the simple demo:
System.setProperty("webdriver.chrome.driver", "C:/chromedriver.exe");
ChromeOptions options = new ChromeOptions();

//set "--ppapi-flash-path" as pepflashplayer.dll loaction. can check in Chrome browser with "chrome://flash/"
options.addArguments("--ppapi-flash-path=" + installPath);
// add follwing param if always popup outdate message.
options.addArguments("--allow-outdated-plugins=true");

WebDriver driver = new ChromeDriver(options);
// open the home page of Baidu
driver.get("http://www.baidu.com/");

If necessary, here is the way to set all user configurations of Chrome browser for Chrome webdriver, such as tags and plugins.
options.addArguments("user-data-dir=" + System.getProperty("user.home").replace("\\", "/") + "/AppData/Local/Google/Chrome/User Data");
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics