获取Selenium4网格中单个会话ID的节点IP地址
我们正在从Selenium 3网格移动到Selenium 4网格(带有轮毂&节点设置)。我们需要能够获取当前会话正在执行的节点的IP地址(从driver.getSessionId()
selenium3 grid获取会话ID,我们从< Hub>///网格/api/testsession?session =< sessionId>
我找不到硒4网格的等效端点。我可以找到 graphql 查询参数,但它获取所有会议的详细信息。我只需要为一个会话ID找到会话详细信息。
有帮助吗?
We are moving from selenium 3 grid to selenium 4 grid(with hub & node setup). We need to be able to fetch IP address of node on which the current session is being executed on(session id is fetched from driver.getSessionId())
For selenium3 grid, we got this info from <hub url>/grid/api/testsession?session=<sessionId>
I cannot find an equivalent endpoint for selenium 4 grid. I could find graphql query parameters but it fetches details for ALL the sessions. I need to find session details only for ONE session id.
Any help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
注释:根据如何提出问题,我假设我们在谈论node uri,这并不总是它的精确IP地址。拥有URI,如果确实需要,则不难找到真正的IP。考虑到这一点...
GraphQl端点是去的地方。您可以通过查询特定的sessionID来缩小结果(如您指出的那样,您可以从WebDriver获取)。
卷曲示例:
Node.js中的原型:
打印出:
使用
grid graphql
Note: Based on how the question is formulated I assume we are talking about node URI, which it's not always precise IP address of it. Having the URI it shouldn't be difficult to find the real ip, if indeed needed. Taking this into account...
GraphQL endpoint is the place to go. You can narrow the results by querying for specific sessionID (which you can get from webdriver as you pointed out).
cUrl example:
Prototype in node.js:
Prints out:
Tested using a quick setup of selenium grid docker
Grid GraphQL documentation