Selenium WebDriver Selenium+java+chromedriver,无法加载控件

Jessica · 2016年07月26日 · 最后由 Jessica 回复于 2016年07月27日 · 1744 次阅读

想要用 Selenium+java+chromedriver 在 Win10 下做 PC 自动化
由于公司产品使用了一个支持视频和语音的第三方控件,控件要求需要使用指定版本的 chrome
控件是用.exe 文件安装的(叫做荣联云通讯提供的一个在线视频的第三方控件)
由于 selenium 无法直接带起 chrome.exe 所以使用了 google 提供的官方 chromedriver.exe,这样就无法使用指定版本的 chrome 来支持控件
同时,启动起来以后的 chromedriver 也无法加载控件

static String chromeUrl = "C:\\Users\\Jessica\\AppData\\Local\\Google\\Chrome\\Application\\chromedriver.exe";
public static void main(String[] args) throws InterruptedException {
    //需要使用chrom提供的专门exe才能启动并输入url
    System.setProperty("webdriver.chrome.driver", chromeUrl);
    ChromeOptions options = new ChromeOptions();
    options.addArguments("–user-data-dir=C:/Program Files (x86)/yuntongxun/WebPlugin");
    WebDriver driver = new ChromeDriver(options);
    driver.get("https://test.d.healthdoc.cn");
}

执行后是酱紫的

求大神给予解答😹

共收到 6 条回复 时间 点赞

不太理解这个第三方控件。。。 指的是 chrome 插件吗?

@spider 是用 exe 装的,装完之后是酱紫的

代码使用 markdown!!!!

#3 楼 @monkey markdown 之后帮我看下吧😂

2楼 已删除

这个我解决啦,每次启动都先进入 about:plugins 页面,把想要加载的插件允许一遍就好了嘛😂

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册