简体   繁体   English

从硒获取网格(集线器节点)信息

[英]Getting grid (hub-node)information from selenium

Java中是否有用于硒的API来获取中心节点详细信息,我的意思是获取活动节点的数量,IP地址,每个节点中配置的浏览器等。

Here, I got one solution. 在这里,我有一个解决方案。 It works only if you know the hub & node machine url 仅当您知道集线器和节点机器的URL时它才起作用

Object object= client.getForObject(baseUrl+"/grid/api/proxy?id="+ipaddress[i], Object.class); 对象object = client.getForObject(baseUrl +“ / grid / api / proxy?id =” + ipaddress [i],Object.class);

Here client is an instance of RESTTemplate class of spring frame work. 这里的客户端是Spring框架工作的RESTTemplate类的实例。 BaseUrl:_url of hub ipaddress[i]:-Node machine IP. 集线器ipaddress [i]的BaseUrl:_url:-节点机器IP。

Result should be like 结果应该像

<200 OK, { success=true, msg=proxy found !, id=http://192.168.3.37:5555, request={class=org.openqa.grid.common.RegistrationRequest, id=null, name=null, description=null, configuration={port=5555, servlets=[], host=192.168.3.37, Dwebdriver.ie.driver=C:\Anoop\IEdriver\IEDriverServer.exe=, cleanUpCycle=5000, Dwebdriver.chrome.driver=C:\Anoop\chromeDriver\chromedriver.exe=, browserTimeout=0, hubHost=localhost, registerCycle=5000, capabilityMatcher=org.openqa.grid.internal.utils.DefaultCapabilityMatcher, newSessionWaitTimeout=-1, hub=http://localhost:4444/grid/register, url=http://192.168.3.37:5555, remoteHost=http://192.168.3.37:5555, register=true, throwOnCapabilityNotPresent=true, nodePolling=5000, proxy=org.openqa.grid.selenium.proxy.DefaultRemoteProxy, browser=browserName=firefox, maxSession=5, role=node, jettyMaxThreads=-1, hubPort=4444, timeout=300000}, capabilities=[{seleniumProtocol=WebDriver, platform=WIN8_1, browserName=firefox}, {seleniumProtocol=WebDriver, platform=WIN8_1, browserName=chrome}, {seleniumProtocol=WebDriver, platform=WIN8_1, browserName=internet explorer}]}},{Content-Type=[application/json;charset=UTF-8], Content-Length=[1185], Server=[Jetty(7.x.y-SNAPSHOT)]}>

curl http://myhub.com:4444/grid/api/proxy?id=http://172.22.25.164:5555

172.22.25.164 - ip of selenium node 172.22.25.164-硒节点的IP

output >>> 输出>>>

{"success":true,... }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Selenium Grid:如何以编程方式从HUB检索节点信息? - Selenium Grid: How to retrieve node information from HUB programatically? Selenium 网格集线器和节点来自 Java 代码 - Selenium Grid Hub and Node from Java Code 在同一台机器上运行 selenium 网格集线器和节点 - Run selenium grid hub and node the same machine 在使用 Selenium Grid 时,我们如何从 Hub 机器访问 Node 机器中下载的文件? - While using Selenium Grid, How do we access downloaded file in Node machine from Hub machine? 硒节点/集线器身份验证 - Selenium Node/Hub Authentication 硒集线器和节点问题 - Selenium hub and node issue 使用Selenium Grid从Linux集线器运行IE测试 - Using Selenium Grid to run IE tests from a linux hub 无法注册此节点:发送注册请求时出错:无法将 Selenium Grid Node 连接到 Grid Hub - Couldn't register this node: Error sending the registration request: Failed connecting Selenium Grid Node to Grid Hub 有什么方法可以从集线器节点远程设置网格节点? - Is there any way to setup grid nodes from the hub node remotely? 在Selenium Grid的并行测试中,如何让集线器决定执行哪个节点? - How to let the hub decide which node to execute during the parallel testing of the Selenium Grid?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM