这是否意味着 Selenium.WebDriver 正在使用 Marionette 协议直接与 Firefox 浏览器对话?
根据我的理解,当你设置System.setProperty("webdriver.firefox.marionette", "false");
假或做FirefoxOptions options = new FirefoxOptions()
.setLegacy(true);
这意味着它正在使用旧版扩展(不是 marionette 和 gecko),如 Firefox 属性中所述here https://github.com/SeleniumHQ/selenium/wiki/FirefoxDriver
如果不使用 gecko 就无法使用 Marionette (或者更确切地说,如果您想与基于 gecko 的浏览器交互,则必须使用 marionette )。 Marionette 中有一个 gecko 组件,它是前面提到的 marionette 服务器here https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette
壁虎司机 https://github.com/mozilla/geckodriver正如它写在 github 上一样,提供了一个 API 来与之通信壁虎浏览器 https://en.wikipedia.org/wiki/List_of_web_browsers#Gecko-based
该程序提供WebDriver协议描述的HTTP API
与 Gecko 浏览器通信
对于 selenium 3.0 及以上版本,默认情况下启用 marionette,如上所述here https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver
欲了解更多信息,请参阅this https://stackoverflow.com/questions/43272919/difference-between-webdriver-firefox-marionette-webdriver-gecko-driver/43920453还问
如果您有兴趣了解有关 marionette 客户端-服务器-gecko 交互的更多信息,请查看here http://vakila.github.io/blog/marionette-act-i-automation/
EDIT:
the 源代码 https://dxr.mozilla.org/mozilla-central/source/testing/geckodrivergeckodriver 在 readme.md 的不同位置指出了有关 geckodriver 的以下几点
geckodriver 是一个代理,用于使用 W3C WebDriver 兼容的客户端与
基于 Gecko 的浏览器。
Selenium 客户端绑定将获取壁虎司机二进制可执行文件
从你的[系统的PATH
环境变量][PATH]
3.由于geckodriver是一个独立的HTTP服务器,它是一个完整的
远端
[WebDriver] 的实现,可以避免使用
硒远程服务器
geckodriver 翻译 WebDriver [命令]、[响应]、
和 [Marionette 协议] 的 [错误],并充当之间的代理
[WebDriver] 和 [Marionette]
默认情况下 geckodriver 会尝试查找
并使用系统安装的Firefox
所以,为了回答你的问题,这就是一切的运作方式
Selenium 语言绑定reaches to
--> 壁虎驱动程序.exefinds
-->系统firefox安装(但这可以改变)reaches to inbuilt
--> 木偶客户端reaches to
--> 木偶服务器reaches to
--> 浏览器的 gecko 引擎which inturn calls out
--> element.js,interaction.js,action.js,evaluate.js
在 gecko 引擎中,取决于绑定或客户端的请求。