嗨,我有关于Selenium集线器容量/等待插槽的问题。
使用docker-selenium:
selenium/node-chrome-debug:3.141.59-zirconium
Python连接代码:
from selenium import webdriver
from selenium.webdriver.remote.remote_connection import RemoteConnection
def connect(hub_url, capabilities, chrome_options):
RemoteConnection.set_timeout(3)
driver = webdriver.Remote(
hub_url, desired_capabilities=capabilities, options=chrome_options,
)
return driver一开始运行OK,但是第二段代码正在等待空闲插槽,3秒后,我将从selenium/webdriver/remote/remote_connection.py获得连接超时(这很好)。但是请求挂起=在网格控制台中有信息:
1 requests waiting for a slot to be free. Capabilities {browserName: chrome, goog:chromeOptions: {args: [load-extension=/extension], extensions: []}, loggingPrefs: org.openqa.selenium.logging..., version: }
释放插槽后,chrome从url中的data:,开始,什么事情都没有发生。这就是为什么我想清理挂起的请求的超时。
如何在连接超时时删除此等待请求?
发布于 2020-03-12 08:15:26
我还是不知道该怎么处理这个等待请求。但是,与客户端超时相比,使用服务器超时可能更好。因此,在运行Selenium时使用newSessionMaxWaitTimeInSeconds标志,而不是客户端超时。
这解决了我现在的大部分问题。
https://stackoverflow.com/questions/60617024
复制相似问题