问题描述
当在 Chrome 中运行 2 个测试时,我观察到任务管理器中正在运行太多 Google Chrome(32 位)进程,这是 Chome 驱动程序的正确行为吗
当通过 Google Chrome 执行多个 自动化测试 时,您一定观察到可能有几十个Google Chrome 进程正在运行,可以通过 Windows 任务管理器的 Processes
选项卡观察.
快照:
根据文章
结尾
您可以在 如何退出使用 Python 通过 GeckoDriver 和 Selenium 启动的所有 Firefox 进程
When 2 tests are running in Chrome, i have observed that too many Google Chrome(32 Bit) processes are running in Task manager, Is this a correct behavior of Chome Driver
When multiple automated tests are getting executed through Google Chrome you must have observed that there are potentially dozens of Google Chrome processes running which can be observed through Windows Task Manager's Processes
tab.
Snapshot:
As per the article SOLVED: Why Google Chrome Has So Many Processes for a better user experience Google Chrome initiates a lot of windows background processes for each tab that have been opened by your Automated Tests. Google tries to keep the browser stable by separating each web page into as many processes as it deems fit to ensure that if one process fails on a page, that particular process(es) can be terminated or refreshed without needing to kill or refresh the entire page.
However, from 2018 onwards Google Chrome was actually redesigned to create a new process for each of the following entities:
- Tab
- HTML/ASP text on the page
- Plugin those are loaded
- App those are loaded
- Frames within the page
In a Chromium Blog Multi-process Architecture it is mentioned:
As a conclusion, the many processes you are seeing is pretty much in line with the current implementation of
Outro
You can find a relevant discussion in How to quit all the Firefox processes which gets initiated through GeckoDriver and Selenium using Python
这篇关于谷歌浏览器多进程(32位)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!