为什么FireFoxDriver不在selenium webdriver中使用System.setProperty命令?

时间:2014-09-25 05:04:56

标签: selenium-webdriver

为什么我们在selenium webdriver命令行中为FireFox以外的浏览器需要System.setProperty

背后的逻辑是什么?

1 个答案:

答案 0 :(得分:1)

Selenium为Firefox提供原生支持。根据文件,

Controls the Firefox browser using a Firefox plugin. The Firefox Profile that is used is stripped down from what is installed on the machine to only include the Selenium WebDriver.xpi (plugin).

然而,Chrome和IE的工作方式不同,

Chrome驱动程序: WebDriver works with Chrome through the chromedriver binary (found on the chromium project’s download page). You need to have both chromedriver and a version of chrome browser installed. chromedriver needs to be placed somewhere on your system’s path in order for WebDriver to automatically discover it. The Chrome browser itself is discovered by chromedriver in the default installation path.

IE仅适用于Windows, This driver is controlled by a .dll and is thus only available on Windows OS. Each Selenium release has its core functionality tested against versions 6, 7 and 8 on XP, and 9 on Windows7.

您可以参考该文档以更好地理解Selenium Document