首页 > 技术文章 > [Selenium] 如何在老版本的Chrome 浏览器上使用selenium

feifeidxl 2015-05-29 15:40 原文

由于Chrome Driver 只兼容Chrome  浏览器12.0.712.0 和之后的新版本,会因此如果要在老版本的Chrome  浏览器上使用Selenium, 则只能使用 SeleniumRC来完成任务,示例代码:

URL seleniumRC = new URL("http://localhost:4444");

URL testWebLink = new URL("http://www.google.com");

CommandExecutor executor = new SeleneseCommandExecutor(seleniumRC, testWebLink, DesiredCapabilities.chrome());

WebDriver driver = new RemoteWebDriver(executor);

推荐阅读